diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 76de9e5..da616c9 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,4 +1,3 @@ docker: - digest: sha256:56133a8648855cccff1389e56a8e7e22168f9ebde70c27b77c0c3ec6d15d90bb - image: gcr.io/repo-automation-bots/owlbot-python:latest - + image: gcr.io/repo-automation-bots/owlbot-python:latest + digest: sha256:c66ba3c8d7bc8566f47df841f98cd0097b28fff0b1864c86f5817f4c8c3e8600 diff --git a/.github/header-checker-lint.yml b/.github/header-checker-lint.yml index fc281c0..6fe78aa 100644 --- a/.github/header-checker-lint.yml +++ b/.github/header-checker-lint.yml @@ -1,6 +1,6 @@ {"allowedCopyrightHolders": ["Google LLC"], "allowedLicenses": ["Apache-2.0", "MIT", "BSD-3"], - "ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt"], + "ignoreFiles": ["**/requirements.txt", "**/requirements-test.txt", "**/__init__.py", "samples/**/constraints.txt", "samples/**/constraints-test.txt"], "sourceFileExtensions": [ "ts", "js", diff --git a/.kokoro/release.sh b/.kokoro/release.sh index 73cfd44..627f8a7 100755 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -26,7 +26,7 @@ python3 -m pip install --upgrade twine wheel setuptools export PYTHONUNBUFFERED=1 # Move into the package, build the distribution and upload. -TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google_cloud_pypi_password") +TWINE_PASSWORD=$(cat "${KOKORO_GFILE_DIR}/secret_manager/google-cloud-pypi-token") cd github/python-channel python3 setup.py sdist bdist_wheel -twine upload --username gcloudpypi --password "${TWINE_PASSWORD}" dist/* +twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/* diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index c28c9f7..ad86c76 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -23,18 +23,8 @@ env_vars: { value: "github/python-channel/.kokoro/release.sh" } -# Fetch PyPI password -before_action { - fetch_keystore { - keystore_resource { - keystore_config_id: 73713 - keyname: "google_cloud_pypi_password" - } - } -} - # Tokens needed to report release status back to GitHub env_vars: { key: "SECRET_MANAGER_KEYS" - value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" -} \ No newline at end of file + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem,google-cloud-pypi-token" +} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 32302e4..4f00c7c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,17 @@ +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# # See https://pre-commit.com for more information # See https://pre-commit.com/hooks.html for more hooks repos: @@ -12,6 +26,6 @@ repos: hooks: - id: black - repo: https://gitlab.com/pycqa/flake8 - rev: 3.9.0 + rev: 3.9.2 hooks: - id: flake8 diff --git a/.repo-metadata.json b/.repo-metadata.json index a2d33cc..99b5307 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -6,6 +6,7 @@ "issue_tracker": "", "release_level": "beta", "language": "python", + "library_type": "GAPIC_AUTO", "repo": "googleapis/python-channel", "distribution_name": "google-cloud-channel", "api_id": "cloudchannel.googleapis.com" diff --git a/CHANGELOG.md b/CHANGELOG.md index 8150a57..43f61f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ # Changelog +## [0.3.0](https://www.github.com/googleapis/python-channel/compare/v0.2.1...v0.3.0) (2021-05-28) + + +### Features + +* support self-signed JWT flow for service accounts ([c218e2e](https://www.github.com/googleapis/python-channel/commit/c218e2efeef2f2e4cf1646644a8d4c38be021bdf)) + + +### Bug Fixes + +* add async client to %name_%version/init.py ([c218e2e](https://www.github.com/googleapis/python-channel/commit/c218e2efeef2f2e4cf1646644a8d4c38be021bdf)) +* **deps:** add packaging requirement ([#43](https://www.github.com/googleapis/python-channel/issues/43)) ([e368062](https://www.github.com/googleapis/python-channel/commit/e36806211b8b3392811eb5ee1047517f840265c7)) + ### [0.2.1](https://www.github.com/googleapis/python-channel/compare/v0.2.0...v0.2.1) (2021-04-07) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index e083f9c..ca3dd9b 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -160,21 +160,7 @@ Running System Tests auth settings and change some configuration in your project to run all the tests. -- System tests will be run against an actual project and - so you'll need to provide some environment variables to facilitate - authentication to your project: - - - ``GOOGLE_APPLICATION_CREDENTIALS``: The path to a JSON key file; - Such a file can be downloaded directly from the developer's console by clicking - "Generate new JSON key". See private key - `docs `__ - for more details. - -- Once you have downloaded your json keys, set the environment variable - ``GOOGLE_APPLICATION_CREDENTIALS`` to the absolute path of the json file:: - - $ export GOOGLE_APPLICATION_CREDENTIALS="/Users//path/to/app_credentials.json" - +- System tests will be run against an actual project. You should use local credentials from gcloud when possible. See `Best practices for application authentication `__. Some tests require a service account. For those tests see `Authenticating as a service account `__. ************* Test Coverage diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..8b58ae9 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,7 @@ +# Security Policy + +To report a security issue, please use [g.co/vulnz](https://g.co/vulnz). + +The Google Security Team will respond within 5 working days of your report on g.co/vulnz. + +We use g.co/vulnz for our intake, and do coordination and disclosure here using GitHub Security Advisory to privately discuss and fix the issue. diff --git a/docs/_static/custom.css b/docs/_static/custom.css index bcd37bb..b0a2954 100644 --- a/docs/_static/custom.css +++ b/docs/_static/custom.css @@ -1,9 +1,20 @@ div#python2-eol { border-color: red; border-width: medium; -} +} /* Ensure minimum width for 'Parameters' / 'Returns' column */ dl.field-list > dt { min-width: 100px } + +/* Insert space between methods for readability */ +dl.method { + padding-top: 10px; + padding-bottom: 10px +} + +/* Insert empty space between classes */ +dl.class { + padding-bottom: 50px +} diff --git a/docs/channel_v1/cloud_channel_service.rst b/docs/channel_v1/cloud_channel_service.rst index 8cc4d6a..917d45e 100644 --- a/docs/channel_v1/cloud_channel_service.rst +++ b/docs/channel_v1/cloud_channel_service.rst @@ -5,7 +5,6 @@ CloudChannelService :members: :inherited-members: - .. automodule:: google.cloud.channel_v1.services.cloud_channel_service.pagers :members: :inherited-members: diff --git a/docs/conf.py b/docs/conf.py index f58a985..9161ad1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,4 +1,17 @@ # -*- coding: utf-8 -*- +# Copyright 2021 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # google-cloud-channel documentation build configuration file # @@ -350,6 +363,7 @@ "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,), "grpc": ("https://grpc.github.io/grpc/python/", None), "proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None), + "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), } diff --git a/docs/multiprocessing.rst b/docs/multiprocessing.rst index 1cb29d4..536d17b 100644 --- a/docs/multiprocessing.rst +++ b/docs/multiprocessing.rst @@ -1,7 +1,7 @@ .. note:: - Because this client uses :mod:`grpcio` library, it is safe to + Because this client uses :mod:`grpc` library, it is safe to share instances across threads. In multiprocessing scenarios, the best practice is to create client instances *after* the invocation of - :func:`os.fork` by :class:`multiprocessing.Pool` or + :func:`os.fork` by :class:`multiprocessing.pool.Pool` or :class:`multiprocessing.Process`. diff --git a/google/cloud/channel/__init__.py b/google/cloud/channel/__init__.py index 8cf0772..8f842d7 100644 --- a/google/cloud/channel/__init__.py +++ b/google/cloud/channel/__init__.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,12 +14,13 @@ # limitations under the License. # -from google.cloud.channel_v1.services.cloud_channel_service.async_client import ( - CloudChannelServiceAsyncClient, -) from google.cloud.channel_v1.services.cloud_channel_service.client import ( CloudChannelServiceClient, ) +from google.cloud.channel_v1.services.cloud_channel_service.async_client import ( + CloudChannelServiceAsyncClient, +) + from google.cloud.channel_v1.types.channel_partner_links import ChannelPartnerLink from google.cloud.channel_v1.types.channel_partner_links import ChannelPartnerLinkState from google.cloud.channel_v1.types.channel_partner_links import ChannelPartnerLinkView @@ -36,30 +36,30 @@ from google.cloud.channel_v1.types.entitlements import Parameter from google.cloud.channel_v1.types.entitlements import ProvisionedService from google.cloud.channel_v1.types.entitlements import RenewalSettings -from google.cloud.channel_v1.types.entitlements import TransferEligibility from google.cloud.channel_v1.types.entitlements import TransferableSku +from google.cloud.channel_v1.types.entitlements import TransferEligibility from google.cloud.channel_v1.types.entitlements import TrialSettings from google.cloud.channel_v1.types.offers import Constraints from google.cloud.channel_v1.types.offers import CustomerConstraints from google.cloud.channel_v1.types.offers import Offer from google.cloud.channel_v1.types.offers import ParameterDefinition -from google.cloud.channel_v1.types.offers import PaymentPlan -from google.cloud.channel_v1.types.offers import PaymentType from google.cloud.channel_v1.types.offers import Period -from google.cloud.channel_v1.types.offers import PeriodType from google.cloud.channel_v1.types.offers import Plan from google.cloud.channel_v1.types.offers import Price from google.cloud.channel_v1.types.offers import PriceByResource from google.cloud.channel_v1.types.offers import PricePhase from google.cloud.channel_v1.types.offers import PriceTier +from google.cloud.channel_v1.types.offers import PaymentPlan +from google.cloud.channel_v1.types.offers import PaymentType +from google.cloud.channel_v1.types.offers import PeriodType from google.cloud.channel_v1.types.offers import PromotionalOrderType from google.cloud.channel_v1.types.offers import ResourceType from google.cloud.channel_v1.types.operations import OperationMetadata from google.cloud.channel_v1.types.products import MarketingInfo from google.cloud.channel_v1.types.products import Media -from google.cloud.channel_v1.types.products import MediaType from google.cloud.channel_v1.types.products import Product from google.cloud.channel_v1.types.products import Sku +from google.cloud.channel_v1.types.products import MediaType from google.cloud.channel_v1.types.service import ActivateEntitlementRequest from google.cloud.channel_v1.types.service import CancelEntitlementRequest from google.cloud.channel_v1.types.service import ChangeOfferRequest @@ -106,10 +106,10 @@ from google.cloud.channel_v1.types.service import RegisterSubscriberResponse from google.cloud.channel_v1.types.service import StartPaidServiceRequest from google.cloud.channel_v1.types.service import SuspendEntitlementRequest +from google.cloud.channel_v1.types.service import TransferableOffer from google.cloud.channel_v1.types.service import TransferEntitlementsRequest from google.cloud.channel_v1.types.service import TransferEntitlementsResponse from google.cloud.channel_v1.types.service import TransferEntitlementsToGoogleRequest -from google.cloud.channel_v1.types.service import TransferableOffer from google.cloud.channel_v1.types.service import UnregisterSubscriberRequest from google.cloud.channel_v1.types.service import UnregisterSubscriberResponse from google.cloud.channel_v1.types.service import UpdateChannelPartnerLinkRequest @@ -119,35 +119,59 @@ from google.cloud.channel_v1.types.subscriber_event import SubscriberEvent __all__ = ( - "ActivateEntitlementRequest", + "CloudChannelServiceClient", + "CloudChannelServiceAsyncClient", + "ChannelPartnerLink", + "ChannelPartnerLinkState", + "ChannelPartnerLinkView", "AdminUser", + "CloudIdentityInfo", + "EduData", + "Value", + "ContactInfo", + "Customer", "AssociationInfo", + "CommitmentSettings", + "Entitlement", + "Parameter", + "ProvisionedService", + "RenewalSettings", + "TransferableSku", + "TransferEligibility", + "TrialSettings", + "Constraints", + "CustomerConstraints", + "Offer", + "ParameterDefinition", + "Period", + "Plan", + "Price", + "PriceByResource", + "PricePhase", + "PriceTier", + "PaymentPlan", + "PaymentType", + "PeriodType", + "PromotionalOrderType", + "ResourceType", + "OperationMetadata", + "MarketingInfo", + "Media", + "Product", + "Sku", + "MediaType", + "ActivateEntitlementRequest", "CancelEntitlementRequest", "ChangeOfferRequest", "ChangeParametersRequest", "ChangeRenewalSettingsRequest", - "ChannelPartnerLink", - "ChannelPartnerLinkState", - "ChannelPartnerLinkView", "CheckCloudIdentityAccountsExistRequest", "CheckCloudIdentityAccountsExistResponse", - "CloudChannelServiceAsyncClient", - "CloudChannelServiceClient", "CloudIdentityCustomerAccount", - "CloudIdentityInfo", - "CommitmentSettings", - "Constraints", - "ContactInfo", "CreateChannelPartnerLinkRequest", "CreateCustomerRequest", "CreateEntitlementRequest", - "Customer", - "CustomerConstraints", - "CustomerEvent", "DeleteCustomerRequest", - "EduData", - "Entitlement", - "EntitlementEvent", "GetChannelPartnerLinkRequest", "GetCustomerRequest", "GetEntitlementRequest", @@ -173,46 +197,22 @@ "ListTransferableOffersResponse", "ListTransferableSkusRequest", "ListTransferableSkusResponse", - "MarketingInfo", - "Media", - "MediaType", - "Offer", - "OperationMetadata", - "Parameter", - "ParameterDefinition", - "PaymentPlan", - "PaymentType", - "Period", - "PeriodType", - "Plan", - "Price", - "PriceByResource", - "PricePhase", - "PriceTier", - "Product", - "PromotionalOrderType", "ProvisionCloudIdentityRequest", - "ProvisionedService", "PurchasableOffer", "PurchasableSku", "RegisterSubscriberRequest", "RegisterSubscriberResponse", - "RenewalSettings", - "ResourceType", - "Sku", "StartPaidServiceRequest", - "SubscriberEvent", "SuspendEntitlementRequest", - "TransferEligibility", + "TransferableOffer", "TransferEntitlementsRequest", "TransferEntitlementsResponse", "TransferEntitlementsToGoogleRequest", - "TransferableOffer", - "TransferableSku", - "TrialSettings", "UnregisterSubscriberRequest", "UnregisterSubscriberResponse", "UpdateChannelPartnerLinkRequest", "UpdateCustomerRequest", - "Value", + "CustomerEvent", + "EntitlementEvent", + "SubscriberEvent", ) diff --git a/google/cloud/channel_v1/__init__.py b/google/cloud/channel_v1/__init__.py index 19d3127..6d7d79c 100644 --- a/google/cloud/channel_v1/__init__.py +++ b/google/cloud/channel_v1/__init__.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -16,6 +15,8 @@ # from .services.cloud_channel_service import CloudChannelServiceClient +from .services.cloud_channel_service import CloudChannelServiceAsyncClient + from .types.channel_partner_links import ChannelPartnerLink from .types.channel_partner_links import ChannelPartnerLinkState from .types.channel_partner_links import ChannelPartnerLinkView @@ -31,30 +32,30 @@ from .types.entitlements import Parameter from .types.entitlements import ProvisionedService from .types.entitlements import RenewalSettings -from .types.entitlements import TransferEligibility from .types.entitlements import TransferableSku +from .types.entitlements import TransferEligibility from .types.entitlements import TrialSettings from .types.offers import Constraints from .types.offers import CustomerConstraints from .types.offers import Offer from .types.offers import ParameterDefinition -from .types.offers import PaymentPlan -from .types.offers import PaymentType from .types.offers import Period -from .types.offers import PeriodType from .types.offers import Plan from .types.offers import Price from .types.offers import PriceByResource from .types.offers import PricePhase from .types.offers import PriceTier +from .types.offers import PaymentPlan +from .types.offers import PaymentType +from .types.offers import PeriodType from .types.offers import PromotionalOrderType from .types.offers import ResourceType from .types.operations import OperationMetadata from .types.products import MarketingInfo from .types.products import Media -from .types.products import MediaType from .types.products import Product from .types.products import Sku +from .types.products import MediaType from .types.service import ActivateEntitlementRequest from .types.service import CancelEntitlementRequest from .types.service import ChangeOfferRequest @@ -99,10 +100,10 @@ from .types.service import RegisterSubscriberResponse from .types.service import StartPaidServiceRequest from .types.service import SuspendEntitlementRequest +from .types.service import TransferableOffer from .types.service import TransferEntitlementsRequest from .types.service import TransferEntitlementsResponse from .types.service import TransferEntitlementsToGoogleRequest -from .types.service import TransferableOffer from .types.service import UnregisterSubscriberRequest from .types.service import UnregisterSubscriberResponse from .types.service import UpdateChannelPartnerLinkRequest @@ -111,8 +112,8 @@ from .types.subscriber_event import EntitlementEvent from .types.subscriber_event import SubscriberEvent - __all__ = ( + "CloudChannelServiceAsyncClient", "ActivateEntitlementRequest", "AdminUser", "AssociationInfo", @@ -125,6 +126,7 @@ "ChannelPartnerLinkView", "CheckCloudIdentityAccountsExistRequest", "CheckCloudIdentityAccountsExistResponse", + "CloudChannelServiceClient", "CloudIdentityCustomerAccount", "CloudIdentityInfo", "CommitmentSettings", @@ -207,5 +209,4 @@ "UpdateChannelPartnerLinkRequest", "UpdateCustomerRequest", "Value", - "CloudChannelServiceClient", ) diff --git a/google/cloud/channel_v1/gapic_metadata.json b/google/cloud/channel_v1/gapic_metadata.json new file mode 100644 index 0000000..0894836 --- /dev/null +++ b/google/cloud/channel_v1/gapic_metadata.json @@ -0,0 +1,353 @@ + { + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "python", + "libraryPackage": "google.cloud.channel_v1", + "protoPackage": "google.cloud.channel.v1", + "schema": "1.0", + "services": { + "CloudChannelService": { + "clients": { + "grpc": { + "libraryClient": "CloudChannelServiceClient", + "rpcs": { + "ActivateEntitlement": { + "methods": [ + "activate_entitlement" + ] + }, + "CancelEntitlement": { + "methods": [ + "cancel_entitlement" + ] + }, + "ChangeOffer": { + "methods": [ + "change_offer" + ] + }, + "ChangeParameters": { + "methods": [ + "change_parameters" + ] + }, + "ChangeRenewalSettings": { + "methods": [ + "change_renewal_settings" + ] + }, + "CheckCloudIdentityAccountsExist": { + "methods": [ + "check_cloud_identity_accounts_exist" + ] + }, + "CreateChannelPartnerLink": { + "methods": [ + "create_channel_partner_link" + ] + }, + "CreateCustomer": { + "methods": [ + "create_customer" + ] + }, + "CreateEntitlement": { + "methods": [ + "create_entitlement" + ] + }, + "DeleteCustomer": { + "methods": [ + "delete_customer" + ] + }, + "GetChannelPartnerLink": { + "methods": [ + "get_channel_partner_link" + ] + }, + "GetCustomer": { + "methods": [ + "get_customer" + ] + }, + "GetEntitlement": { + "methods": [ + "get_entitlement" + ] + }, + "ListChannelPartnerLinks": { + "methods": [ + "list_channel_partner_links" + ] + }, + "ListCustomers": { + "methods": [ + "list_customers" + ] + }, + "ListEntitlements": { + "methods": [ + "list_entitlements" + ] + }, + "ListOffers": { + "methods": [ + "list_offers" + ] + }, + "ListProducts": { + "methods": [ + "list_products" + ] + }, + "ListPurchasableOffers": { + "methods": [ + "list_purchasable_offers" + ] + }, + "ListPurchasableSkus": { + "methods": [ + "list_purchasable_skus" + ] + }, + "ListSkus": { + "methods": [ + "list_skus" + ] + }, + "ListSubscribers": { + "methods": [ + "list_subscribers" + ] + }, + "ListTransferableOffers": { + "methods": [ + "list_transferable_offers" + ] + }, + "ListTransferableSkus": { + "methods": [ + "list_transferable_skus" + ] + }, + "ProvisionCloudIdentity": { + "methods": [ + "provision_cloud_identity" + ] + }, + "RegisterSubscriber": { + "methods": [ + "register_subscriber" + ] + }, + "StartPaidService": { + "methods": [ + "start_paid_service" + ] + }, + "SuspendEntitlement": { + "methods": [ + "suspend_entitlement" + ] + }, + "TransferEntitlements": { + "methods": [ + "transfer_entitlements" + ] + }, + "TransferEntitlementsToGoogle": { + "methods": [ + "transfer_entitlements_to_google" + ] + }, + "UnregisterSubscriber": { + "methods": [ + "unregister_subscriber" + ] + }, + "UpdateChannelPartnerLink": { + "methods": [ + "update_channel_partner_link" + ] + }, + "UpdateCustomer": { + "methods": [ + "update_customer" + ] + } + } + }, + "grpc-async": { + "libraryClient": "CloudChannelServiceAsyncClient", + "rpcs": { + "ActivateEntitlement": { + "methods": [ + "activate_entitlement" + ] + }, + "CancelEntitlement": { + "methods": [ + "cancel_entitlement" + ] + }, + "ChangeOffer": { + "methods": [ + "change_offer" + ] + }, + "ChangeParameters": { + "methods": [ + "change_parameters" + ] + }, + "ChangeRenewalSettings": { + "methods": [ + "change_renewal_settings" + ] + }, + "CheckCloudIdentityAccountsExist": { + "methods": [ + "check_cloud_identity_accounts_exist" + ] + }, + "CreateChannelPartnerLink": { + "methods": [ + "create_channel_partner_link" + ] + }, + "CreateCustomer": { + "methods": [ + "create_customer" + ] + }, + "CreateEntitlement": { + "methods": [ + "create_entitlement" + ] + }, + "DeleteCustomer": { + "methods": [ + "delete_customer" + ] + }, + "GetChannelPartnerLink": { + "methods": [ + "get_channel_partner_link" + ] + }, + "GetCustomer": { + "methods": [ + "get_customer" + ] + }, + "GetEntitlement": { + "methods": [ + "get_entitlement" + ] + }, + "ListChannelPartnerLinks": { + "methods": [ + "list_channel_partner_links" + ] + }, + "ListCustomers": { + "methods": [ + "list_customers" + ] + }, + "ListEntitlements": { + "methods": [ + "list_entitlements" + ] + }, + "ListOffers": { + "methods": [ + "list_offers" + ] + }, + "ListProducts": { + "methods": [ + "list_products" + ] + }, + "ListPurchasableOffers": { + "methods": [ + "list_purchasable_offers" + ] + }, + "ListPurchasableSkus": { + "methods": [ + "list_purchasable_skus" + ] + }, + "ListSkus": { + "methods": [ + "list_skus" + ] + }, + "ListSubscribers": { + "methods": [ + "list_subscribers" + ] + }, + "ListTransferableOffers": { + "methods": [ + "list_transferable_offers" + ] + }, + "ListTransferableSkus": { + "methods": [ + "list_transferable_skus" + ] + }, + "ProvisionCloudIdentity": { + "methods": [ + "provision_cloud_identity" + ] + }, + "RegisterSubscriber": { + "methods": [ + "register_subscriber" + ] + }, + "StartPaidService": { + "methods": [ + "start_paid_service" + ] + }, + "SuspendEntitlement": { + "methods": [ + "suspend_entitlement" + ] + }, + "TransferEntitlements": { + "methods": [ + "transfer_entitlements" + ] + }, + "TransferEntitlementsToGoogle": { + "methods": [ + "transfer_entitlements_to_google" + ] + }, + "UnregisterSubscriber": { + "methods": [ + "unregister_subscriber" + ] + }, + "UpdateChannelPartnerLink": { + "methods": [ + "update_channel_partner_link" + ] + }, + "UpdateCustomer": { + "methods": [ + "update_customer" + ] + } + } + } + } + } + } +} diff --git a/google/cloud/channel_v1/services/__init__.py b/google/cloud/channel_v1/services/__init__.py index 42ffdf2..4de6597 100644 --- a/google/cloud/channel_v1/services/__init__.py +++ b/google/cloud/channel_v1/services/__init__.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/google/cloud/channel_v1/services/cloud_channel_service/__init__.py b/google/cloud/channel_v1/services/cloud_channel_service/__init__.py index c9e6a79..9a6db7f 100644 --- a/google/cloud/channel_v1/services/cloud_channel_service/__init__.py +++ b/google/cloud/channel_v1/services/cloud_channel_service/__init__.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # - from .client import CloudChannelServiceClient from .async_client import CloudChannelServiceAsyncClient diff --git a/google/cloud/channel_v1/services/cloud_channel_service/async_client.py b/google/cloud/channel_v1/services/cloud_channel_service/async_client.py index dc16a3e..db00925 100644 --- a/google/cloud/channel_v1/services/cloud_channel_service/async_client.py +++ b/google/cloud/channel_v1/services/cloud_channel_service/async_client.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # - from collections import OrderedDict import functools import re @@ -22,10 +20,10 @@ import pkg_resources import google.api_core.client_options as ClientOptions # type: ignore -from google.api_core import exceptions # type: ignore +from google.api_core import exceptions as core_exceptions # type: ignore from google.api_core import gapic_v1 # type: ignore from google.api_core import retry as retries # type: ignore -from google.auth import credentials # type: ignore +from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore from google.api_core import operation # type: ignore @@ -39,45 +37,38 @@ from google.cloud.channel_v1.types import operations from google.cloud.channel_v1.types import products from google.cloud.channel_v1.types import service -from google.protobuf import empty_pb2 as empty # type: ignore -from google.protobuf import timestamp_pb2 as timestamp # type: ignore -from google.type import postal_address_pb2 as postal_address # type: ignore - +from google.protobuf import empty_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore +from google.type import postal_address_pb2 # type: ignore from .transports.base import CloudChannelServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import CloudChannelServiceGrpcAsyncIOTransport from .client import CloudChannelServiceClient class CloudChannelServiceAsyncClient: - """CloudChannelService enables Google cloud resellers and distributors - to manage their customers, channel partners, entitlements and - reports. + """CloudChannelService lets Google cloud resellers and distributors + manage their customers, channel partners, entitlements, and reports. Using this service: - 1. Resellers or distributors can manage a customer entity. + 1. Resellers and distributors can manage a customer entity. 2. Distributors can register an authorized reseller in their channel - and then enable delegated admin access for the reseller. - 3. Resellers or distributors can manage entitlements for their - customers. + and provide them with delegated admin access. + 3. Resellers and distributors can manage customer entitlements. - The service primarily exposes the following resources: + CloudChannelService exposes the following resources: - - [Customer][google.cloud.channel.v1.Customer]s: A Customer - represents an entity managed by a reseller or distributor. A - customer typically represents an enterprise. In an n-tier resale - channel hierarchy, customers are generally represented as leaf - nodes. Customers primarily have an Entitlement sub-resource - discussed below. + - [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 - Entitlement represents an entity which provides a customer means - to start using 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: - A ChannelPartnerLink is an entity that identifies links between - distributors and their indirect resellers in a channel. + An entity that identifies links between distributors and their + indirect resellers in a channel. """ _client: CloudChannelServiceClient @@ -97,31 +88,26 @@ class CloudChannelServiceAsyncClient: parse_product_path = staticmethod(CloudChannelServiceClient.parse_product_path) sku_path = staticmethod(CloudChannelServiceClient.sku_path) parse_sku_path = staticmethod(CloudChannelServiceClient.parse_sku_path) - common_billing_account_path = staticmethod( CloudChannelServiceClient.common_billing_account_path ) parse_common_billing_account_path = staticmethod( CloudChannelServiceClient.parse_common_billing_account_path ) - common_folder_path = staticmethod(CloudChannelServiceClient.common_folder_path) parse_common_folder_path = staticmethod( CloudChannelServiceClient.parse_common_folder_path ) - common_organization_path = staticmethod( CloudChannelServiceClient.common_organization_path ) parse_common_organization_path = staticmethod( CloudChannelServiceClient.parse_common_organization_path ) - common_project_path = staticmethod(CloudChannelServiceClient.common_project_path) parse_common_project_path = staticmethod( CloudChannelServiceClient.parse_common_project_path ) - common_location_path = staticmethod(CloudChannelServiceClient.common_location_path) parse_common_location_path = staticmethod( CloudChannelServiceClient.parse_common_location_path @@ -129,7 +115,8 @@ class CloudChannelServiceAsyncClient: @classmethod def from_service_account_info(cls, info: dict, *args, **kwargs): - """Creates an instance of this client using the provided credentials info. + """Creates an instance of this client using the provided credentials + info. Args: info (dict): The service account private key info. @@ -144,7 +131,7 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): """Creates an instance of this client using the provided credentials - file. + file. Args: filename (str): The path to the service account private key json @@ -161,7 +148,7 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): @property def transport(self) -> CloudChannelServiceTransport: - """Return the transport used by the client instance. + """Returns the transport used by the client instance. Returns: CloudChannelServiceTransport: The transport used by the client instance. @@ -176,12 +163,12 @@ def transport(self) -> CloudChannelServiceTransport: def __init__( self, *, - credentials: credentials.Credentials = None, + credentials: ga_credentials.Credentials = None, transport: Union[str, CloudChannelServiceTransport] = "grpc_asyncio", client_options: ClientOptions = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: - """Instantiate the cloud channel service client. + """Instantiates the cloud channel service client. Args: credentials (Optional[google.auth.credentials.Credentials]): The @@ -213,7 +200,6 @@ def __init__( google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport creation failed for any reason. """ - self._client = CloudChannelServiceClient( credentials=credentials, transport=transport, @@ -229,24 +215,23 @@ async def list_customers( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListCustomersAsyncPager: - r"""List downstream [Customer][google.cloud.channel.v1.Customer]s. + r"""List [Customer][google.cloud.channel.v1.Customer]s. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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 pertaining to the - reseller or empty list if there are none. + Return value: List of + [Customer][google.cloud.channel.v1.Customer]s, or an empty list + if there are no customers. Args: request (:class:`google.cloud.channel_v1.types.ListCustomersRequest`): The request object. Request message for [CloudChannelService.ListCustomers][google.cloud.channel.v1.CloudChannelService.ListCustomers] - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -263,7 +248,6 @@ async def list_customers( """ # Create or coerce a protobuf request object. - request = service.ListCustomersRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -304,17 +288,17 @@ async def get_customer( r"""Returns a requested [Customer][google.cloud.channel.v1.Customer] resource. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the customer resource doesn't exist. Usually - the result of an invalid name parameter. + - 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: [Customer][google.cloud.channel.v1.Customer] - resource if found, error otherwise. + Return value: The [Customer][google.cloud.channel.v1.Customer] + resource. Args: request (:class:`google.cloud.channel_v1.types.GetCustomerRequest`): @@ -322,13 +306,12 @@ async def get_customer( [CloudChannelService.GetCustomer][google.cloud.channel.v1.CloudChannelService.GetCustomer]. name (:class:`str`): Required. The resource name of the customer to retrieve. - The name takes the format: + Name uses the format: accounts/{account_id}/customers/{customer_id} This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -355,7 +338,6 @@ async def get_customer( # If we have keyword arguments corresponding to fields on the # request, apply these. - if name is not None: request.name = name @@ -387,24 +369,24 @@ async def check_cloud_identity_accounts_exist( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> service.CheckCloudIdentityAccountsExistResponse: - r"""Confirms the existence of Cloud Identity accounts, based on the - domain and whether the Cloud Identity accounts are owned by the + r"""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: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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: List of + Return value: A list of [CloudIdentityCustomerAccount][google.cloud.channel.v1.CloudIdentityCustomerAccount] - resources for the domain. List may be empty. + resources for the domain (may be empty) - Note: in the v1alpha1 version of the API, a NOT_FOUND error is - returned if no + 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. @@ -412,7 +394,6 @@ async def check_cloud_identity_accounts_exist( request (:class:`google.cloud.channel_v1.types.CheckCloudIdentityAccountsExistRequest`): The request object. Request message for [CloudChannelService.CheckCloudIdentityAccountsExist][google.cloud.channel.v1.CloudChannelService.CheckCloudIdentityAccountsExist]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -426,7 +407,6 @@ async def check_cloud_identity_accounts_exist( """ # Create or coerce a protobuf request object. - request = service.CheckCloudIdentityAccountsExistRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -460,25 +440,22 @@ async def create_customer( r"""Creates a new [Customer][google.cloud.channel.v1.Customer] resource under the reseller or distributor account. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: It can happen in following scenarios - + - PERMISSION_DENIED: The reseller account making the request is + different from the reseller account in the API request. + - INVALID_ARGUMENT: - - Missing or invalid required parameters in the request. - - Domain field value doesn't match the domain specified in - primary email. + - Required request parameters are missing or invalid. + - Domain field value doesn't match the primary email domain. - Return Value: If successful, the newly created - [Customer][google.cloud.channel.v1.Customer] resource, otherwise - returns an error. + Return value: The newly created + [Customer][google.cloud.channel.v1.Customer] resource. Args: request (:class:`google.cloud.channel_v1.types.CreateCustomerRequest`): The request object. Request message for [CloudChannelService.CreateCustomer][google.cloud.channel.v1.CloudChannelService.CreateCustomer] - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -492,7 +469,6 @@ async def create_customer( """ # Create or coerce a protobuf request object. - request = service.CreateCustomerRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -524,26 +500,24 @@ async def update_customer( metadata: Sequence[Tuple[str, str]] = (), ) -> customers.Customer: r"""Updates an existing [Customer][google.cloud.channel.v1.Customer] - resource belonging to the reseller or distributor. + resource for the reseller or distributor. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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 specified in the request. + resource found for the name in the request. - Return Value: If successful, the updated - [Customer][google.cloud.channel.v1.Customer] resource, otherwise - returns an error. + Return value: The updated + [Customer][google.cloud.channel.v1.Customer] resource. Args: request (:class:`google.cloud.channel_v1.types.UpdateCustomerRequest`): The request object. Request message for [CloudChannelService.UpdateCustomer][google.cloud.channel.v1.CloudChannelService.UpdateCustomer]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -557,7 +531,6 @@ async def update_customer( """ # Create or coerce a protobuf request object. - request = service.UpdateCustomerRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -594,16 +567,15 @@ async def delete_customer( r"""Deletes the given [Customer][google.cloud.channel.v1.Customer] permanently and irreversibly. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the account making the request does not + - PERMISSION_DENIED: The account making the request does not own this customer. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - FAILED_PRECONDITION: If the customer has existing - entitlements. + - 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 specified in the request. + resource found for the name in the request. Args: request (:class:`google.cloud.channel_v1.types.DeleteCustomerRequest`): @@ -616,7 +588,6 @@ async def delete_customer( This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -637,7 +608,6 @@ async def delete_customer( # If we have keyword arguments corresponding to fields on the # request, apply these. - if name is not None: request.name = name @@ -669,36 +639,33 @@ async def provision_cloud_identity( metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: r"""Creates a Cloud Identity for the given customer using the - customer's information or the information provided here, if - present. + customer's information, or the information provided here. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the customer is not found for the reseller. - - ALREADY_EXISTS: If the customer's primary email already - exists. In this case, retry after changing the customer's - primary contact email. + - 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 in this case. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. Contact Cloud Channel support in this case. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 + contains an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. Args: request (:class:`google.cloud.channel_v1.types.ProvisionCloudIdentityRequest`): The request object. Request message for [CloudChannelService.ProvisionCloudIdentity][google.cloud.channel.v1.CloudChannelService.ProvisionCloudIdentity] - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -715,7 +682,6 @@ async def provision_cloud_identity( """ # Create or coerce a protobuf request object. - request = service.ProvisionCloudIdentityRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -754,25 +720,23 @@ async def list_entitlements( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListEntitlementsAsyncPager: - r"""List [Entitlement][google.cloud.channel.v1.Entitlement]s + r"""Lists [Entitlement][google.cloud.channel.v1.Entitlement]s belonging to a customer. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. - Return Value: List of - [Entitlement][google.cloud.channel.v1.Entitlement]s belonging to - the customer, or empty list if there are none. + Return value: A list of the customer's + [Entitlement][google.cloud.channel.v1.Entitlement]s. Args: request (:class:`google.cloud.channel_v1.types.ListEntitlementsRequest`): The request object. Request message for [CloudChannelService.ListEntitlements][google.cloud.channel.v1.CloudChannelService.ListEntitlements] - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -789,7 +753,6 @@ async def list_entitlements( """ # Create or coerce a protobuf request object. - request = service.ListEntitlementsRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -827,35 +790,33 @@ async def list_transferable_skus( metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTransferableSkusAsyncPager: r"""List [TransferableSku][google.cloud.channel.v1.TransferableSku]s - of a customer based on Cloud Identity ID or Customer Name in the - request. + of a customer based on the Cloud Identity ID or Customer Name in + the request. - This method is used when a reseller lists the entitlements - information of a customer that is not owned. The reseller should - provide the customer's Cloud Identity ID or Customer Name. + 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: + Possible error codes: - - PERMISSION_DENIED: Appears because of one of the following - + - PERMISSION_DENIED: - - The customer doesn't belong to the reseller and no auth - token. + - 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 and the queries - reseller account are different. + - The reseller account making the request is different from + the reseller account in the query. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. - Return Value: List of - [TransferableSku][google.cloud.channel.v1.TransferableSku] for - the given customer. + Return value: A list of the customer's + [TransferableSku][google.cloud.channel.v1.TransferableSku]. Args: request (:class:`google.cloud.channel_v1.types.ListTransferableSkusRequest`): The request object. Request message for [CloudChannelService.ListTransferableSkus][google.cloud.channel.v1.CloudChannelService.ListTransferableSkus] - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -872,7 +833,6 @@ async def list_transferable_skus( """ # Create or coerce a protobuf request object. - request = service.ListTransferableSkusRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -914,23 +874,24 @@ async def list_transferable_offers( of a customer based on Cloud Identity ID or Customer Name in the request. - This method is used when a reseller gets the entitlement - information of a customer that is not owned. The reseller should - provide the customer's Cloud Identity ID or Customer Name. + 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: + Possible error codes: - - PERMISSION_DENIED: Appears because of one of the following: + - PERMISSION_DENIED: - - If the customer doesn't belong to the reseller and no auth - token or invalid auth token is supplied. - - If the reseller account making the request and the - reseller account being queried for are different. + - 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: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. - Return Value: List of + Return value: List of [TransferableOffer][google.cloud.channel.v1.TransferableOffer] for the given customer and SKU. @@ -938,7 +899,6 @@ async def list_transferable_offers( request (:class:`google.cloud.channel_v1.types.ListTransferableOffersRequest`): The request object. Request message for [CloudChannelService.ListTransferableOffers][google.cloud.channel.v1.CloudChannelService.ListTransferableOffers] - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -955,7 +915,6 @@ async def list_transferable_offers( """ # Create or coerce a protobuf request object. - request = service.ListTransferableOffersRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -995,23 +954,21 @@ async def get_entitlement( r"""Returns a requested [Entitlement][google.cloud.channel.v1.Entitlement] resource. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the entitlement is not found for the customer. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. + - NOT_FOUND: The customer entitlement was not found. - Return Value: If found, the requested - [Entitlement][google.cloud.channel.v1.Entitlement] resource, - otherwise returns an error. + Return value: The requested + [Entitlement][google.cloud.channel.v1.Entitlement] resource. Args: request (:class:`google.cloud.channel_v1.types.GetEntitlementRequest`): The request object. Request message for [CloudChannelService.GetEntitlement][google.cloud.channel.v1.CloudChannelService.GetEntitlement]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1025,7 +982,6 @@ async def get_entitlement( """ # Create or coerce a protobuf request object. - request = service.GetEntitlementRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -1058,51 +1014,44 @@ async def create_entitlement( ) -> operation_async.AsyncOperation: r"""Creates an entitlement for a customer. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: It can happen in below scenarios - - - - Missing or invalid required parameters in the request. - - Cannot purchase an entitlement if there is already an - entitlement for customer, for a SKU from the same product - family. - - INVALID_VALUE: Offer passed in isn't valid. Make sure - OfferId is valid. If it is valid, then contact Google - Channel support for further troubleshooting. - - - NOT_FOUND: If the customer or offer resource is not found for - the reseller. - - ALREADY_EXISTS: This failure can happen in the following - cases: - - - If the SKU has been already purchased for the customer. - - If the customer's primary email already exists. In this - case retry after changing the customer's primary contact - email. - - - CONDITION_NOT_MET or FAILED_PRECONDITION: This failure can - happen in the following cases: - - - Purchasing a SKU that requires domain verification and the - domain has not been verified. - - Purchasing an Add-On SKU like Vault or Drive without - purchasing the pre-requisite SKU, such as Google Workspace - Business Starter. - - Applicable only for developer accounts: reseller and - resold domain. Must meet the following domain naming - requirements: + - 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. - - Resold domain names must include the reseller domain. + - Domain names must include the reseller domain. - INTERNAL: Any non-user error related to a technical issue in - the backend. Contact Cloud Channel Support in this case. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. Contact Cloud Channel Support in this case. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1113,7 +1062,6 @@ async def create_entitlement( request (:class:`google.cloud.channel_v1.types.CreateEntitlementRequest`): The request object. Request message for [CloudChannelService.CreateEntitlement][google.cloud.channel.v1.CloudChannelService.CreateEntitlement] - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1131,7 +1079,6 @@ async def create_entitlement( """ # Create or coerce a protobuf request object. - request = service.CreateEntitlementRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -1170,28 +1117,26 @@ async def change_parameters( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: - r"""Change parameters of the entitlement + r"""Change parameters of the entitlement. - An entitlement parameters update is a long-running operation and - results in updates to the entitlement as a result of - fulfillment. + An entitlement update is a long-running operation and it updates + the entitlement as a result of fulfillment. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. For example, if the number of seats being - changed to is greater than the allowed number of max seats - for the resource. Or decreasing seats for a commitment based - plan. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1202,7 +1147,6 @@ async def change_parameters( request (:class:`google.cloud.channel_v1.types.ChangeParametersRequest`): The request object. Request message for [CloudChannelService.ChangeParametersRequest][]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1220,7 +1164,6 @@ async def change_parameters( """ # Create or coerce a protobuf request object. - request = service.ChangeParametersRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -1262,25 +1205,25 @@ async def change_renewal_settings( r"""Updates the renewal settings for an existing customer entitlement. - An entitlement update is a long-running operation and results in - updates to the entitlement as a result of fulfillment. + An entitlement update is a long-running operation and it updates + the entitlement as a result of fulfillment. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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 renewal 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. In this case, contact Cloud Channel support. - - UNKNOWN: Any non user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + - 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: Long Running Operation ID. + 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 @@ -1291,7 +1234,6 @@ async def change_renewal_settings( request (:class:`google.cloud.channel_v1.types.ChangeRenewalSettingsRequest`): The request object. Request message for [CloudChannelService.ChangeRenewalSettings][google.cloud.channel.v1.CloudChannelService.ChangeRenewalSettings]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1309,7 +1251,6 @@ async def change_renewal_settings( """ # Create or coerce a protobuf request object. - request = service.ChangeRenewalSettingsRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -1350,22 +1291,22 @@ async def change_offer( ) -> operation_async.AsyncOperation: r"""Updates the Offer for an existing customer entitlement. - An entitlement update is a long-running operation and results in - updates to the entitlement as a result of fulfillment. + An entitlement update is a long-running operation and it updates + the entitlement as a result of fulfillment. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1376,7 +1317,6 @@ async def change_offer( request (:class:`google.cloud.channel_v1.types.ChangeOfferRequest`): The request object. Request message for [CloudChannelService.ChangeOffer][google.cloud.channel.v1.CloudChannelService.ChangeOffer]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1394,7 +1334,6 @@ async def change_offer( """ # Create or coerce a protobuf request object. - request = service.ChangeOfferRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -1436,24 +1375,24 @@ async def start_paid_service( r"""Starts paid service for a trial entitlement. Starts paid service for a trial entitlement immediately. This - method is only applicable if a plan has already been set up for - a trial entitlement but has some trial days remaining. + method is only applicable if a plan is set up for a trial + entitlement but has some trial days remaining. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1464,7 +1403,6 @@ async def start_paid_service( request (:class:`google.cloud.channel_v1.types.StartPaidServiceRequest`): The request object. Request message for [CloudChannelService.StartPaidService][google.cloud.channel.v1.CloudChannelService.StartPaidService]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1482,7 +1420,6 @@ async def start_paid_service( """ # Create or coerce a protobuf request object. - request = service.StartPaidServiceRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -1521,23 +1458,24 @@ async def suspend_entitlement( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: - r"""Suspends a previously fulfilled entitlement. An entitlement - suspension is a long-running operation. + r"""Suspends a previously fulfilled entitlement. - Possible Error Codes: + An entitlement suspension is a long-running operation. - - PERMISSION_DENIED: If the customer doesn't belong to the + Possible error codes: + + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1548,7 +1486,6 @@ async def suspend_entitlement( request (:class:`google.cloud.channel_v1.types.SuspendEntitlementRequest`): The request object. Request message for [CloudChannelService.SuspendEntitlement][google.cloud.channel.v1.CloudChannelService.SuspendEntitlement]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1566,7 +1503,6 @@ async def suspend_entitlement( """ # Create or coerce a protobuf request object. - request = service.SuspendEntitlementRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -1605,29 +1541,28 @@ async def cancel_entitlement( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: - r"""Cancels a previously fulfilled entitlement. An entitlement - cancellation is a long-running operation. - - Possible Error Codes: - - - PERMISSION_DENIED: If the customer doesn't belong to the - reseller or if the reseller account making the request and - reseller account being queried for are different. - - FAILED_PRECONDITION: If there are any Google Cloud projects - linked to the Google Cloud entitlement's Cloud Billing - subaccount. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + r"""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 + Workspace add-ons, or entitlements for Google Cloud's development platform. - INTERNAL: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1639,7 +1574,6 @@ async def cancel_entitlement( request (:class:`google.cloud.channel_v1.types.CancelEntitlementRequest`): The request object. Request message for [CloudChannelService.CancelEntitlement][google.cloud.channel.v1.CloudChannelService.CancelEntitlement]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1666,7 +1600,6 @@ async def cancel_entitlement( """ # Create or coerce a protobuf request object. - request = service.CancelEntitlementRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -1690,7 +1623,7 @@ async def cancel_entitlement( response = operation_async.from_gapic( response, self._client._transport.operations_client, - empty.Empty, + empty_pb2.Empty, metadata_type=operations.OperationMetadata, ) @@ -1705,32 +1638,31 @@ async def activate_entitlement( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: - r"""Activates a previously suspended entitlement. The entitlement - must be in a suspended state for it to be activated. - Entitlements suspended for pending ToS acceptance can't be - activated using this method. An entitlement activation is a - long-running operation and can result in updates to the state of - the customer entitlement. - - Possible Error Codes: - - - PERMISSION_DENIED: If the customer doesn't belong to the - reseller or if the reseller account making the request and - reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + r"""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't activate an - entitlement that is pending TOS acceptance. Only reseller - initiated suspensions can be activated. - - NOT_SUSPENDED: Can't activate entitlements that are already - in ACTIVE state. Can only activate suspended entitlements. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1741,7 +1673,6 @@ async def activate_entitlement( request (:class:`google.cloud.channel_v1.types.ActivateEntitlementRequest`): The request object. Request message for [CloudChannelService.ActivateEntitlement][google.cloud.channel.v1.CloudChannelService.ActivateEntitlement]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1759,7 +1690,6 @@ async def activate_entitlement( """ # Create or coerce a protobuf request object. - request = service.ActivateEntitlementRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -1800,40 +1730,35 @@ async def transfer_entitlements( ) -> operation_async.AsyncOperation: r"""Transfers customer entitlements to new reseller. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the customer or offer resource is not found for - the reseller. - - ALREADY_EXISTS: If the SKU has been already transferred for - the customer. - - CONDITION_NOT_MET or FAILED_PRECONDITION: This failure can - happen in the following cases: - - - Transferring a SKU that requires domain verification and - the domain has not been verified. - - Transferring an Add-On SKU like Vault or Drive without - transferring the pre-requisite SKU, such as G Suite Basic. - - Applicable only for developer accounts: reseller and - resold domain must follow the domain naming convention as - follows: + - 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. - - Resold domain names must include the reseller domain. + - Domain names must include the reseller domain. - - All transferring entitlements must be specified. + - Specify all transferring entitlements. - INTERNAL: Any non-user error related to a technical issue in - the backend. Please contact Cloud Channel Support in this - case. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. Please contact Cloud Channel Support in this - case. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1844,7 +1769,6 @@ async def transfer_entitlements( request (:class:`google.cloud.channel_v1.types.TransferEntitlementsRequest`): The request object. Request message for [CloudChannelService.TransferEntitlements][google.cloud.channel.v1.CloudChannelService.TransferEntitlements]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1856,12 +1780,11 @@ async def transfer_entitlements( An object representing a long-running operation. The result type for the operation will be :class:`google.cloud.channel_v1.types.TransferEntitlementsResponse` Response message for [CloudChannelService.TransferEntitlements][google.cloud.channel.v1.CloudChannelService.TransferEntitlements]. - This will be put into the response field of + This is put in the response field of google.longrunning.Operation. """ # Create or coerce a protobuf request object. - request = service.TransferEntitlementsRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -1900,40 +1823,36 @@ async def transfer_entitlements_to_google( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> operation_async.AsyncOperation: - r"""Transfers customer entitlements from current reseller to Google. + r"""Transfers customer entitlements from their current reseller to + Google. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the customer or offer resource is not found for - the reseller. - - ALREADY_EXISTS: If the SKU has been already transferred for - the customer. - - CONDITION_NOT_MET or FAILED_PRECONDITION: This failure can - happen in the following cases: - - - Transferring a SKU that requires domain verification and - the domain has not been verified. - - Transferring an Add-On SKU like Vault or Drive without - purchasing the pre-requisite SKU, such as G Suite Basic. - - Applicable only for developer accounts: reseller and - resold domain must follow the domain naming convention as - follows: + - 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. - - Resold domain names must include the reseller domain. + - Domain names must include the reseller domain. - INTERNAL: Any non-user error related to a technical issue in - the backend. Please contact Cloud Channel Support in this - case. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. Please contact Cloud Channel Support in this - case. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1945,7 +1864,6 @@ async def transfer_entitlements_to_google( request (:class:`google.cloud.channel_v1.types.TransferEntitlementsToGoogleRequest`): The request object. Request message for [CloudChannelService.TransferEntitlementsToGoogle][google.cloud.channel.v1.CloudChannelService.TransferEntitlementsToGoogle]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1972,7 +1890,6 @@ async def transfer_entitlements_to_google( """ # Create or coerce a protobuf request object. - request = service.TransferEntitlementsToGoogleRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -1996,7 +1913,7 @@ async def transfer_entitlements_to_google( response = operation_async.from_gapic( response, self._client._transport.operations_client, - empty.Empty, + empty_pb2.Empty, metadata_type=operations.OperationMetadata, ) @@ -2013,26 +1930,24 @@ async def list_channel_partner_links( ) -> pagers.ListChannelPartnerLinksAsyncPager: r"""List [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink]s - belonging to a distributor. To call this method, you must be a - distributor. + belonging to a distributor. You must be a distributor to call + this method. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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: If successful, returns the list of + Return value: The list of the distributor account's [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] - resources for the distributor account, otherwise returns an - error. + resources. Args: request (:class:`google.cloud.channel_v1.types.ListChannelPartnerLinksRequest`): The request object. Request message for [CloudChannelService.ListChannelPartnerLinks][google.cloud.channel.v1.CloudChannelService.ListChannelPartnerLinks] - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2049,7 +1964,6 @@ async def list_channel_partner_links( """ # Create or coerce a protobuf request object. - request = service.ListChannelPartnerLinksRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -2088,26 +2002,25 @@ async def get_channel_partner_link( ) -> channel_partner_links.ChannelPartnerLink: r"""Returns a requested [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] - resource. To call this method, you must be a distributor. + resource. You must be a distributor to call this method. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: ChannelPartnerLink resource not found. Results due - invalid channel partner link name. + - 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: + Return value: The [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] - resource if found, otherwise returns an error. + resource. Args: request (:class:`google.cloud.channel_v1.types.GetChannelPartnerLinkRequest`): The request object. Request message for [CloudChannelService.GetChannelPartnerLink][google.cloud.channel.v1.CloudChannelService.GetChannelPartnerLink]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2122,7 +2035,6 @@ async def get_channel_partner_link( """ # Create or coerce a protobuf request object. - request = service.GetChannelPartnerLinkRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -2154,36 +2066,35 @@ async def create_channel_partner_link( metadata: Sequence[Tuple[str, str]] = (), ) -> channel_partner_links.ChannelPartnerLink: r"""Initiates a channel partner link between a distributor and a - reseller or between resellers in an n-tier reseller channel. To - accept the invite, the invited partner should follow the - invite_link_uri provided in the response. If the link creation - is accepted, a valid link is set up between the two involved - parties. To call this method, you must be a distributor. - - Possible Error Codes: - - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - ALREADY_EXISTS: If the ChannelPartnerLink sent in the request + 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: If no Cloud Identity customer exists for domain - provided. + - NOT_FOUND: No Cloud Identity customer exists for provided + domain. - INTERNAL: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Newly created + Return value: The new [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] - resource if successful, otherwise error is returned. + resource. Args: request (:class:`google.cloud.channel_v1.types.CreateChannelPartnerLinkRequest`): The request object. Request message for [CloudChannelService.CreateChannelPartnerLink][google.cloud.channel.v1.CloudChannelService.CreateChannelPartnerLink] - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2198,7 +2109,6 @@ async def create_channel_partner_link( """ # Create or coerce a protobuf request object. - request = service.CreateChannelPartnerLinkRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -2229,36 +2139,36 @@ async def update_channel_partner_link( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> channel_partner_links.ChannelPartnerLink: - r"""Updates a channel partner link. A distributor calls this method - to change a link's status. For example, suspend a partner link. - To call this method, you must be a distributor. + r"""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: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: It can happen in following scenarios - + - PERMISSION_DENIED: The reseller account making the request is + different from the reseller account in the API request. + - INVALID_ARGUMENT: - - Missing or invalid required parameters in the request. - - Updating link state from invited to active or suspended. - - Sending reseller_cloud_identity_id, invite_url or name in - update mask. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: If successful, the updated + Return value: The updated [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] - resource, otherwise returns an error. + resource. Args: request (:class:`google.cloud.channel_v1.types.UpdateChannelPartnerLinkRequest`): The request object. Request message for [CloudChannelService.UpdateChannelPartnerLink][google.cloud.channel.v1.CloudChannelService.UpdateChannelPartnerLink] - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2273,7 +2183,6 @@ async def update_channel_partner_link( """ # Create or coerce a protobuf request object. - request = service.UpdateChannelPartnerLinkRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -2306,15 +2215,14 @@ async def list_products( ) -> pagers.ListProductsAsyncPager: r"""Lists the Products the reseller is authorized to sell. - Possible Error Codes: + Possible error codes: - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. Args: request (:class:`google.cloud.channel_v1.types.ListProductsRequest`): The request object. Request message for ListProducts. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2330,7 +2238,6 @@ async def list_products( """ # Create or coerce a protobuf request object. - request = service.ListProductsRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -2363,15 +2270,14 @@ async def list_skus( ) -> pagers.ListSkusAsyncPager: r"""Lists the SKUs for a product the reseller is authorized to sell. - Possible Error Codes: + Possible error codes: - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. Args: request (:class:`google.cloud.channel_v1.types.ListSkusRequest`): The request object. Request message for ListSkus. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2387,7 +2293,6 @@ async def list_skus( """ # Create or coerce a protobuf request object. - request = service.ListSkusRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -2426,15 +2331,14 @@ async def list_offers( ) -> pagers.ListOffersAsyncPager: r"""Lists the Offers the reseller can sell. - Possible Error Codes: + Possible error codes: - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. Args: request (:class:`google.cloud.channel_v1.types.ListOffersRequest`): The request object. Request message for ListOffers. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2450,7 +2354,6 @@ async def list_offers( """ # Create or coerce a protobuf request object. - request = service.ListOffersRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -2487,23 +2390,22 @@ async def list_purchasable_skus( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListPurchasableSkusAsyncPager: - r"""Lists the Purchasable SKUs for following cases: + r"""Lists the following: - - SKUs that can be newly purchased for a customer - - SKUs that can be upgraded/downgraded to, for an entitlement. + - SKUs that you can purchase for a customer + - SKUs that you can upgrade or downgrade for an entitlement. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the - reseller - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - PERMISSION_DENIED: The customer doesn't belong to the + reseller. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. Args: request (:class:`google.cloud.channel_v1.types.ListPurchasableSkusRequest`): The request object. Request message for ListPurchasableSkus. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2520,7 +2422,6 @@ async def list_purchasable_skus( """ # Create or coerce a protobuf request object. - request = service.ListPurchasableSkusRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -2557,23 +2458,22 @@ async def list_purchasable_offers( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListPurchasableOffersAsyncPager: - r"""Lists the Purchasable Offers for the following cases: + r"""Lists the following: - - Offers that can be newly purchased for a customer - - Offers that can be changed to, for an entitlement. + - Offers that you can purchase for a customer. + - Offers that you can change for an entitlement. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. Args: request (:class:`google.cloud.channel_v1.types.ListPurchasableOffersRequest`): The request object. Request message for ListPurchasableOffers. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2590,7 +2490,6 @@ async def list_purchasable_offers( """ # Create or coerce a protobuf request object. - request = service.ListPurchasableOffersRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -2628,30 +2527,29 @@ async def register_subscriber( metadata: Sequence[Tuple[str, str]] = (), ) -> service.RegisterSubscriberResponse: r"""Registers a service account with subscriber privileges on the - Cloud Pub/Sub topic created for this Channel Services account. - Once you create a subscriber, you will get the events as per + 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: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being provided are different, or if - the impersonated user is not a super admin. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Topic name with service email address registered - if successful, otherwise error is returned. + Return value: The topic name with the registered service email + address. Args: request (:class:`google.cloud.channel_v1.types.RegisterSubscriberRequest`): The request object. Request Message for RegisterSubscriber. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2665,7 +2563,6 @@ async def register_subscriber( """ # Create or coerce a protobuf request object. - request = service.RegisterSubscriberRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -2698,33 +2595,31 @@ async def unregister_subscriber( ) -> service.UnregisterSubscriberResponse: r"""Unregisters a service account with subscriber privileges on the Cloud Pub/Sub topic created for this Channel Services account. - If there are no more service account left with sunbscriber - privileges, the topic will be deleted. You can check this by - calling ListSubscribers api. - - Possible Error Codes: - - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being provided are different, or if - the impersonated user is not a super admin. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the topic resource doesn't exist. + 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Topic name from which service email address has - been unregistered if successful, otherwise error is returned. If - the service email was already not associated with the topic, the - success response will be returned. + 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. Args: request (:class:`google.cloud.channel_v1.types.UnregisterSubscriberRequest`): The request object. Request Message for UnregisterSubscriber. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2738,7 +2633,6 @@ async def unregister_subscriber( """ # Create or coerce a protobuf request object. - request = service.UnregisterSubscriberRequest(request) # Wrap the RPC method; this adds retry and timeout information, @@ -2772,26 +2666,24 @@ async def list_subscribers( r"""Lists service accounts with subscriber privileges on the Cloud Pub/Sub topic created for this Channel Services account. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being provided are different, or if - the account is not a super admin. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the topic resource doesn't exist. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: List of service email addresses if successful, - otherwise error is returned. + Return value: A list of service email addresses. Args: request (:class:`google.cloud.channel_v1.types.ListSubscribersRequest`): The request object. Request Message for ListSubscribers. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2807,7 +2699,6 @@ async def list_subscribers( """ # Create or coerce a protobuf request object. - request = service.ListSubscribersRequest(request) # Wrap the RPC method; this adds retry and timeout information, diff --git a/google/cloud/channel_v1/services/cloud_channel_service/client.py b/google/cloud/channel_v1/services/cloud_channel_service/client.py index e818cc9..9d027a9 100644 --- a/google/cloud/channel_v1/services/cloud_channel_service/client.py +++ b/google/cloud/channel_v1/services/cloud_channel_service/client.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # - from collections import OrderedDict from distutils import util import os @@ -23,10 +21,10 @@ import pkg_resources from google.api_core import client_options as client_options_lib # type: ignore -from google.api_core import exceptions # type: ignore +from google.api_core import exceptions as core_exceptions # type: ignore from google.api_core import gapic_v1 # type: ignore from google.api_core import retry as retries # type: ignore -from google.auth import credentials # type: ignore +from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore from google.auth.exceptions import MutualTLSChannelError # type: ignore @@ -43,10 +41,9 @@ from google.cloud.channel_v1.types import operations from google.cloud.channel_v1.types import products from google.cloud.channel_v1.types import service -from google.protobuf import empty_pb2 as empty # type: ignore -from google.protobuf import timestamp_pb2 as timestamp # type: ignore -from google.type import postal_address_pb2 as postal_address # type: ignore - +from google.protobuf import empty_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore +from google.type import postal_address_pb2 # type: ignore from .transports.base import CloudChannelServiceTransport, DEFAULT_CLIENT_INFO from .transports.grpc import CloudChannelServiceGrpcTransport from .transports.grpc_asyncio import CloudChannelServiceGrpcAsyncIOTransport @@ -69,7 +66,7 @@ class CloudChannelServiceClientMeta(type): def get_transport_class( cls, label: str = None, ) -> Type[CloudChannelServiceTransport]: - """Return an appropriate transport class. + """Returns an appropriate transport class. Args: label: The name of the desired transport. If none is @@ -88,40 +85,35 @@ def get_transport_class( class CloudChannelServiceClient(metaclass=CloudChannelServiceClientMeta): - """CloudChannelService enables Google cloud resellers and distributors - to manage their customers, channel partners, entitlements and - reports. + """CloudChannelService lets Google cloud resellers and distributors + manage their customers, channel partners, entitlements, and reports. Using this service: - 1. Resellers or distributors can manage a customer entity. + 1. Resellers and distributors can manage a customer entity. 2. Distributors can register an authorized reseller in their channel - and then enable delegated admin access for the reseller. - 3. Resellers or distributors can manage entitlements for their - customers. + and provide them with delegated admin access. + 3. Resellers and distributors can manage customer entitlements. - The service primarily exposes the following resources: + CloudChannelService exposes the following resources: - - [Customer][google.cloud.channel.v1.Customer]s: A Customer - represents an entity managed by a reseller or distributor. A - customer typically represents an enterprise. In an n-tier resale - channel hierarchy, customers are generally represented as leaf - nodes. Customers primarily have an Entitlement sub-resource - discussed below. + - [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 - Entitlement represents an entity which provides a customer means - to start using 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: - A ChannelPartnerLink is an entity that identifies links between - distributors and their indirect resellers in a channel. + An entity that identifies links between distributors and their + indirect resellers in a channel. """ @staticmethod def _get_default_mtls_endpoint(api_endpoint): - """Convert api endpoint to mTLS endpoint. + """Converts api endpoint to mTLS endpoint. + Convert "*.sandbox.googleapis.com" and "*.googleapis.com" to "*.mtls.sandbox.googleapis.com" and "*.mtls.googleapis.com" respectively. Args: @@ -155,7 +147,8 @@ def _get_default_mtls_endpoint(api_endpoint): @classmethod def from_service_account_info(cls, info: dict, *args, **kwargs): - """Creates an instance of this client using the provided credentials info. + """Creates an instance of this client using the provided credentials + info. Args: info (dict): The service account private key info. @@ -172,7 +165,7 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): """Creates an instance of this client using the provided credentials - file. + file. Args: filename (str): The path to the service account private key json @@ -191,36 +184,37 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): @property def transport(self) -> CloudChannelServiceTransport: - """Return the transport used by the client instance. + """Returns the transport used by the client instance. Returns: - CloudChannelServiceTransport: The transport used by the client instance. + CloudChannelServiceTransport: The transport used by the client + instance. """ return self._transport @staticmethod def customer_path(account: str, customer: str,) -> str: - """Return a fully-qualified customer string.""" + """Returns a fully-qualified customer string.""" return "accounts/{account}/customers/{customer}".format( account=account, customer=customer, ) @staticmethod def parse_customer_path(path: str) -> Dict[str, str]: - """Parse a customer path into its component segments.""" + """Parses a customer path into its component segments.""" m = re.match(r"^accounts/(?P.+?)/customers/(?P.+?)$", path) return m.groupdict() if m else {} @staticmethod def entitlement_path(account: str, customer: str, entitlement: str,) -> str: - """Return a fully-qualified entitlement string.""" + """Returns a fully-qualified entitlement string.""" return "accounts/{account}/customers/{customer}/entitlements/{entitlement}".format( account=account, customer=customer, entitlement=entitlement, ) @staticmethod def parse_entitlement_path(path: str) -> Dict[str, str]: - """Parse a entitlement path into its component segments.""" + """Parses a entitlement path into its component segments.""" m = re.match( r"^accounts/(?P.+?)/customers/(?P.+?)/entitlements/(?P.+?)$", path, @@ -229,40 +223,40 @@ def parse_entitlement_path(path: str) -> Dict[str, str]: @staticmethod def offer_path(account: str, offer: str,) -> str: - """Return a fully-qualified offer string.""" + """Returns a fully-qualified offer string.""" return "accounts/{account}/offers/{offer}".format(account=account, offer=offer,) @staticmethod def parse_offer_path(path: str) -> Dict[str, str]: - """Parse a offer path into its component segments.""" + """Parses a offer path into its component segments.""" m = re.match(r"^accounts/(?P.+?)/offers/(?P.+?)$", path) return m.groupdict() if m else {} @staticmethod def product_path(product: str,) -> str: - """Return a fully-qualified product string.""" + """Returns a fully-qualified product string.""" return "products/{product}".format(product=product,) @staticmethod def parse_product_path(path: str) -> Dict[str, str]: - """Parse a product path into its component segments.""" + """Parses a product path into its component segments.""" m = re.match(r"^products/(?P.+?)$", path) return m.groupdict() if m else {} @staticmethod def sku_path(product: str, sku: str,) -> str: - """Return a fully-qualified sku string.""" + """Returns a fully-qualified sku string.""" return "products/{product}/skus/{sku}".format(product=product, sku=sku,) @staticmethod def parse_sku_path(path: str) -> Dict[str, str]: - """Parse a sku path into its component segments.""" + """Parses a sku path into its component segments.""" m = re.match(r"^products/(?P.+?)/skus/(?P.+?)$", path) return m.groupdict() if m else {} @staticmethod def common_billing_account_path(billing_account: str,) -> str: - """Return a fully-qualified billing_account string.""" + """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -275,7 +269,7 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: @staticmethod def common_folder_path(folder: str,) -> str: - """Return a fully-qualified folder string.""" + """Returns a fully-qualified folder string.""" return "folders/{folder}".format(folder=folder,) @staticmethod @@ -286,7 +280,7 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: @staticmethod def common_organization_path(organization: str,) -> str: - """Return a fully-qualified organization string.""" + """Returns a fully-qualified organization string.""" return "organizations/{organization}".format(organization=organization,) @staticmethod @@ -297,7 +291,7 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: @staticmethod def common_project_path(project: str,) -> str: - """Return a fully-qualified project string.""" + """Returns a fully-qualified project string.""" return "projects/{project}".format(project=project,) @staticmethod @@ -308,7 +302,7 @@ def parse_common_project_path(path: str) -> Dict[str, str]: @staticmethod def common_location_path(project: str, location: str,) -> str: - """Return a fully-qualified location string.""" + """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( project=project, location=location, ) @@ -322,12 +316,12 @@ def parse_common_location_path(path: str) -> Dict[str, str]: def __init__( self, *, - credentials: Optional[credentials.Credentials] = None, + credentials: Optional[ga_credentials.Credentials] = None, transport: Union[str, CloudChannelServiceTransport, None] = None, client_options: Optional[client_options_lib.ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: - """Instantiate the cloud channel service client. + """Instantiates the cloud channel service client. Args: credentials (Optional[google.auth.credentials.Credentials]): The @@ -382,9 +376,10 @@ def __init__( client_cert_source_func = client_options.client_cert_source else: is_mtls = mtls.has_default_client_cert_source() - client_cert_source_func = ( - mtls.default_client_cert_source() if is_mtls else None - ) + if is_mtls: + client_cert_source_func = mtls.default_client_cert_source() + else: + client_cert_source_func = None # Figure out which api endpoint to use. if client_options.api_endpoint is not None: @@ -396,12 +391,14 @@ def __init__( elif use_mtls_env == "always": api_endpoint = self.DEFAULT_MTLS_ENDPOINT elif use_mtls_env == "auto": - api_endpoint = ( - self.DEFAULT_MTLS_ENDPOINT if is_mtls else self.DEFAULT_ENDPOINT - ) + if is_mtls: + api_endpoint = self.DEFAULT_MTLS_ENDPOINT + else: + api_endpoint = self.DEFAULT_ENDPOINT else: raise MutualTLSChannelError( - "Unsupported GOOGLE_API_USE_MTLS_ENDPOINT value. Accepted values: never, auto, always" + "Unsupported GOOGLE_API_USE_MTLS_ENDPOINT value. Accepted " + "values: never, auto, always" ) # Save or instantiate the transport. @@ -416,8 +413,8 @@ def __init__( ) if client_options.scopes: raise ValueError( - "When providing a transport instance, " - "provide its scopes directly." + "When providing a transport instance, provide its scopes " + "directly." ) self._transport = transport else: @@ -440,24 +437,23 @@ def list_customers( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListCustomersPager: - r"""List downstream [Customer][google.cloud.channel.v1.Customer]s. + r"""List [Customer][google.cloud.channel.v1.Customer]s. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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 pertaining to the - reseller or empty list if there are none. + Return value: List of + [Customer][google.cloud.channel.v1.Customer]s, or an empty list + if there are no customers. Args: request (google.cloud.channel_v1.types.ListCustomersRequest): The request object. Request message for [CloudChannelService.ListCustomers][google.cloud.channel.v1.CloudChannelService.ListCustomers] - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -474,7 +470,6 @@ def list_customers( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.ListCustomersRequest. # There's no risk of modifying the input as we've already verified @@ -516,17 +511,17 @@ def get_customer( r"""Returns a requested [Customer][google.cloud.channel.v1.Customer] resource. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the customer resource doesn't exist. Usually - the result of an invalid name parameter. + - 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: [Customer][google.cloud.channel.v1.Customer] - resource if found, error otherwise. + Return value: The [Customer][google.cloud.channel.v1.Customer] + resource. Args: request (google.cloud.channel_v1.types.GetCustomerRequest): @@ -534,13 +529,12 @@ def get_customer( [CloudChannelService.GetCustomer][google.cloud.channel.v1.CloudChannelService.GetCustomer]. name (str): Required. The resource name of the customer to retrieve. - The name takes the format: + Name uses the format: accounts/{account_id}/customers/{customer_id} This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -569,10 +563,8 @@ def get_customer( # there are no flattened fields. if not isinstance(request, service.GetCustomerRequest): request = service.GetCustomerRequest(request) - # If we have keyword arguments corresponding to fields on the # request, apply these. - if name is not None: request.name = name @@ -600,24 +592,24 @@ def check_cloud_identity_accounts_exist( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> service.CheckCloudIdentityAccountsExistResponse: - r"""Confirms the existence of Cloud Identity accounts, based on the - domain and whether the Cloud Identity accounts are owned by the + r"""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: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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: List of + Return value: A list of [CloudIdentityCustomerAccount][google.cloud.channel.v1.CloudIdentityCustomerAccount] - resources for the domain. List may be empty. + resources for the domain (may be empty) - Note: in the v1alpha1 version of the API, a NOT_FOUND error is - returned if no + 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. @@ -625,7 +617,6 @@ def check_cloud_identity_accounts_exist( request (google.cloud.channel_v1.types.CheckCloudIdentityAccountsExistRequest): The request object. Request message for [CloudChannelService.CheckCloudIdentityAccountsExist][google.cloud.channel.v1.CloudChannelService.CheckCloudIdentityAccountsExist]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -639,7 +630,6 @@ def check_cloud_identity_accounts_exist( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.CheckCloudIdentityAccountsExistRequest. # There's no risk of modifying the input as we've already verified @@ -676,25 +666,22 @@ def create_customer( r"""Creates a new [Customer][google.cloud.channel.v1.Customer] resource under the reseller or distributor account. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: It can happen in following scenarios - + - PERMISSION_DENIED: The reseller account making the request is + different from the reseller account in the API request. + - INVALID_ARGUMENT: - - Missing or invalid required parameters in the request. - - Domain field value doesn't match the domain specified in - primary email. + - Required request parameters are missing or invalid. + - Domain field value doesn't match the primary email domain. - Return Value: If successful, the newly created - [Customer][google.cloud.channel.v1.Customer] resource, otherwise - returns an error. + Return value: The newly created + [Customer][google.cloud.channel.v1.Customer] resource. Args: request (google.cloud.channel_v1.types.CreateCustomerRequest): The request object. Request message for [CloudChannelService.CreateCustomer][google.cloud.channel.v1.CloudChannelService.CreateCustomer] - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -708,7 +695,6 @@ def create_customer( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.CreateCustomerRequest. # There's no risk of modifying the input as we've already verified @@ -741,26 +727,24 @@ def update_customer( metadata: Sequence[Tuple[str, str]] = (), ) -> customers.Customer: r"""Updates an existing [Customer][google.cloud.channel.v1.Customer] - resource belonging to the reseller or distributor. + resource for the reseller or distributor. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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 specified in the request. + resource found for the name in the request. - Return Value: If successful, the updated - [Customer][google.cloud.channel.v1.Customer] resource, otherwise - returns an error. + Return value: The updated + [Customer][google.cloud.channel.v1.Customer] resource. Args: request (google.cloud.channel_v1.types.UpdateCustomerRequest): The request object. Request message for [CloudChannelService.UpdateCustomer][google.cloud.channel.v1.CloudChannelService.UpdateCustomer]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -774,7 +758,6 @@ def update_customer( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.UpdateCustomerRequest. # There's no risk of modifying the input as we've already verified @@ -812,16 +795,15 @@ def delete_customer( r"""Deletes the given [Customer][google.cloud.channel.v1.Customer] permanently and irreversibly. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the account making the request does not + - PERMISSION_DENIED: The account making the request does not own this customer. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - FAILED_PRECONDITION: If the customer has existing - entitlements. + - 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 specified in the request. + resource found for the name in the request. Args: request (google.cloud.channel_v1.types.DeleteCustomerRequest): @@ -834,7 +816,6 @@ def delete_customer( This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -857,10 +838,8 @@ def delete_customer( # there are no flattened fields. if not isinstance(request, service.DeleteCustomerRequest): request = service.DeleteCustomerRequest(request) - # If we have keyword arguments corresponding to fields on the # request, apply these. - if name is not None: request.name = name @@ -888,36 +867,33 @@ def provision_cloud_identity( metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: r"""Creates a Cloud Identity for the given customer using the - customer's information or the information provided here, if - present. + customer's information, or the information provided here. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the customer is not found for the reseller. - - ALREADY_EXISTS: If the customer's primary email already - exists. In this case, retry after changing the customer's - primary contact email. + - 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 in this case. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. Contact Cloud Channel support in this case. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 + contains an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. Args: request (google.cloud.channel_v1.types.ProvisionCloudIdentityRequest): The request object. Request message for [CloudChannelService.ProvisionCloudIdentity][google.cloud.channel.v1.CloudChannelService.ProvisionCloudIdentity] - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -934,7 +910,6 @@ def provision_cloud_identity( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.ProvisionCloudIdentityRequest. # There's no risk of modifying the input as we've already verified @@ -974,25 +949,23 @@ def list_entitlements( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListEntitlementsPager: - r"""List [Entitlement][google.cloud.channel.v1.Entitlement]s + r"""Lists [Entitlement][google.cloud.channel.v1.Entitlement]s belonging to a customer. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. - Return Value: List of - [Entitlement][google.cloud.channel.v1.Entitlement]s belonging to - the customer, or empty list if there are none. + Return value: A list of the customer's + [Entitlement][google.cloud.channel.v1.Entitlement]s. Args: request (google.cloud.channel_v1.types.ListEntitlementsRequest): The request object. Request message for [CloudChannelService.ListEntitlements][google.cloud.channel.v1.CloudChannelService.ListEntitlements] - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1009,7 +982,6 @@ def list_entitlements( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.ListEntitlementsRequest. # There's no risk of modifying the input as we've already verified @@ -1048,35 +1020,33 @@ def list_transferable_skus( metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListTransferableSkusPager: r"""List [TransferableSku][google.cloud.channel.v1.TransferableSku]s - of a customer based on Cloud Identity ID or Customer Name in the - request. + of a customer based on the Cloud Identity ID or Customer Name in + the request. - This method is used when a reseller lists the entitlements - information of a customer that is not owned. The reseller should - provide the customer's Cloud Identity ID or Customer Name. + 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: + Possible error codes: - - PERMISSION_DENIED: Appears because of one of the following - + - PERMISSION_DENIED: - - The customer doesn't belong to the reseller and no auth - token. + - 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 and the queries - reseller account are different. + - The reseller account making the request is different from + the reseller account in the query. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. - Return Value: List of - [TransferableSku][google.cloud.channel.v1.TransferableSku] for - the given customer. + Return value: A list of the customer's + [TransferableSku][google.cloud.channel.v1.TransferableSku]. Args: request (google.cloud.channel_v1.types.ListTransferableSkusRequest): The request object. Request message for [CloudChannelService.ListTransferableSkus][google.cloud.channel.v1.CloudChannelService.ListTransferableSkus] - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1093,7 +1063,6 @@ def list_transferable_skus( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.ListTransferableSkusRequest. # There's no risk of modifying the input as we've already verified @@ -1136,23 +1105,24 @@ def list_transferable_offers( of a customer based on Cloud Identity ID or Customer Name in the request. - This method is used when a reseller gets the entitlement - information of a customer that is not owned. The reseller should - provide the customer's Cloud Identity ID or Customer Name. + 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: + Possible error codes: - - PERMISSION_DENIED: Appears because of one of the following: + - PERMISSION_DENIED: - - If the customer doesn't belong to the reseller and no auth - token or invalid auth token is supplied. - - If the reseller account making the request and the - reseller account being queried for are different. + - 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: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. - Return Value: List of + Return value: List of [TransferableOffer][google.cloud.channel.v1.TransferableOffer] for the given customer and SKU. @@ -1160,7 +1130,6 @@ def list_transferable_offers( request (google.cloud.channel_v1.types.ListTransferableOffersRequest): The request object. Request message for [CloudChannelService.ListTransferableOffers][google.cloud.channel.v1.CloudChannelService.ListTransferableOffers] - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1177,7 +1146,6 @@ def list_transferable_offers( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.ListTransferableOffersRequest. # There's no risk of modifying the input as we've already verified @@ -1218,23 +1186,21 @@ def get_entitlement( r"""Returns a requested [Entitlement][google.cloud.channel.v1.Entitlement] resource. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the entitlement is not found for the customer. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. + - NOT_FOUND: The customer entitlement was not found. - Return Value: If found, the requested - [Entitlement][google.cloud.channel.v1.Entitlement] resource, - otherwise returns an error. + Return value: The requested + [Entitlement][google.cloud.channel.v1.Entitlement] resource. Args: request (google.cloud.channel_v1.types.GetEntitlementRequest): The request object. Request message for [CloudChannelService.GetEntitlement][google.cloud.channel.v1.CloudChannelService.GetEntitlement]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1248,7 +1214,6 @@ def get_entitlement( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.GetEntitlementRequest. # There's no risk of modifying the input as we've already verified @@ -1282,51 +1247,44 @@ def create_entitlement( ) -> operation.Operation: r"""Creates an entitlement for a customer. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: It can happen in below scenarios - - - - Missing or invalid required parameters in the request. - - Cannot purchase an entitlement if there is already an - entitlement for customer, for a SKU from the same product - family. - - INVALID_VALUE: Offer passed in isn't valid. Make sure - OfferId is valid. If it is valid, then contact Google - Channel support for further troubleshooting. - - - NOT_FOUND: If the customer or offer resource is not found for - the reseller. - - ALREADY_EXISTS: This failure can happen in the following - cases: - - - If the SKU has been already purchased for the customer. - - If the customer's primary email already exists. In this - case retry after changing the customer's primary contact - email. - - - CONDITION_NOT_MET or FAILED_PRECONDITION: This failure can - happen in the following cases: - - - Purchasing a SKU that requires domain verification and the - domain has not been verified. - - Purchasing an Add-On SKU like Vault or Drive without - purchasing the pre-requisite SKU, such as Google Workspace - Business Starter. - - Applicable only for developer accounts: reseller and - resold domain. Must meet the following domain naming - requirements: + - 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. - - Resold domain names must include the reseller domain. + - Domain names must include the reseller domain. - INTERNAL: Any non-user error related to a technical issue in - the backend. Contact Cloud Channel Support in this case. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. Contact Cloud Channel Support in this case. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1337,7 +1295,6 @@ def create_entitlement( request (google.cloud.channel_v1.types.CreateEntitlementRequest): The request object. Request message for [CloudChannelService.CreateEntitlement][google.cloud.channel.v1.CloudChannelService.CreateEntitlement] - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1355,7 +1312,6 @@ def create_entitlement( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.CreateEntitlementRequest. # There's no risk of modifying the input as we've already verified @@ -1395,28 +1351,26 @@ def change_parameters( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: - r"""Change parameters of the entitlement + r"""Change parameters of the entitlement. - An entitlement parameters update is a long-running operation and - results in updates to the entitlement as a result of - fulfillment. + An entitlement update is a long-running operation and it updates + the entitlement as a result of fulfillment. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. For example, if the number of seats being - changed to is greater than the allowed number of max seats - for the resource. Or decreasing seats for a commitment based - plan. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1427,7 +1381,6 @@ def change_parameters( request (google.cloud.channel_v1.types.ChangeParametersRequest): The request object. Request message for [CloudChannelService.ChangeParametersRequest][]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1445,7 +1398,6 @@ def change_parameters( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.ChangeParametersRequest. # There's no risk of modifying the input as we've already verified @@ -1488,25 +1440,25 @@ def change_renewal_settings( r"""Updates the renewal settings for an existing customer entitlement. - An entitlement update is a long-running operation and results in - updates to the entitlement as a result of fulfillment. + An entitlement update is a long-running operation and it updates + the entitlement as a result of fulfillment. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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 renewal 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. In this case, contact Cloud Channel support. - - UNKNOWN: Any non user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + - 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: Long Running Operation ID. + 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 @@ -1517,7 +1469,6 @@ def change_renewal_settings( request (google.cloud.channel_v1.types.ChangeRenewalSettingsRequest): The request object. Request message for [CloudChannelService.ChangeRenewalSettings][google.cloud.channel.v1.CloudChannelService.ChangeRenewalSettings]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1535,7 +1486,6 @@ def change_renewal_settings( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.ChangeRenewalSettingsRequest. # There's no risk of modifying the input as we've already verified @@ -1577,22 +1527,22 @@ def change_offer( ) -> operation.Operation: r"""Updates the Offer for an existing customer entitlement. - An entitlement update is a long-running operation and results in - updates to the entitlement as a result of fulfillment. + An entitlement update is a long-running operation and it updates + the entitlement as a result of fulfillment. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1603,7 +1553,6 @@ def change_offer( request (google.cloud.channel_v1.types.ChangeOfferRequest): The request object. Request message for [CloudChannelService.ChangeOffer][google.cloud.channel.v1.CloudChannelService.ChangeOffer]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1621,7 +1570,6 @@ def change_offer( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.ChangeOfferRequest. # There's no risk of modifying the input as we've already verified @@ -1664,24 +1612,24 @@ def start_paid_service( r"""Starts paid service for a trial entitlement. Starts paid service for a trial entitlement immediately. This - method is only applicable if a plan has already been set up for - a trial entitlement but has some trial days remaining. + method is only applicable if a plan is set up for a trial + entitlement but has some trial days remaining. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1692,7 +1640,6 @@ def start_paid_service( request (google.cloud.channel_v1.types.StartPaidServiceRequest): The request object. Request message for [CloudChannelService.StartPaidService][google.cloud.channel.v1.CloudChannelService.StartPaidService]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1710,7 +1657,6 @@ def start_paid_service( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.StartPaidServiceRequest. # There's no risk of modifying the input as we've already verified @@ -1750,23 +1696,24 @@ def suspend_entitlement( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: - r"""Suspends a previously fulfilled entitlement. An entitlement - suspension is a long-running operation. + r"""Suspends a previously fulfilled entitlement. - Possible Error Codes: + An entitlement suspension is a long-running operation. - - PERMISSION_DENIED: If the customer doesn't belong to the + Possible error codes: + + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1777,7 +1724,6 @@ def suspend_entitlement( request (google.cloud.channel_v1.types.SuspendEntitlementRequest): The request object. Request message for [CloudChannelService.SuspendEntitlement][google.cloud.channel.v1.CloudChannelService.SuspendEntitlement]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1795,7 +1741,6 @@ def suspend_entitlement( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.SuspendEntitlementRequest. # There's no risk of modifying the input as we've already verified @@ -1835,29 +1780,28 @@ def cancel_entitlement( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: - r"""Cancels a previously fulfilled entitlement. An entitlement - cancellation is a long-running operation. - - Possible Error Codes: - - - PERMISSION_DENIED: If the customer doesn't belong to the - reseller or if the reseller account making the request and - reseller account being queried for are different. - - FAILED_PRECONDITION: If there are any Google Cloud projects - linked to the Google Cloud entitlement's Cloud Billing - subaccount. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + r"""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 + Workspace add-ons, or entitlements for Google Cloud's development platform. - INTERNAL: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1869,7 +1813,6 @@ def cancel_entitlement( request (google.cloud.channel_v1.types.CancelEntitlementRequest): The request object. Request message for [CloudChannelService.CancelEntitlement][google.cloud.channel.v1.CloudChannelService.CancelEntitlement]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1896,7 +1839,6 @@ def cancel_entitlement( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.CancelEntitlementRequest. # There's no risk of modifying the input as we've already verified @@ -1921,7 +1863,7 @@ def cancel_entitlement( response = operation.from_gapic( response, self._transport.operations_client, - empty.Empty, + empty_pb2.Empty, metadata_type=operations.OperationMetadata, ) @@ -1936,32 +1878,31 @@ def activate_entitlement( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: - r"""Activates a previously suspended entitlement. The entitlement - must be in a suspended state for it to be activated. - Entitlements suspended for pending ToS acceptance can't be - activated using this method. An entitlement activation is a - long-running operation and can result in updates to the state of - the customer entitlement. - - Possible Error Codes: - - - PERMISSION_DENIED: If the customer doesn't belong to the - reseller or if the reseller account making the request and - reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + r"""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't activate an - entitlement that is pending TOS acceptance. Only reseller - initiated suspensions can be activated. - - NOT_SUSPENDED: Can't activate entitlements that are already - in ACTIVE state. Can only activate suspended entitlements. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1972,7 +1913,6 @@ def activate_entitlement( request (google.cloud.channel_v1.types.ActivateEntitlementRequest): The request object. Request message for [CloudChannelService.ActivateEntitlement][google.cloud.channel.v1.CloudChannelService.ActivateEntitlement]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -1990,7 +1930,6 @@ def activate_entitlement( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.ActivateEntitlementRequest. # There's no risk of modifying the input as we've already verified @@ -2032,40 +1971,35 @@ def transfer_entitlements( ) -> operation.Operation: r"""Transfers customer entitlements to new reseller. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the customer or offer resource is not found for - the reseller. - - ALREADY_EXISTS: If the SKU has been already transferred for - the customer. - - CONDITION_NOT_MET or FAILED_PRECONDITION: This failure can - happen in the following cases: - - - Transferring a SKU that requires domain verification and - the domain has not been verified. - - Transferring an Add-On SKU like Vault or Drive without - transferring the pre-requisite SKU, such as G Suite Basic. - - Applicable only for developer accounts: reseller and - resold domain must follow the domain naming convention as - follows: + - 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. - - Resold domain names must include the reseller domain. + - Domain names must include the reseller domain. - - All transferring entitlements must be specified. + - Specify all transferring entitlements. - INTERNAL: Any non-user error related to a technical issue in - the backend. Please contact Cloud Channel Support in this - case. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. Please contact Cloud Channel Support in this - case. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -2076,7 +2010,6 @@ def transfer_entitlements( request (google.cloud.channel_v1.types.TransferEntitlementsRequest): The request object. Request message for [CloudChannelService.TransferEntitlements][google.cloud.channel.v1.CloudChannelService.TransferEntitlements]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2088,12 +2021,11 @@ def transfer_entitlements( An object representing a long-running operation. The result type for the operation will be :class:`google.cloud.channel_v1.types.TransferEntitlementsResponse` Response message for [CloudChannelService.TransferEntitlements][google.cloud.channel.v1.CloudChannelService.TransferEntitlements]. - This will be put into the response field of + This is put in the response field of google.longrunning.Operation. """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.TransferEntitlementsRequest. # There's no risk of modifying the input as we've already verified @@ -2133,40 +2065,36 @@ def transfer_entitlements_to_google( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> operation.Operation: - r"""Transfers customer entitlements from current reseller to Google. + r"""Transfers customer entitlements from their current reseller to + Google. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the customer or offer resource is not found for - the reseller. - - ALREADY_EXISTS: If the SKU has been already transferred for - the customer. - - CONDITION_NOT_MET or FAILED_PRECONDITION: This failure can - happen in the following cases: - - - Transferring a SKU that requires domain verification and - the domain has not been verified. - - Transferring an Add-On SKU like Vault or Drive without - purchasing the pre-requisite SKU, such as G Suite Basic. - - Applicable only for developer accounts: reseller and - resold domain must follow the domain naming convention as - follows: + - 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. - - Resold domain names must include the reseller domain. + - Domain names must include the reseller domain. - INTERNAL: Any non-user error related to a technical issue in - the backend. Please contact Cloud Channel Support in this - case. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. Please contact Cloud Channel Support in this - case. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -2178,7 +2106,6 @@ def transfer_entitlements_to_google( request (google.cloud.channel_v1.types.TransferEntitlementsToGoogleRequest): The request object. Request message for [CloudChannelService.TransferEntitlementsToGoogle][google.cloud.channel.v1.CloudChannelService.TransferEntitlementsToGoogle]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2205,7 +2132,6 @@ def transfer_entitlements_to_google( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.TransferEntitlementsToGoogleRequest. # There's no risk of modifying the input as we've already verified @@ -2232,7 +2158,7 @@ def transfer_entitlements_to_google( response = operation.from_gapic( response, self._transport.operations_client, - empty.Empty, + empty_pb2.Empty, metadata_type=operations.OperationMetadata, ) @@ -2249,26 +2175,24 @@ def list_channel_partner_links( ) -> pagers.ListChannelPartnerLinksPager: r"""List [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink]s - belonging to a distributor. To call this method, you must be a - distributor. + belonging to a distributor. You must be a distributor to call + this method. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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: If successful, returns the list of + Return value: The list of the distributor account's [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] - resources for the distributor account, otherwise returns an - error. + resources. Args: request (google.cloud.channel_v1.types.ListChannelPartnerLinksRequest): The request object. Request message for [CloudChannelService.ListChannelPartnerLinks][google.cloud.channel.v1.CloudChannelService.ListChannelPartnerLinks] - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2285,7 +2209,6 @@ def list_channel_partner_links( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.ListChannelPartnerLinksRequest. # There's no risk of modifying the input as we've already verified @@ -2327,26 +2250,25 @@ def get_channel_partner_link( ) -> channel_partner_links.ChannelPartnerLink: r"""Returns a requested [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] - resource. To call this method, you must be a distributor. + resource. You must be a distributor to call this method. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: ChannelPartnerLink resource not found. Results due - invalid channel partner link name. + - 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: + Return value: The [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] - resource if found, otherwise returns an error. + resource. Args: request (google.cloud.channel_v1.types.GetChannelPartnerLinkRequest): The request object. Request message for [CloudChannelService.GetChannelPartnerLink][google.cloud.channel.v1.CloudChannelService.GetChannelPartnerLink]. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2361,7 +2283,6 @@ def get_channel_partner_link( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.GetChannelPartnerLinkRequest. # There's no risk of modifying the input as we've already verified @@ -2394,36 +2315,35 @@ def create_channel_partner_link( metadata: Sequence[Tuple[str, str]] = (), ) -> channel_partner_links.ChannelPartnerLink: r"""Initiates a channel partner link between a distributor and a - reseller or between resellers in an n-tier reseller channel. To - accept the invite, the invited partner should follow the - invite_link_uri provided in the response. If the link creation - is accepted, a valid link is set up between the two involved - parties. To call this method, you must be a distributor. - - Possible Error Codes: - - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - ALREADY_EXISTS: If the ChannelPartnerLink sent in the request + 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: If no Cloud Identity customer exists for domain - provided. + - NOT_FOUND: No Cloud Identity customer exists for provided + domain. - INTERNAL: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Newly created + Return value: The new [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] - resource if successful, otherwise error is returned. + resource. Args: request (google.cloud.channel_v1.types.CreateChannelPartnerLinkRequest): The request object. Request message for [CloudChannelService.CreateChannelPartnerLink][google.cloud.channel.v1.CloudChannelService.CreateChannelPartnerLink] - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2438,7 +2358,6 @@ def create_channel_partner_link( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.CreateChannelPartnerLinkRequest. # There's no risk of modifying the input as we've already verified @@ -2472,36 +2391,36 @@ def update_channel_partner_link( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> channel_partner_links.ChannelPartnerLink: - r"""Updates a channel partner link. A distributor calls this method - to change a link's status. For example, suspend a partner link. - To call this method, you must be a distributor. + r"""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: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: It can happen in following scenarios - + - PERMISSION_DENIED: The reseller account making the request is + different from the reseller account in the API request. + - INVALID_ARGUMENT: - - Missing or invalid required parameters in the request. - - Updating link state from invited to active or suspended. - - Sending reseller_cloud_identity_id, invite_url or name in - update mask. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: If successful, the updated + Return value: The updated [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] - resource, otherwise returns an error. + resource. Args: request (google.cloud.channel_v1.types.UpdateChannelPartnerLinkRequest): The request object. Request message for [CloudChannelService.UpdateChannelPartnerLink][google.cloud.channel.v1.CloudChannelService.UpdateChannelPartnerLink] - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2516,7 +2435,6 @@ def update_channel_partner_link( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.UpdateChannelPartnerLinkRequest. # There's no risk of modifying the input as we've already verified @@ -2552,15 +2470,14 @@ def list_products( ) -> pagers.ListProductsPager: r"""Lists the Products the reseller is authorized to sell. - Possible Error Codes: + Possible error codes: - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. Args: request (google.cloud.channel_v1.types.ListProductsRequest): The request object. Request message for ListProducts. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2576,7 +2493,6 @@ def list_products( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.ListProductsRequest. # There's no risk of modifying the input as we've already verified @@ -2610,15 +2526,14 @@ def list_skus( ) -> pagers.ListSkusPager: r"""Lists the SKUs for a product the reseller is authorized to sell. - Possible Error Codes: + Possible error codes: - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. Args: request (google.cloud.channel_v1.types.ListSkusRequest): The request object. Request message for ListSkus. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2634,7 +2549,6 @@ def list_skus( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.ListSkusRequest. # There's no risk of modifying the input as we've already verified @@ -2674,15 +2588,14 @@ def list_offers( ) -> pagers.ListOffersPager: r"""Lists the Offers the reseller can sell. - Possible Error Codes: + Possible error codes: - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. Args: request (google.cloud.channel_v1.types.ListOffersRequest): The request object. Request message for ListOffers. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2698,7 +2611,6 @@ def list_offers( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.ListOffersRequest. # There's no risk of modifying the input as we've already verified @@ -2736,23 +2648,22 @@ def list_purchasable_skus( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListPurchasableSkusPager: - r"""Lists the Purchasable SKUs for following cases: + r"""Lists the following: - - SKUs that can be newly purchased for a customer - - SKUs that can be upgraded/downgraded to, for an entitlement. + - SKUs that you can purchase for a customer + - SKUs that you can upgrade or downgrade for an entitlement. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the - reseller - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - PERMISSION_DENIED: The customer doesn't belong to the + reseller. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. Args: request (google.cloud.channel_v1.types.ListPurchasableSkusRequest): The request object. Request message for ListPurchasableSkus. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2769,7 +2680,6 @@ def list_purchasable_skus( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.ListPurchasableSkusRequest. # There's no risk of modifying the input as we've already verified @@ -2807,23 +2717,22 @@ def list_purchasable_offers( timeout: float = None, metadata: Sequence[Tuple[str, str]] = (), ) -> pagers.ListPurchasableOffersPager: - r"""Lists the Purchasable Offers for the following cases: + r"""Lists the following: - - Offers that can be newly purchased for a customer - - Offers that can be changed to, for an entitlement. + - Offers that you can purchase for a customer. + - Offers that you can change for an entitlement. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. Args: request (google.cloud.channel_v1.types.ListPurchasableOffersRequest): The request object. Request message for ListPurchasableOffers. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2840,7 +2749,6 @@ def list_purchasable_offers( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.ListPurchasableOffersRequest. # There's no risk of modifying the input as we've already verified @@ -2879,30 +2787,29 @@ def register_subscriber( metadata: Sequence[Tuple[str, str]] = (), ) -> service.RegisterSubscriberResponse: r"""Registers a service account with subscriber privileges on the - Cloud Pub/Sub topic created for this Channel Services account. - Once you create a subscriber, you will get the events as per + 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: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being provided are different, or if - the impersonated user is not a super admin. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Topic name with service email address registered - if successful, otherwise error is returned. + Return value: The topic name with the registered service email + address. Args: request (google.cloud.channel_v1.types.RegisterSubscriberRequest): The request object. Request Message for RegisterSubscriber. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2916,7 +2823,6 @@ def register_subscriber( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.RegisterSubscriberRequest. # There's no risk of modifying the input as we've already verified @@ -2950,33 +2856,31 @@ def unregister_subscriber( ) -> service.UnregisterSubscriberResponse: r"""Unregisters a service account with subscriber privileges on the Cloud Pub/Sub topic created for this Channel Services account. - If there are no more service account left with sunbscriber - privileges, the topic will be deleted. You can check this by - calling ListSubscribers api. - - Possible Error Codes: - - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being provided are different, or if - the impersonated user is not a super admin. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the topic resource doesn't exist. + 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Topic name from which service email address has - been unregistered if successful, otherwise error is returned. If - the service email was already not associated with the topic, the - success response will be returned. + 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. Args: request (google.cloud.channel_v1.types.UnregisterSubscriberRequest): The request object. Request Message for UnregisterSubscriber. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -2990,7 +2894,6 @@ def unregister_subscriber( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.UnregisterSubscriberRequest. # There's no risk of modifying the input as we've already verified @@ -3025,26 +2928,24 @@ def list_subscribers( r"""Lists service accounts with subscriber privileges on the Cloud Pub/Sub topic created for this Channel Services account. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being provided are different, or if - the account is not a super admin. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the topic resource doesn't exist. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: List of service email addresses if successful, - otherwise error is returned. + Return value: A list of service email addresses. Args: request (google.cloud.channel_v1.types.ListSubscribersRequest): The request object. Request Message for ListSubscribers. - retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. timeout (float): The timeout for this request. @@ -3060,7 +2961,6 @@ def list_subscribers( """ # Create or coerce a protobuf request object. - # Minor optimization to avoid making a copy if the user passes # in a service.ListSubscribersRequest. # There's no risk of modifying the input as we've already verified diff --git a/google/cloud/channel_v1/services/cloud_channel_service/pagers.py b/google/cloud/channel_v1/services/cloud_channel_service/pagers.py index c1e19c6..a36fe26 100644 --- a/google/cloud/channel_v1/services/cloud_channel_service/pagers.py +++ b/google/cloud/channel_v1/services/cloud_channel_service/pagers.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # - from typing import ( Any, AsyncIterable, @@ -122,7 +120,7 @@ def __init__( *, metadata: Sequence[Tuple[str, str]] = () ): - """Instantiate the pager. + """Instantiates the pager. Args: method (Callable): The method that was originally called, and @@ -250,7 +248,7 @@ def __init__( *, metadata: Sequence[Tuple[str, str]] = () ): - """Instantiate the pager. + """Instantiates the pager. Args: method (Callable): The method that was originally called, and @@ -378,7 +376,7 @@ def __init__( *, metadata: Sequence[Tuple[str, str]] = () ): - """Instantiate the pager. + """Instantiates the pager. Args: method (Callable): The method that was originally called, and @@ -506,7 +504,7 @@ def __init__( *, metadata: Sequence[Tuple[str, str]] = () ): - """Instantiate the pager. + """Instantiates the pager. Args: method (Callable): The method that was originally called, and @@ -634,7 +632,7 @@ def __init__( *, metadata: Sequence[Tuple[str, str]] = () ): - """Instantiate the pager. + """Instantiates the pager. Args: method (Callable): The method that was originally called, and @@ -762,7 +760,7 @@ def __init__( *, metadata: Sequence[Tuple[str, str]] = () ): - """Instantiate the pager. + """Instantiates the pager. Args: method (Callable): The method that was originally called, and @@ -890,7 +888,7 @@ def __init__( *, metadata: Sequence[Tuple[str, str]] = () ): - """Instantiate the pager. + """Instantiates the pager. Args: method (Callable): The method that was originally called, and @@ -1018,7 +1016,7 @@ def __init__( *, metadata: Sequence[Tuple[str, str]] = () ): - """Instantiate the pager. + """Instantiates the pager. Args: method (Callable): The method that was originally called, and @@ -1146,7 +1144,7 @@ def __init__( *, metadata: Sequence[Tuple[str, str]] = () ): - """Instantiate the pager. + """Instantiates the pager. Args: method (Callable): The method that was originally called, and @@ -1274,7 +1272,7 @@ def __init__( *, metadata: Sequence[Tuple[str, str]] = () ): - """Instantiate the pager. + """Instantiates the pager. Args: method (Callable): The method that was originally called, and @@ -1402,7 +1400,7 @@ def __init__( *, metadata: Sequence[Tuple[str, str]] = () ): - """Instantiate the pager. + """Instantiates the pager. Args: method (Callable): The method that was originally called, and diff --git a/google/cloud/channel_v1/services/cloud_channel_service/transports/__init__.py b/google/cloud/channel_v1/services/cloud_channel_service/transports/__init__.py index 01526a4..b1dbce1 100644 --- a/google/cloud/channel_v1/services/cloud_channel_service/transports/__init__.py +++ b/google/cloud/channel_v1/services/cloud_channel_service/transports/__init__.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # - from collections import OrderedDict from typing import Dict, Type diff --git a/google/cloud/channel_v1/services/cloud_channel_service/transports/base.py b/google/cloud/channel_v1/services/cloud_channel_service/transports/base.py index eb5e22c..f6be1ad 100644 --- a/google/cloud/channel_v1/services/cloud_channel_service/transports/base.py +++ b/google/cloud/channel_v1/services/cloud_channel_service/transports/base.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,25 +13,25 @@ # See the License for the specific language governing permissions and # limitations under the License. # - import abc -import typing +from typing import Awaitable, Callable, Dict, Optional, Sequence, Union +import packaging.version import pkg_resources -from google import auth # type: ignore -from google.api_core import exceptions # type: ignore +import google.auth # type: ignore +import google.api_core # type: ignore +from google.api_core import exceptions as core_exceptions # type: ignore from google.api_core import gapic_v1 # type: ignore from google.api_core import retry as retries # type: ignore from google.api_core import operations_v1 # type: ignore -from google.auth import credentials # type: ignore +from google.auth import credentials as ga_credentials # type: ignore from google.cloud.channel_v1.types import channel_partner_links from google.cloud.channel_v1.types import customers from google.cloud.channel_v1.types import entitlements from google.cloud.channel_v1.types import service -from google.longrunning import operations_pb2 as operations # type: ignore -from google.protobuf import empty_pb2 as empty # type: ignore - +from google.longrunning import operations_pb2 # type: ignore +from google.protobuf import empty_pb2 # type: ignore try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( @@ -41,27 +40,41 @@ except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() +try: + # google.auth.__version__ was added in 1.26.0 + _GOOGLE_AUTH_VERSION = google.auth.__version__ +except AttributeError: + try: # try pkg_resources if it is available + _GOOGLE_AUTH_VERSION = pkg_resources.get_distribution("google-auth").version + except pkg_resources.DistributionNotFound: # pragma: NO COVER + _GOOGLE_AUTH_VERSION = None + +_API_CORE_VERSION = google.api_core.__version__ + class CloudChannelServiceTransport(abc.ABC): """Abstract transport class for CloudChannelService.""" AUTH_SCOPES = ("https://www.googleapis.com/auth/apps.order",) + DEFAULT_HOST: str = "cloudchannel.googleapis.com" + def __init__( self, *, - host: str = "cloudchannel.googleapis.com", - credentials: credentials.Credentials = None, - credentials_file: typing.Optional[str] = None, - scopes: typing.Optional[typing.Sequence[str]] = AUTH_SCOPES, - quota_project_id: typing.Optional[str] = None, + host: str = DEFAULT_HOST, + credentials: ga_credentials.Credentials = None, + credentials_file: Optional[str] = None, + scopes: Optional[Sequence[str]] = None, + quota_project_id: Optional[str] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, **kwargs, ) -> None: """Instantiate the transport. Args: - host (Optional[str]): The hostname to connect to. + host (Optional[str]): + The hostname to connect to. credentials (Optional[google.auth.credentials.Credentials]): The authorization credentials to attach to requests. These credentials identify the application to the service; if none @@ -70,7 +83,7 @@ def __init__( credentials_file (Optional[str]): A file with credentials that can be loaded with :func:`google.auth.load_credentials_from_file`. This argument is mutually exclusive with credentials. - scope (Optional[Sequence[str]]): A list of scopes. + scopes (Optional[Sequence[str]]): A list of scopes. quota_project_id (Optional[str]): An optional project to use for billing and quota. client_info (google.api_core.gapic_v1.client_info.ClientInfo): @@ -84,29 +97,76 @@ def __init__( host += ":443" self._host = host + scopes_kwargs = self._get_scopes_kwargs(self._host, scopes) + # Save the scopes. self._scopes = scopes or self.AUTH_SCOPES # If no credentials are provided, then determine the appropriate # defaults. if credentials and credentials_file: - raise exceptions.DuplicateCredentialArgs( + raise core_exceptions.DuplicateCredentialArgs( "'credentials_file' and 'credentials' are mutually exclusive" ) if credentials_file is not None: - credentials, _ = auth.load_credentials_from_file( - credentials_file, scopes=self._scopes, quota_project_id=quota_project_id + credentials, _ = google.auth.load_credentials_from_file( + credentials_file, **scopes_kwargs, quota_project_id=quota_project_id ) elif credentials is None: - credentials, _ = auth.default( - scopes=self._scopes, quota_project_id=quota_project_id + credentials, _ = google.auth.default( + **scopes_kwargs, quota_project_id=quota_project_id ) # Save the credentials. self._credentials = credentials + # TODO(busunkim): These two class methods are in the base transport + # to avoid duplicating code across the transport classes. These functions + # should be deleted once the minimum required versions of google-api-core + # and google-auth are increased. + + # TODO: Remove this function once google-auth >= 1.25.0 is required + @classmethod + def _get_scopes_kwargs( + cls, host: str, scopes: Optional[Sequence[str]] + ) -> Dict[str, Optional[Sequence[str]]]: + """Returns scopes kwargs to pass to google-auth methods depending on the google-auth version""" + + scopes_kwargs = {} + + if _GOOGLE_AUTH_VERSION and ( + packaging.version.parse(_GOOGLE_AUTH_VERSION) + >= packaging.version.parse("1.25.0") + ): + scopes_kwargs = {"scopes": scopes, "default_scopes": cls.AUTH_SCOPES} + else: + scopes_kwargs = {"scopes": scopes or cls.AUTH_SCOPES} + + return scopes_kwargs + + # TODO: Remove this function once google-api-core >= 1.26.0 is required + @classmethod + def _get_self_signed_jwt_kwargs( + cls, host: str, scopes: Optional[Sequence[str]] + ) -> Dict[str, Union[Optional[Sequence[str]], str]]: + """Returns kwargs to pass to grpc_helpers.create_channel depending on the google-api-core version""" + + self_signed_jwt_kwargs: Dict[str, Union[Optional[Sequence[str]], str]] = {} + + if _API_CORE_VERSION and ( + packaging.version.parse(_API_CORE_VERSION) + >= packaging.version.parse("1.26.0") + ): + self_signed_jwt_kwargs["default_scopes"] = cls.AUTH_SCOPES + self_signed_jwt_kwargs["scopes"] = scopes + self_signed_jwt_kwargs["default_host"] = cls.DEFAULT_HOST + else: + self_signed_jwt_kwargs["scopes"] = scopes or cls.AUTH_SCOPES + + return self_signed_jwt_kwargs + def _prep_wrapped_messages(self, client_info): # Precompute the wrapped methods. self._wrapped_methods = { @@ -249,32 +309,29 @@ def operations_client(self) -> operations_v1.OperationsClient: @property def list_customers( self, - ) -> typing.Callable[ + ) -> Callable[ [service.ListCustomersRequest], - typing.Union[ - service.ListCustomersResponse, - typing.Awaitable[service.ListCustomersResponse], - ], + Union[service.ListCustomersResponse, Awaitable[service.ListCustomersResponse]], ]: raise NotImplementedError() @property def get_customer( self, - ) -> typing.Callable[ + ) -> Callable[ [service.GetCustomerRequest], - typing.Union[customers.Customer, typing.Awaitable[customers.Customer]], + Union[customers.Customer, Awaitable[customers.Customer]], ]: raise NotImplementedError() @property def check_cloud_identity_accounts_exist( self, - ) -> typing.Callable[ + ) -> Callable[ [service.CheckCloudIdentityAccountsExistRequest], - typing.Union[ + Union[ service.CheckCloudIdentityAccountsExistResponse, - typing.Awaitable[service.CheckCloudIdentityAccountsExistResponse], + Awaitable[service.CheckCloudIdentityAccountsExistResponse], ], ]: raise NotImplementedError() @@ -282,47 +339,47 @@ def check_cloud_identity_accounts_exist( @property def create_customer( self, - ) -> typing.Callable[ + ) -> Callable[ [service.CreateCustomerRequest], - typing.Union[customers.Customer, typing.Awaitable[customers.Customer]], + Union[customers.Customer, Awaitable[customers.Customer]], ]: raise NotImplementedError() @property def update_customer( self, - ) -> typing.Callable[ + ) -> Callable[ [service.UpdateCustomerRequest], - typing.Union[customers.Customer, typing.Awaitable[customers.Customer]], + Union[customers.Customer, Awaitable[customers.Customer]], ]: raise NotImplementedError() @property def delete_customer( self, - ) -> typing.Callable[ + ) -> Callable[ [service.DeleteCustomerRequest], - typing.Union[empty.Empty, typing.Awaitable[empty.Empty]], + Union[empty_pb2.Empty, Awaitable[empty_pb2.Empty]], ]: raise NotImplementedError() @property def provision_cloud_identity( self, - ) -> typing.Callable[ + ) -> Callable[ [service.ProvisionCloudIdentityRequest], - typing.Union[operations.Operation, typing.Awaitable[operations.Operation]], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], ]: raise NotImplementedError() @property def list_entitlements( self, - ) -> typing.Callable[ + ) -> Callable[ [service.ListEntitlementsRequest], - typing.Union[ + Union[ service.ListEntitlementsResponse, - typing.Awaitable[service.ListEntitlementsResponse], + Awaitable[service.ListEntitlementsResponse], ], ]: raise NotImplementedError() @@ -330,11 +387,11 @@ def list_entitlements( @property def list_transferable_skus( self, - ) -> typing.Callable[ + ) -> Callable[ [service.ListTransferableSkusRequest], - typing.Union[ + Union[ service.ListTransferableSkusResponse, - typing.Awaitable[service.ListTransferableSkusResponse], + Awaitable[service.ListTransferableSkusResponse], ], ]: raise NotImplementedError() @@ -342,11 +399,11 @@ def list_transferable_skus( @property def list_transferable_offers( self, - ) -> typing.Callable[ + ) -> Callable[ [service.ListTransferableOffersRequest], - typing.Union[ + Union[ service.ListTransferableOffersResponse, - typing.Awaitable[service.ListTransferableOffersResponse], + Awaitable[service.ListTransferableOffersResponse], ], ]: raise NotImplementedError() @@ -354,112 +411,110 @@ def list_transferable_offers( @property def get_entitlement( self, - ) -> typing.Callable[ + ) -> Callable[ [service.GetEntitlementRequest], - typing.Union[ - entitlements.Entitlement, typing.Awaitable[entitlements.Entitlement] - ], + Union[entitlements.Entitlement, Awaitable[entitlements.Entitlement]], ]: raise NotImplementedError() @property def create_entitlement( self, - ) -> typing.Callable[ + ) -> Callable[ [service.CreateEntitlementRequest], - typing.Union[operations.Operation, typing.Awaitable[operations.Operation]], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], ]: raise NotImplementedError() @property def change_parameters( self, - ) -> typing.Callable[ + ) -> Callable[ [service.ChangeParametersRequest], - typing.Union[operations.Operation, typing.Awaitable[operations.Operation]], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], ]: raise NotImplementedError() @property def change_renewal_settings( self, - ) -> typing.Callable[ + ) -> Callable[ [service.ChangeRenewalSettingsRequest], - typing.Union[operations.Operation, typing.Awaitable[operations.Operation]], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], ]: raise NotImplementedError() @property def change_offer( self, - ) -> typing.Callable[ + ) -> Callable[ [service.ChangeOfferRequest], - typing.Union[operations.Operation, typing.Awaitable[operations.Operation]], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], ]: raise NotImplementedError() @property def start_paid_service( self, - ) -> typing.Callable[ + ) -> Callable[ [service.StartPaidServiceRequest], - typing.Union[operations.Operation, typing.Awaitable[operations.Operation]], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], ]: raise NotImplementedError() @property def suspend_entitlement( self, - ) -> typing.Callable[ + ) -> Callable[ [service.SuspendEntitlementRequest], - typing.Union[operations.Operation, typing.Awaitable[operations.Operation]], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], ]: raise NotImplementedError() @property def cancel_entitlement( self, - ) -> typing.Callable[ + ) -> Callable[ [service.CancelEntitlementRequest], - typing.Union[operations.Operation, typing.Awaitable[operations.Operation]], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], ]: raise NotImplementedError() @property def activate_entitlement( self, - ) -> typing.Callable[ + ) -> Callable[ [service.ActivateEntitlementRequest], - typing.Union[operations.Operation, typing.Awaitable[operations.Operation]], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], ]: raise NotImplementedError() @property def transfer_entitlements( self, - ) -> typing.Callable[ + ) -> Callable[ [service.TransferEntitlementsRequest], - typing.Union[operations.Operation, typing.Awaitable[operations.Operation]], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], ]: raise NotImplementedError() @property def transfer_entitlements_to_google( self, - ) -> typing.Callable[ + ) -> Callable[ [service.TransferEntitlementsToGoogleRequest], - typing.Union[operations.Operation, typing.Awaitable[operations.Operation]], + Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]], ]: raise NotImplementedError() @property def list_channel_partner_links( self, - ) -> typing.Callable[ + ) -> Callable[ [service.ListChannelPartnerLinksRequest], - typing.Union[ + Union[ service.ListChannelPartnerLinksResponse, - typing.Awaitable[service.ListChannelPartnerLinksResponse], + Awaitable[service.ListChannelPartnerLinksResponse], ], ]: raise NotImplementedError() @@ -467,11 +522,11 @@ def list_channel_partner_links( @property def get_channel_partner_link( self, - ) -> typing.Callable[ + ) -> Callable[ [service.GetChannelPartnerLinkRequest], - typing.Union[ + Union[ channel_partner_links.ChannelPartnerLink, - typing.Awaitable[channel_partner_links.ChannelPartnerLink], + Awaitable[channel_partner_links.ChannelPartnerLink], ], ]: raise NotImplementedError() @@ -479,11 +534,11 @@ def get_channel_partner_link( @property def create_channel_partner_link( self, - ) -> typing.Callable[ + ) -> Callable[ [service.CreateChannelPartnerLinkRequest], - typing.Union[ + Union[ channel_partner_links.ChannelPartnerLink, - typing.Awaitable[channel_partner_links.ChannelPartnerLink], + Awaitable[channel_partner_links.ChannelPartnerLink], ], ]: raise NotImplementedError() @@ -491,11 +546,11 @@ def create_channel_partner_link( @property def update_channel_partner_link( self, - ) -> typing.Callable[ + ) -> Callable[ [service.UpdateChannelPartnerLinkRequest], - typing.Union[ + Union[ channel_partner_links.ChannelPartnerLink, - typing.Awaitable[channel_partner_links.ChannelPartnerLink], + Awaitable[channel_partner_links.ChannelPartnerLink], ], ]: raise NotImplementedError() @@ -503,44 +558,38 @@ def update_channel_partner_link( @property def list_products( self, - ) -> typing.Callable[ + ) -> Callable[ [service.ListProductsRequest], - typing.Union[ - service.ListProductsResponse, typing.Awaitable[service.ListProductsResponse] - ], + Union[service.ListProductsResponse, Awaitable[service.ListProductsResponse]], ]: raise NotImplementedError() @property def list_skus( self, - ) -> typing.Callable[ + ) -> Callable[ [service.ListSkusRequest], - typing.Union[ - service.ListSkusResponse, typing.Awaitable[service.ListSkusResponse] - ], + Union[service.ListSkusResponse, Awaitable[service.ListSkusResponse]], ]: raise NotImplementedError() @property def list_offers( self, - ) -> typing.Callable[ + ) -> Callable[ [service.ListOffersRequest], - typing.Union[ - service.ListOffersResponse, typing.Awaitable[service.ListOffersResponse] - ], + Union[service.ListOffersResponse, Awaitable[service.ListOffersResponse]], ]: raise NotImplementedError() @property def list_purchasable_skus( self, - ) -> typing.Callable[ + ) -> Callable[ [service.ListPurchasableSkusRequest], - typing.Union[ + Union[ service.ListPurchasableSkusResponse, - typing.Awaitable[service.ListPurchasableSkusResponse], + Awaitable[service.ListPurchasableSkusResponse], ], ]: raise NotImplementedError() @@ -548,11 +597,11 @@ def list_purchasable_skus( @property def list_purchasable_offers( self, - ) -> typing.Callable[ + ) -> Callable[ [service.ListPurchasableOffersRequest], - typing.Union[ + Union[ service.ListPurchasableOffersResponse, - typing.Awaitable[service.ListPurchasableOffersResponse], + Awaitable[service.ListPurchasableOffersResponse], ], ]: raise NotImplementedError() @@ -560,11 +609,11 @@ def list_purchasable_offers( @property def register_subscriber( self, - ) -> typing.Callable[ + ) -> Callable[ [service.RegisterSubscriberRequest], - typing.Union[ + Union[ service.RegisterSubscriberResponse, - typing.Awaitable[service.RegisterSubscriberResponse], + Awaitable[service.RegisterSubscriberResponse], ], ]: raise NotImplementedError() @@ -572,11 +621,11 @@ def register_subscriber( @property def unregister_subscriber( self, - ) -> typing.Callable[ + ) -> Callable[ [service.UnregisterSubscriberRequest], - typing.Union[ + Union[ service.UnregisterSubscriberResponse, - typing.Awaitable[service.UnregisterSubscriberResponse], + Awaitable[service.UnregisterSubscriberResponse], ], ]: raise NotImplementedError() @@ -584,11 +633,10 @@ def unregister_subscriber( @property def list_subscribers( self, - ) -> typing.Callable[ + ) -> Callable[ [service.ListSubscribersRequest], - typing.Union[ - service.ListSubscribersResponse, - typing.Awaitable[service.ListSubscribersResponse], + Union[ + service.ListSubscribersResponse, Awaitable[service.ListSubscribersResponse] ], ]: raise NotImplementedError() diff --git a/google/cloud/channel_v1/services/cloud_channel_service/transports/grpc.py b/google/cloud/channel_v1/services/cloud_channel_service/transports/grpc.py index 34e8a20..6086b58 100644 --- a/google/cloud/channel_v1/services/cloud_channel_service/transports/grpc.py +++ b/google/cloud/channel_v1/services/cloud_channel_service/transports/grpc.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,15 +13,14 @@ # See the License for the specific language governing permissions and # limitations under the License. # - import warnings -from typing import Callable, Dict, Optional, Sequence, Tuple +from typing import Callable, Dict, Optional, Sequence, Tuple, Union from google.api_core import grpc_helpers # type: ignore from google.api_core import operations_v1 # type: ignore from google.api_core import gapic_v1 # type: ignore -from google import auth # type: ignore -from google.auth import credentials # type: ignore +import google.auth # type: ignore +from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore import grpc # type: ignore @@ -31,44 +29,37 @@ from google.cloud.channel_v1.types import customers from google.cloud.channel_v1.types import entitlements from google.cloud.channel_v1.types import service -from google.longrunning import operations_pb2 as operations # type: ignore -from google.protobuf import empty_pb2 as empty # type: ignore - +from google.longrunning import operations_pb2 # type: ignore +from google.protobuf import empty_pb2 # type: ignore from .base import CloudChannelServiceTransport, DEFAULT_CLIENT_INFO class CloudChannelServiceGrpcTransport(CloudChannelServiceTransport): """gRPC backend transport for CloudChannelService. - CloudChannelService enables Google cloud resellers and distributors - to manage their customers, channel partners, entitlements and - reports. + CloudChannelService lets Google cloud resellers and distributors + manage their customers, channel partners, entitlements, and reports. Using this service: - 1. Resellers or distributors can manage a customer entity. + 1. Resellers and distributors can manage a customer entity. 2. Distributors can register an authorized reseller in their channel - and then enable delegated admin access for the reseller. - 3. Resellers or distributors can manage entitlements for their - customers. + and provide them with delegated admin access. + 3. Resellers and distributors can manage customer entitlements. - The service primarily exposes the following resources: + CloudChannelService exposes the following resources: - - [Customer][google.cloud.channel.v1.Customer]s: A Customer - represents an entity managed by a reseller or distributor. A - customer typically represents an enterprise. In an n-tier resale - channel hierarchy, customers are generally represented as leaf - nodes. Customers primarily have an Entitlement sub-resource - discussed below. + - [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 - Entitlement represents an entity which provides a customer means - to start using 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: - A ChannelPartnerLink is an entity that identifies links between - distributors and their indirect resellers in a channel. + An entity that identifies links between distributors and their + indirect resellers in a channel. This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -84,7 +75,7 @@ def __init__( self, *, host: str = "cloudchannel.googleapis.com", - credentials: credentials.Credentials = None, + credentials: ga_credentials.Credentials = None, credentials_file: str = None, scopes: Sequence[str] = None, channel: grpc.Channel = None, @@ -98,7 +89,8 @@ def __init__( """Instantiate the transport. Args: - host (Optional[str]): The hostname to connect to. + host (Optional[str]): + The hostname to connect to. credentials (Optional[google.auth.credentials.Credentials]): The authorization credentials to attach to requests. These credentials identify the application to the service; if none @@ -209,7 +201,7 @@ def __init__( def create_channel( cls, host: str = "cloudchannel.googleapis.com", - credentials: credentials.Credentials = None, + credentials: ga_credentials.Credentials = None, credentials_file: str = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -240,13 +232,15 @@ def create_channel( google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials`` and ``credentials_file`` are passed. """ - scopes = scopes or cls.AUTH_SCOPES + + self_signed_jwt_kwargs = cls._get_self_signed_jwt_kwargs(host, scopes) + return grpc_helpers.create_channel( host, credentials=credentials, credentials_file=credentials_file, - scopes=scopes, quota_project_id=quota_project_id, + **self_signed_jwt_kwargs, **kwargs, ) @@ -276,18 +270,18 @@ def list_customers( ) -> Callable[[service.ListCustomersRequest], service.ListCustomersResponse]: r"""Return a callable for the list customers method over gRPC. - List downstream [Customer][google.cloud.channel.v1.Customer]s. + List [Customer][google.cloud.channel.v1.Customer]s. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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 pertaining to the - reseller or empty list if there are none. + Return value: List of + [Customer][google.cloud.channel.v1.Customer]s, or an empty list + if there are no customers. Returns: Callable[[~.ListCustomersRequest], @@ -316,17 +310,17 @@ def get_customer( Returns a requested [Customer][google.cloud.channel.v1.Customer] resource. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the customer resource doesn't exist. Usually - the result of an invalid name parameter. + - 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: [Customer][google.cloud.channel.v1.Customer] - resource if found, error otherwise. + Return value: The [Customer][google.cloud.channel.v1.Customer] + resource. Returns: Callable[[~.GetCustomerRequest], @@ -356,24 +350,24 @@ def check_cloud_identity_accounts_exist( r"""Return a callable for the check cloud identity accounts exist method over gRPC. - Confirms the existence of Cloud Identity accounts, based on the - domain and whether the Cloud Identity accounts are owned by the + 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: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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: List of + Return value: A list of [CloudIdentityCustomerAccount][google.cloud.channel.v1.CloudIdentityCustomerAccount] - resources for the domain. List may be empty. + resources for the domain (may be empty) - Note: in the v1alpha1 version of the API, a NOT_FOUND error is - returned if no + 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. @@ -406,19 +400,17 @@ def create_customer( Creates a new [Customer][google.cloud.channel.v1.Customer] resource under the reseller or distributor account. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: It can happen in following scenarios - + - PERMISSION_DENIED: The reseller account making the request is + different from the reseller account in the API request. + - INVALID_ARGUMENT: - - Missing or invalid required parameters in the request. - - Domain field value doesn't match the domain specified in - primary email. + - Required request parameters are missing or invalid. + - Domain field value doesn't match the primary email domain. - Return Value: If successful, the newly created - [Customer][google.cloud.channel.v1.Customer] resource, otherwise - returns an error. + Return value: The newly created + [Customer][google.cloud.channel.v1.Customer] resource. Returns: Callable[[~.CreateCustomerRequest], @@ -445,20 +437,19 @@ def update_customer( r"""Return a callable for the update customer method over gRPC. Updates an existing [Customer][google.cloud.channel.v1.Customer] - resource belonging to the reseller or distributor. + resource for the reseller or distributor. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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 specified in the request. + resource found for the name in the request. - Return Value: If successful, the updated - [Customer][google.cloud.channel.v1.Customer] resource, otherwise - returns an error. + Return value: The updated + [Customer][google.cloud.channel.v1.Customer] resource. Returns: Callable[[~.UpdateCustomerRequest], @@ -479,22 +470,23 @@ def update_customer( return self._stubs["update_customer"] @property - def delete_customer(self) -> Callable[[service.DeleteCustomerRequest], empty.Empty]: + def delete_customer( + self, + ) -> Callable[[service.DeleteCustomerRequest], empty_pb2.Empty]: r"""Return a callable for the delete customer method over gRPC. Deletes the given [Customer][google.cloud.channel.v1.Customer] permanently and irreversibly. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the account making the request does not + - PERMISSION_DENIED: The account making the request does not own this customer. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - FAILED_PRECONDITION: If the customer has existing - entitlements. + - 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 specified in the request. + resource found for the name in the request. Returns: Callable[[~.DeleteCustomerRequest], @@ -510,40 +502,38 @@ def delete_customer(self) -> Callable[[service.DeleteCustomerRequest], empty.Emp self._stubs["delete_customer"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/DeleteCustomer", request_serializer=service.DeleteCustomerRequest.serialize, - response_deserializer=empty.Empty.FromString, + response_deserializer=empty_pb2.Empty.FromString, ) return self._stubs["delete_customer"] @property def provision_cloud_identity( self, - ) -> Callable[[service.ProvisionCloudIdentityRequest], operations.Operation]: + ) -> Callable[[service.ProvisionCloudIdentityRequest], operations_pb2.Operation]: r"""Return a callable for the provision cloud identity method over gRPC. Creates a Cloud Identity for the given customer using the - customer's information or the information provided here, if - present. + customer's information, or the information provided here. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the customer is not found for the reseller. - - ALREADY_EXISTS: If the customer's primary email already - exists. In this case, retry after changing the customer's - primary contact email. + - 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 in this case. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. Contact Cloud Channel support in this case. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 + contains an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. Returns: @@ -560,7 +550,7 @@ def provision_cloud_identity( self._stubs["provision_cloud_identity"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/ProvisionCloudIdentity", request_serializer=service.ProvisionCloudIdentityRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["provision_cloud_identity"] @@ -570,19 +560,18 @@ def list_entitlements( ) -> Callable[[service.ListEntitlementsRequest], service.ListEntitlementsResponse]: r"""Return a callable for the list entitlements method over gRPC. - List [Entitlement][google.cloud.channel.v1.Entitlement]s + Lists [Entitlement][google.cloud.channel.v1.Entitlement]s belonging to a customer. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. - Return Value: List of - [Entitlement][google.cloud.channel.v1.Entitlement]s belonging to - the customer, or empty list if there are none. + Return value: A list of the customer's + [Entitlement][google.cloud.channel.v1.Entitlement]s. Returns: Callable[[~.ListEntitlementsRequest], @@ -611,29 +600,28 @@ def list_transferable_skus( r"""Return a callable for the list transferable skus method over gRPC. List [TransferableSku][google.cloud.channel.v1.TransferableSku]s - of a customer based on Cloud Identity ID or Customer Name in the - request. + of a customer based on the Cloud Identity ID or Customer Name in + the request. - This method is used when a reseller lists the entitlements - information of a customer that is not owned. The reseller should - provide the customer's Cloud Identity ID or Customer Name. + 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: + Possible error codes: - - PERMISSION_DENIED: Appears because of one of the following - + - PERMISSION_DENIED: - - The customer doesn't belong to the reseller and no auth - token. + - 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 and the queries - reseller account are different. + - The reseller account making the request is different from + the reseller account in the query. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. - Return Value: List of - [TransferableSku][google.cloud.channel.v1.TransferableSku] for - the given customer. + Return value: A list of the customer's + [TransferableSku][google.cloud.channel.v1.TransferableSku]. Returns: Callable[[~.ListTransferableSkusRequest], @@ -666,23 +654,24 @@ def list_transferable_offers( of a customer based on Cloud Identity ID or Customer Name in the request. - This method is used when a reseller gets the entitlement - information of a customer that is not owned. The reseller should - provide the customer's Cloud Identity ID or Customer Name. + 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: + Possible error codes: - - PERMISSION_DENIED: Appears because of one of the following: + - PERMISSION_DENIED: - - If the customer doesn't belong to the reseller and no auth - token or invalid auth token is supplied. - - If the reseller account making the request and the - reseller account being queried for are different. + - 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: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. - Return Value: List of + Return value: List of [TransferableOffer][google.cloud.channel.v1.TransferableOffer] for the given customer and SKU. @@ -713,17 +702,16 @@ def get_entitlement( Returns a requested [Entitlement][google.cloud.channel.v1.Entitlement] resource. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the entitlement is not found for the customer. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. + - NOT_FOUND: The customer entitlement was not found. - Return Value: If found, the requested - [Entitlement][google.cloud.channel.v1.Entitlement] resource, - otherwise returns an error. + Return value: The requested + [Entitlement][google.cloud.channel.v1.Entitlement] resource. Returns: Callable[[~.GetEntitlementRequest], @@ -746,56 +734,49 @@ def get_entitlement( @property def create_entitlement( self, - ) -> Callable[[service.CreateEntitlementRequest], operations.Operation]: + ) -> Callable[[service.CreateEntitlementRequest], operations_pb2.Operation]: r"""Return a callable for the create entitlement method over gRPC. Creates an entitlement for a customer. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: It can happen in below scenarios - - - - Missing or invalid required parameters in the request. - - Cannot purchase an entitlement if there is already an - entitlement for customer, for a SKU from the same product - family. - - INVALID_VALUE: Offer passed in isn't valid. Make sure - OfferId is valid. If it is valid, then contact Google - Channel support for further troubleshooting. - - - NOT_FOUND: If the customer or offer resource is not found for - the reseller. - - ALREADY_EXISTS: This failure can happen in the following - cases: - - - If the SKU has been already purchased for the customer. - - If the customer's primary email already exists. In this - case retry after changing the customer's primary contact - email. - - - CONDITION_NOT_MET or FAILED_PRECONDITION: This failure can - happen in the following cases: - - - Purchasing a SKU that requires domain verification and the - domain has not been verified. - - Purchasing an Add-On SKU like Vault or Drive without - purchasing the pre-requisite SKU, such as Google Workspace - Business Starter. - - Applicable only for developer accounts: reseller and - resold domain. Must meet the following domain naming - requirements: + - 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. - - Resold domain names must include the reseller domain. + - Domain names must include the reseller domain. - INTERNAL: Any non-user error related to a technical issue in - the backend. Contact Cloud Channel Support in this case. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. Contact Cloud Channel Support in this case. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -816,38 +797,36 @@ def create_entitlement( self._stubs["create_entitlement"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/CreateEntitlement", request_serializer=service.CreateEntitlementRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["create_entitlement"] @property def change_parameters( self, - ) -> Callable[[service.ChangeParametersRequest], operations.Operation]: + ) -> Callable[[service.ChangeParametersRequest], operations_pb2.Operation]: r"""Return a callable for the change parameters method over gRPC. - Change parameters of the entitlement + Change parameters of the entitlement. - An entitlement parameters update is a long-running operation and - results in updates to the entitlement as a result of - fulfillment. + An entitlement update is a long-running operation and it updates + the entitlement as a result of fulfillment. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. For example, if the number of seats being - changed to is greater than the allowed number of max seats - for the resource. Or decreasing seats for a commitment based - plan. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -868,38 +847,38 @@ def change_parameters( self._stubs["change_parameters"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/ChangeParameters", request_serializer=service.ChangeParametersRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["change_parameters"] @property def change_renewal_settings( self, - ) -> Callable[[service.ChangeRenewalSettingsRequest], operations.Operation]: + ) -> Callable[[service.ChangeRenewalSettingsRequest], operations_pb2.Operation]: r"""Return a callable for the change renewal settings method over gRPC. Updates the renewal settings for an existing customer entitlement. - An entitlement update is a long-running operation and results in - updates to the entitlement as a result of fulfillment. + An entitlement update is a long-running operation and it updates + the entitlement as a result of fulfillment. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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 renewal 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. In this case, contact Cloud Channel support. - - UNKNOWN: Any non user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + - 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: Long Running Operation ID. + 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 @@ -920,34 +899,34 @@ def change_renewal_settings( self._stubs["change_renewal_settings"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/ChangeRenewalSettings", request_serializer=service.ChangeRenewalSettingsRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["change_renewal_settings"] @property def change_offer( self, - ) -> Callable[[service.ChangeOfferRequest], operations.Operation]: + ) -> Callable[[service.ChangeOfferRequest], operations_pb2.Operation]: r"""Return a callable for the change offer method over gRPC. Updates the Offer for an existing customer entitlement. - An entitlement update is a long-running operation and results in - updates to the entitlement as a result of fulfillment. + An entitlement update is a long-running operation and it updates + the entitlement as a result of fulfillment. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -968,37 +947,37 @@ def change_offer( self._stubs["change_offer"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/ChangeOffer", request_serializer=service.ChangeOfferRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["change_offer"] @property def start_paid_service( self, - ) -> Callable[[service.StartPaidServiceRequest], operations.Operation]: + ) -> Callable[[service.StartPaidServiceRequest], operations_pb2.Operation]: r"""Return a callable for the start paid service method over gRPC. Starts paid service for a trial entitlement. Starts paid service for a trial entitlement immediately. This - method is only applicable if a plan has already been set up for - a trial entitlement but has some trial days remaining. + method is only applicable if a plan is set up for a trial + entitlement but has some trial days remaining. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1019,33 +998,34 @@ def start_paid_service( self._stubs["start_paid_service"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/StartPaidService", request_serializer=service.StartPaidServiceRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["start_paid_service"] @property def suspend_entitlement( self, - ) -> Callable[[service.SuspendEntitlementRequest], operations.Operation]: + ) -> Callable[[service.SuspendEntitlementRequest], operations_pb2.Operation]: r"""Return a callable for the suspend entitlement method over gRPC. - Suspends a previously fulfilled entitlement. An entitlement - suspension is a long-running operation. + Suspends a previously fulfilled entitlement. - Possible Error Codes: + An entitlement suspension is a long-running operation. - - PERMISSION_DENIED: If the customer doesn't belong to the + Possible error codes: + + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1066,39 +1046,38 @@ def suspend_entitlement( self._stubs["suspend_entitlement"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/SuspendEntitlement", request_serializer=service.SuspendEntitlementRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["suspend_entitlement"] @property def cancel_entitlement( self, - ) -> Callable[[service.CancelEntitlementRequest], operations.Operation]: + ) -> Callable[[service.CancelEntitlementRequest], operations_pb2.Operation]: r"""Return a callable for the cancel entitlement method over gRPC. - Cancels a previously fulfilled entitlement. An entitlement - cancellation is a long-running operation. + Cancels a previously fulfilled entitlement. + + An entitlement cancellation is a long-running operation. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the - reseller or if the reseller account making the request and - reseller account being queried for are different. - - FAILED_PRECONDITION: If there are any Google Cloud projects - linked to the Google Cloud entitlement's Cloud Billing - subaccount. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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 + Workspace add-ons, or entitlements for Google Cloud's development platform. - INTERNAL: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1120,42 +1099,41 @@ def cancel_entitlement( self._stubs["cancel_entitlement"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/CancelEntitlement", request_serializer=service.CancelEntitlementRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["cancel_entitlement"] @property def activate_entitlement( self, - ) -> Callable[[service.ActivateEntitlementRequest], operations.Operation]: + ) -> Callable[[service.ActivateEntitlementRequest], operations_pb2.Operation]: r"""Return a callable for the activate entitlement method over gRPC. - Activates a previously suspended entitlement. The entitlement - must be in a suspended state for it to be activated. - Entitlements suspended for pending ToS acceptance can't be - activated using this method. An entitlement activation is a - long-running operation and can result in updates to the state of - the customer entitlement. + Activates a previously suspended entitlement. Entitlements + suspended for pending ToS acceptance can't be activated using + this method. - Possible Error Codes: + An entitlement activation is a long-running operation and it + updates the state of the customer entitlement. - - PERMISSION_DENIED: If the customer doesn't belong to the - reseller or if the reseller account making the request and - reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + 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't activate an - entitlement that is pending TOS acceptance. Only reseller - initiated suspensions can be activated. - - NOT_SUSPENDED: Can't activate entitlements that are already - in ACTIVE state. Can only activate suspended entitlements. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1176,52 +1154,47 @@ def activate_entitlement( self._stubs["activate_entitlement"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/ActivateEntitlement", request_serializer=service.ActivateEntitlementRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["activate_entitlement"] @property def transfer_entitlements( self, - ) -> Callable[[service.TransferEntitlementsRequest], operations.Operation]: + ) -> Callable[[service.TransferEntitlementsRequest], operations_pb2.Operation]: r"""Return a callable for the transfer entitlements method over gRPC. Transfers customer entitlements to new reseller. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the customer or offer resource is not found for - the reseller. - - ALREADY_EXISTS: If the SKU has been already transferred for - the customer. - - CONDITION_NOT_MET or FAILED_PRECONDITION: This failure can - happen in the following cases: - - - Transferring a SKU that requires domain verification and - the domain has not been verified. - - Transferring an Add-On SKU like Vault or Drive without - transferring the pre-requisite SKU, such as G Suite Basic. - - Applicable only for developer accounts: reseller and - resold domain must follow the domain naming convention as - follows: + - 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. - - Resold domain names must include the reseller domain. + - Domain names must include the reseller domain. - - All transferring entitlements must be specified. + - Specify all transferring entitlements. - INTERNAL: Any non-user error related to a technical issue in - the backend. Please contact Cloud Channel Support in this - case. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. Please contact Cloud Channel Support in this - case. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1242,51 +1215,49 @@ def transfer_entitlements( self._stubs["transfer_entitlements"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/TransferEntitlements", request_serializer=service.TransferEntitlementsRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["transfer_entitlements"] @property def transfer_entitlements_to_google( self, - ) -> Callable[[service.TransferEntitlementsToGoogleRequest], operations.Operation]: + ) -> Callable[ + [service.TransferEntitlementsToGoogleRequest], operations_pb2.Operation + ]: r"""Return a callable for the transfer entitlements to google method over gRPC. - Transfers customer entitlements from current reseller to Google. + Transfers customer entitlements from their current reseller to + Google. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the customer or offer resource is not found for - the reseller. - - ALREADY_EXISTS: If the SKU has been already transferred for - the customer. - - CONDITION_NOT_MET or FAILED_PRECONDITION: This failure can - happen in the following cases: - - - Transferring a SKU that requires domain verification and - the domain has not been verified. - - Transferring an Add-On SKU like Vault or Drive without - purchasing the pre-requisite SKU, such as G Suite Basic. - - Applicable only for developer accounts: reseller and - resold domain must follow the domain naming convention as - follows: + - 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. - - Resold domain names must include the reseller domain. + - Domain names must include the reseller domain. - INTERNAL: Any non-user error related to a technical issue in - the backend. Please contact Cloud Channel Support in this - case. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. Please contact Cloud Channel Support in this - case. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1310,7 +1281,7 @@ def transfer_entitlements_to_google( ] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/TransferEntitlementsToGoogle", request_serializer=service.TransferEntitlementsToGoogleRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["transfer_entitlements_to_google"] @@ -1325,20 +1296,19 @@ def list_channel_partner_links( List [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink]s - belonging to a distributor. To call this method, you must be a - distributor. + belonging to a distributor. You must be a distributor to call + this method. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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: If successful, returns the list of + Return value: The list of the distributor account's [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] - resources for the distributor account, otherwise returns an - error. + resources. Returns: Callable[[~.ListChannelPartnerLinksRequest], @@ -1368,20 +1338,20 @@ def get_channel_partner_link( Returns a requested [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] - resource. To call this method, you must be a distributor. + resource. You must be a distributor to call this method. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: ChannelPartnerLink resource not found. Results due - invalid channel partner link name. + - 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: + Return value: The [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] - resource if found, otherwise returns an error. + resource. Returns: Callable[[~.GetChannelPartnerLinkRequest], @@ -1411,30 +1381,30 @@ def create_channel_partner_link( r"""Return a callable for the create channel partner link method over gRPC. Initiates a channel partner link between a distributor and a - reseller or between resellers in an n-tier reseller channel. To - accept the invite, the invited partner should follow the - invite_link_uri provided in the response. If the link creation - is accepted, a valid link is set up between the two involved - parties. To call this method, you must be a distributor. - - Possible Error Codes: - - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - ALREADY_EXISTS: If the ChannelPartnerLink sent in the request + 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: If no Cloud Identity customer exists for domain - provided. + - NOT_FOUND: No Cloud Identity customer exists for provided + domain. - INTERNAL: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Newly created + Return value: The new [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] - resource if successful, otherwise error is returned. + resource. Returns: Callable[[~.CreateChannelPartnerLinkRequest], @@ -1463,30 +1433,31 @@ def update_channel_partner_link( ]: r"""Return a callable for the update channel partner link method over gRPC. - Updates a channel partner link. A distributor calls this method - to change a link's status. For example, suspend a partner link. - To call this method, you must be a distributor. + 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: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: It can happen in following scenarios - + - PERMISSION_DENIED: The reseller account making the request is + different from the reseller account in the API request. + - INVALID_ARGUMENT: - - Missing or invalid required parameters in the request. - - Updating link state from invited to active or suspended. - - Sending reseller_cloud_identity_id, invite_url or name in - update mask. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: If successful, the updated + Return value: The updated [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] - resource, otherwise returns an error. + resource. Returns: Callable[[~.UpdateChannelPartnerLinkRequest], @@ -1514,10 +1485,10 @@ def list_products( Lists the Products the reseller is authorized to sell. - Possible Error Codes: + Possible error codes: - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. Returns: Callable[[~.ListProductsRequest], @@ -1545,10 +1516,10 @@ def list_skus( Lists the SKUs for a product the reseller is authorized to sell. - Possible Error Codes: + Possible error codes: - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. Returns: Callable[[~.ListSkusRequest], @@ -1576,10 +1547,10 @@ def list_offers( Lists the Offers the reseller can sell. - Possible Error Codes: + Possible error codes: - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. Returns: Callable[[~.ListOffersRequest], @@ -1607,17 +1578,17 @@ def list_purchasable_skus( ]: r"""Return a callable for the list purchasable skus method over gRPC. - Lists the Purchasable SKUs for following cases: + Lists the following: - - SKUs that can be newly purchased for a customer - - SKUs that can be upgraded/downgraded to, for an entitlement. + - SKUs that you can purchase for a customer + - SKUs that you can upgrade or downgrade for an entitlement. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the - reseller - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - PERMISSION_DENIED: The customer doesn't belong to the + reseller. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. Returns: Callable[[~.ListPurchasableSkusRequest], @@ -1645,17 +1616,17 @@ def list_purchasable_offers( ]: r"""Return a callable for the list purchasable offers method over gRPC. - Lists the Purchasable Offers for the following cases: + Lists the following: - - Offers that can be newly purchased for a customer - - Offers that can be changed to, for an entitlement. + - Offers that you can purchase for a customer. + - Offers that you can change for an entitlement. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. Returns: Callable[[~.ListPurchasableOffersRequest], @@ -1684,24 +1655,24 @@ def register_subscriber( r"""Return a callable for the register subscriber method over gRPC. Registers a service account with subscriber privileges on the - Cloud Pub/Sub topic created for this Channel Services account. - Once you create a subscriber, you will get the events as per + 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: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being provided are different, or if - the impersonated user is not a super admin. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Topic name with service email address registered - if successful, otherwise error is returned. + Return value: The topic name with the registered service email + address. Returns: Callable[[~.RegisterSubscriberRequest], @@ -1731,27 +1702,26 @@ def unregister_subscriber( Unregisters a service account with subscriber privileges on the Cloud Pub/Sub topic created for this Channel Services account. - If there are no more service account left with sunbscriber - privileges, the topic will be deleted. You can check this by - calling ListSubscribers api. - - Possible Error Codes: - - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being provided are different, or if - the impersonated user is not a super admin. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the topic resource doesn't exist. + 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Topic name from which service email address has - been unregistered if successful, otherwise error is returned. If - the service email was already not associated with the topic, the - success response will be returned. + 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. Returns: Callable[[~.UnregisterSubscriberRequest], @@ -1780,21 +1750,20 @@ def list_subscribers( Lists service accounts with subscriber privileges on the Cloud Pub/Sub topic created for this Channel Services account. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being provided are different, or if - the account is not a super admin. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the topic resource doesn't exist. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: List of service email addresses if successful, - otherwise error is returned. + Return value: A list of service email addresses. Returns: Callable[[~.ListSubscribersRequest], diff --git a/google/cloud/channel_v1/services/cloud_channel_service/transports/grpc_asyncio.py b/google/cloud/channel_v1/services/cloud_channel_service/transports/grpc_asyncio.py index b086617..0e6c514 100644 --- a/google/cloud/channel_v1/services/cloud_channel_service/transports/grpc_asyncio.py +++ b/google/cloud/channel_v1/services/cloud_channel_service/transports/grpc_asyncio.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,16 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # - import warnings -from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple +from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union from google.api_core import gapic_v1 # type: ignore from google.api_core import grpc_helpers_async # type: ignore from google.api_core import operations_v1 # type: ignore -from google import auth # type: ignore -from google.auth import credentials # type: ignore +from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore +import packaging.version import grpc # type: ignore from grpc.experimental import aio # type: ignore @@ -32,9 +30,8 @@ from google.cloud.channel_v1.types import customers from google.cloud.channel_v1.types import entitlements from google.cloud.channel_v1.types import service -from google.longrunning import operations_pb2 as operations # type: ignore -from google.protobuf import empty_pb2 as empty # type: ignore - +from google.longrunning import operations_pb2 # type: ignore +from google.protobuf import empty_pb2 # type: ignore from .base import CloudChannelServiceTransport, DEFAULT_CLIENT_INFO from .grpc import CloudChannelServiceGrpcTransport @@ -42,35 +39,29 @@ class CloudChannelServiceGrpcAsyncIOTransport(CloudChannelServiceTransport): """gRPC AsyncIO backend transport for CloudChannelService. - CloudChannelService enables Google cloud resellers and distributors - to manage their customers, channel partners, entitlements and - reports. + CloudChannelService lets Google cloud resellers and distributors + manage their customers, channel partners, entitlements, and reports. Using this service: - 1. Resellers or distributors can manage a customer entity. + 1. Resellers and distributors can manage a customer entity. 2. Distributors can register an authorized reseller in their channel - and then enable delegated admin access for the reseller. - 3. Resellers or distributors can manage entitlements for their - customers. + and provide them with delegated admin access. + 3. Resellers and distributors can manage customer entitlements. - The service primarily exposes the following resources: + CloudChannelService exposes the following resources: - - [Customer][google.cloud.channel.v1.Customer]s: A Customer - represents an entity managed by a reseller or distributor. A - customer typically represents an enterprise. In an n-tier resale - channel hierarchy, customers are generally represented as leaf - nodes. Customers primarily have an Entitlement sub-resource - discussed below. + - [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 - Entitlement represents an entity which provides a customer means - to start using 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: - A ChannelPartnerLink is an entity that identifies links between - distributors and their indirect resellers in a channel. + An entity that identifies links between distributors and their + indirect resellers in a channel. This class defines the same methods as the primary client, so the primary client can load the underlying transport implementation @@ -87,7 +78,7 @@ class CloudChannelServiceGrpcAsyncIOTransport(CloudChannelServiceTransport): def create_channel( cls, host: str = "cloudchannel.googleapis.com", - credentials: credentials.Credentials = None, + credentials: ga_credentials.Credentials = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, quota_project_id: Optional[str] = None, @@ -114,13 +105,15 @@ def create_channel( Returns: aio.Channel: A gRPC AsyncIO channel object. """ - scopes = scopes or cls.AUTH_SCOPES + + self_signed_jwt_kwargs = cls._get_self_signed_jwt_kwargs(host, scopes) + return grpc_helpers_async.create_channel( host, credentials=credentials, credentials_file=credentials_file, - scopes=scopes, quota_project_id=quota_project_id, + **self_signed_jwt_kwargs, **kwargs, ) @@ -128,7 +121,7 @@ def __init__( self, *, host: str = "cloudchannel.googleapis.com", - credentials: credentials.Credentials = None, + credentials: ga_credentials.Credentials = None, credentials_file: Optional[str] = None, scopes: Optional[Sequence[str]] = None, channel: aio.Channel = None, @@ -142,7 +135,8 @@ def __init__( """Instantiate the transport. Args: - host (Optional[str]): The hostname to connect to. + host (Optional[str]): + The hostname to connect to. credentials (Optional[google.auth.credentials.Credentials]): The authorization credentials to attach to requests. These credentials identify the application to the service; if none @@ -201,7 +195,6 @@ def __init__( # If a channel was explicitly provided, set it. self._grpc_channel = channel self._ssl_channel_credentials = None - else: if api_mtls_endpoint: host = api_mtls_endpoint @@ -284,18 +277,18 @@ def list_customers( ]: r"""Return a callable for the list customers method over gRPC. - List downstream [Customer][google.cloud.channel.v1.Customer]s. + List [Customer][google.cloud.channel.v1.Customer]s. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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 pertaining to the - reseller or empty list if there are none. + Return value: List of + [Customer][google.cloud.channel.v1.Customer]s, or an empty list + if there are no customers. Returns: Callable[[~.ListCustomersRequest], @@ -324,17 +317,17 @@ def get_customer( Returns a requested [Customer][google.cloud.channel.v1.Customer] resource. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the customer resource doesn't exist. Usually - the result of an invalid name parameter. + - 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: [Customer][google.cloud.channel.v1.Customer] - resource if found, error otherwise. + Return value: The [Customer][google.cloud.channel.v1.Customer] + resource. Returns: Callable[[~.GetCustomerRequest], @@ -364,24 +357,24 @@ def check_cloud_identity_accounts_exist( r"""Return a callable for the check cloud identity accounts exist method over gRPC. - Confirms the existence of Cloud Identity accounts, based on the - domain and whether the Cloud Identity accounts are owned by the + 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: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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: List of + Return value: A list of [CloudIdentityCustomerAccount][google.cloud.channel.v1.CloudIdentityCustomerAccount] - resources for the domain. List may be empty. + resources for the domain (may be empty) - Note: in the v1alpha1 version of the API, a NOT_FOUND error is - returned if no + 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. @@ -414,19 +407,17 @@ def create_customer( Creates a new [Customer][google.cloud.channel.v1.Customer] resource under the reseller or distributor account. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: It can happen in following scenarios - + - PERMISSION_DENIED: The reseller account making the request is + different from the reseller account in the API request. + - INVALID_ARGUMENT: - - Missing or invalid required parameters in the request. - - Domain field value doesn't match the domain specified in - primary email. + - Required request parameters are missing or invalid. + - Domain field value doesn't match the primary email domain. - Return Value: If successful, the newly created - [Customer][google.cloud.channel.v1.Customer] resource, otherwise - returns an error. + Return value: The newly created + [Customer][google.cloud.channel.v1.Customer] resource. Returns: Callable[[~.CreateCustomerRequest], @@ -453,20 +444,19 @@ def update_customer( r"""Return a callable for the update customer method over gRPC. Updates an existing [Customer][google.cloud.channel.v1.Customer] - resource belonging to the reseller or distributor. + resource for the reseller or distributor. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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 specified in the request. + resource found for the name in the request. - Return Value: If successful, the updated - [Customer][google.cloud.channel.v1.Customer] resource, otherwise - returns an error. + Return value: The updated + [Customer][google.cloud.channel.v1.Customer] resource. Returns: Callable[[~.UpdateCustomerRequest], @@ -489,22 +479,21 @@ def update_customer( @property def delete_customer( self, - ) -> Callable[[service.DeleteCustomerRequest], Awaitable[empty.Empty]]: + ) -> Callable[[service.DeleteCustomerRequest], Awaitable[empty_pb2.Empty]]: r"""Return a callable for the delete customer method over gRPC. Deletes the given [Customer][google.cloud.channel.v1.Customer] permanently and irreversibly. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the account making the request does not + - PERMISSION_DENIED: The account making the request does not own this customer. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - FAILED_PRECONDITION: If the customer has existing - entitlements. + - 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 specified in the request. + resource found for the name in the request. Returns: Callable[[~.DeleteCustomerRequest], @@ -520,7 +509,7 @@ def delete_customer( self._stubs["delete_customer"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/DeleteCustomer", request_serializer=service.DeleteCustomerRequest.serialize, - response_deserializer=empty.Empty.FromString, + response_deserializer=empty_pb2.Empty.FromString, ) return self._stubs["delete_customer"] @@ -528,34 +517,32 @@ def delete_customer( def provision_cloud_identity( self, ) -> Callable[ - [service.ProvisionCloudIdentityRequest], Awaitable[operations.Operation] + [service.ProvisionCloudIdentityRequest], Awaitable[operations_pb2.Operation] ]: r"""Return a callable for the provision cloud identity method over gRPC. Creates a Cloud Identity for the given customer using the - customer's information or the information provided here, if - present. + customer's information, or the information provided here. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the customer is not found for the reseller. - - ALREADY_EXISTS: If the customer's primary email already - exists. In this case, retry after changing the customer's - primary contact email. + - 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 in this case. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. Contact Cloud Channel support in this case. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 + contains an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. Returns: @@ -572,7 +559,7 @@ def provision_cloud_identity( self._stubs["provision_cloud_identity"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/ProvisionCloudIdentity", request_serializer=service.ProvisionCloudIdentityRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["provision_cloud_identity"] @@ -584,19 +571,18 @@ def list_entitlements( ]: r"""Return a callable for the list entitlements method over gRPC. - List [Entitlement][google.cloud.channel.v1.Entitlement]s + Lists [Entitlement][google.cloud.channel.v1.Entitlement]s belonging to a customer. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. - Return Value: List of - [Entitlement][google.cloud.channel.v1.Entitlement]s belonging to - the customer, or empty list if there are none. + Return value: A list of the customer's + [Entitlement][google.cloud.channel.v1.Entitlement]s. Returns: Callable[[~.ListEntitlementsRequest], @@ -626,29 +612,28 @@ def list_transferable_skus( r"""Return a callable for the list transferable skus method over gRPC. List [TransferableSku][google.cloud.channel.v1.TransferableSku]s - of a customer based on Cloud Identity ID or Customer Name in the - request. + of a customer based on the Cloud Identity ID or Customer Name in + the request. - This method is used when a reseller lists the entitlements - information of a customer that is not owned. The reseller should - provide the customer's Cloud Identity ID or Customer Name. + 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: + Possible error codes: - - PERMISSION_DENIED: Appears because of one of the following - + - PERMISSION_DENIED: - - The customer doesn't belong to the reseller and no auth - token. + - 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 and the queries - reseller account are different. + - The reseller account making the request is different from + the reseller account in the query. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. - Return Value: List of - [TransferableSku][google.cloud.channel.v1.TransferableSku] for - the given customer. + Return value: A list of the customer's + [TransferableSku][google.cloud.channel.v1.TransferableSku]. Returns: Callable[[~.ListTransferableSkusRequest], @@ -682,23 +667,24 @@ def list_transferable_offers( of a customer based on Cloud Identity ID or Customer Name in the request. - This method is used when a reseller gets the entitlement - information of a customer that is not owned. The reseller should - provide the customer's Cloud Identity ID or Customer Name. + 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: + Possible error codes: - - PERMISSION_DENIED: Appears because of one of the following: + - PERMISSION_DENIED: - - If the customer doesn't belong to the reseller and no auth - token or invalid auth token is supplied. - - If the reseller account making the request and the - reseller account being queried for are different. + - 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: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. - Return Value: List of + Return value: List of [TransferableOffer][google.cloud.channel.v1.TransferableOffer] for the given customer and SKU. @@ -729,17 +715,16 @@ def get_entitlement( Returns a requested [Entitlement][google.cloud.channel.v1.Entitlement] resource. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the entitlement is not found for the customer. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. + - NOT_FOUND: The customer entitlement was not found. - Return Value: If found, the requested - [Entitlement][google.cloud.channel.v1.Entitlement] resource, - otherwise returns an error. + Return value: The requested + [Entitlement][google.cloud.channel.v1.Entitlement] resource. Returns: Callable[[~.GetEntitlementRequest], @@ -762,56 +747,51 @@ def get_entitlement( @property def create_entitlement( self, - ) -> Callable[[service.CreateEntitlementRequest], Awaitable[operations.Operation]]: + ) -> Callable[ + [service.CreateEntitlementRequest], Awaitable[operations_pb2.Operation] + ]: r"""Return a callable for the create entitlement method over gRPC. Creates an entitlement for a customer. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: It can happen in below scenarios - - - - Missing or invalid required parameters in the request. - - Cannot purchase an entitlement if there is already an - entitlement for customer, for a SKU from the same product - family. - - INVALID_VALUE: Offer passed in isn't valid. Make sure - OfferId is valid. If it is valid, then contact Google - Channel support for further troubleshooting. - - - NOT_FOUND: If the customer or offer resource is not found for - the reseller. - - ALREADY_EXISTS: This failure can happen in the following - cases: - - - If the SKU has been already purchased for the customer. - - If the customer's primary email already exists. In this - case retry after changing the customer's primary contact - email. - - - CONDITION_NOT_MET or FAILED_PRECONDITION: This failure can - happen in the following cases: - - - Purchasing a SKU that requires domain verification and the - domain has not been verified. - - Purchasing an Add-On SKU like Vault or Drive without - purchasing the pre-requisite SKU, such as Google Workspace - Business Starter. - - Applicable only for developer accounts: reseller and - resold domain. Must meet the following domain naming - requirements: + - 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. - - Resold domain names must include the reseller domain. + - Domain names must include the reseller domain. - INTERNAL: Any non-user error related to a technical issue in - the backend. Contact Cloud Channel Support in this case. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. Contact Cloud Channel Support in this case. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -832,38 +812,38 @@ def create_entitlement( self._stubs["create_entitlement"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/CreateEntitlement", request_serializer=service.CreateEntitlementRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["create_entitlement"] @property def change_parameters( self, - ) -> Callable[[service.ChangeParametersRequest], Awaitable[operations.Operation]]: + ) -> Callable[ + [service.ChangeParametersRequest], Awaitable[operations_pb2.Operation] + ]: r"""Return a callable for the change parameters method over gRPC. - Change parameters of the entitlement + Change parameters of the entitlement. - An entitlement parameters update is a long-running operation and - results in updates to the entitlement as a result of - fulfillment. + An entitlement update is a long-running operation and it updates + the entitlement as a result of fulfillment. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. For example, if the number of seats being - changed to is greater than the allowed number of max seats - for the resource. Or decreasing seats for a commitment based - plan. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -884,7 +864,7 @@ def change_parameters( self._stubs["change_parameters"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/ChangeParameters", request_serializer=service.ChangeParametersRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["change_parameters"] @@ -892,32 +872,32 @@ def change_parameters( def change_renewal_settings( self, ) -> Callable[ - [service.ChangeRenewalSettingsRequest], Awaitable[operations.Operation] + [service.ChangeRenewalSettingsRequest], Awaitable[operations_pb2.Operation] ]: r"""Return a callable for the change renewal settings method over gRPC. Updates the renewal settings for an existing customer entitlement. - An entitlement update is a long-running operation and results in - updates to the entitlement as a result of fulfillment. + An entitlement update is a long-running operation and it updates + the entitlement as a result of fulfillment. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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 renewal 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. In this case, contact Cloud Channel support. - - UNKNOWN: Any non user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + - 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: Long Running Operation ID. + 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 @@ -938,34 +918,34 @@ def change_renewal_settings( self._stubs["change_renewal_settings"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/ChangeRenewalSettings", request_serializer=service.ChangeRenewalSettingsRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["change_renewal_settings"] @property def change_offer( self, - ) -> Callable[[service.ChangeOfferRequest], Awaitable[operations.Operation]]: + ) -> Callable[[service.ChangeOfferRequest], Awaitable[operations_pb2.Operation]]: r"""Return a callable for the change offer method over gRPC. Updates the Offer for an existing customer entitlement. - An entitlement update is a long-running operation and results in - updates to the entitlement as a result of fulfillment. + An entitlement update is a long-running operation and it updates + the entitlement as a result of fulfillment. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -986,37 +966,39 @@ def change_offer( self._stubs["change_offer"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/ChangeOffer", request_serializer=service.ChangeOfferRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["change_offer"] @property def start_paid_service( self, - ) -> Callable[[service.StartPaidServiceRequest], Awaitable[operations.Operation]]: + ) -> Callable[ + [service.StartPaidServiceRequest], Awaitable[operations_pb2.Operation] + ]: r"""Return a callable for the start paid service method over gRPC. Starts paid service for a trial entitlement. Starts paid service for a trial entitlement immediately. This - method is only applicable if a plan has already been set up for - a trial entitlement but has some trial days remaining. + method is only applicable if a plan is set up for a trial + entitlement but has some trial days remaining. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1037,33 +1019,36 @@ def start_paid_service( self._stubs["start_paid_service"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/StartPaidService", request_serializer=service.StartPaidServiceRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["start_paid_service"] @property def suspend_entitlement( self, - ) -> Callable[[service.SuspendEntitlementRequest], Awaitable[operations.Operation]]: + ) -> Callable[ + [service.SuspendEntitlementRequest], Awaitable[operations_pb2.Operation] + ]: r"""Return a callable for the suspend entitlement method over gRPC. - Suspends a previously fulfilled entitlement. An entitlement - suspension is a long-running operation. + Suspends a previously fulfilled entitlement. - Possible Error Codes: + An entitlement suspension is a long-running operation. - - PERMISSION_DENIED: If the customer doesn't belong to the + Possible error codes: + + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1084,39 +1069,40 @@ def suspend_entitlement( self._stubs["suspend_entitlement"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/SuspendEntitlement", request_serializer=service.SuspendEntitlementRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["suspend_entitlement"] @property def cancel_entitlement( self, - ) -> Callable[[service.CancelEntitlementRequest], Awaitable[operations.Operation]]: + ) -> Callable[ + [service.CancelEntitlementRequest], Awaitable[operations_pb2.Operation] + ]: r"""Return a callable for the cancel entitlement method over gRPC. - Cancels a previously fulfilled entitlement. An entitlement - cancellation is a long-running operation. + Cancels a previously fulfilled entitlement. + + An entitlement cancellation is a long-running operation. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the - reseller or if the reseller account making the request and - reseller account being queried for are different. - - FAILED_PRECONDITION: If there are any Google Cloud projects - linked to the Google Cloud entitlement's Cloud Billing - subaccount. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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 + Workspace add-ons, or entitlements for Google Cloud's development platform. - INTERNAL: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1138,7 +1124,7 @@ def cancel_entitlement( self._stubs["cancel_entitlement"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/CancelEntitlement", request_serializer=service.CancelEntitlementRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["cancel_entitlement"] @@ -1146,36 +1132,35 @@ def cancel_entitlement( def activate_entitlement( self, ) -> Callable[ - [service.ActivateEntitlementRequest], Awaitable[operations.Operation] + [service.ActivateEntitlementRequest], Awaitable[operations_pb2.Operation] ]: r"""Return a callable for the activate entitlement method over gRPC. - Activates a previously suspended entitlement. The entitlement - must be in a suspended state for it to be activated. - Entitlements suspended for pending ToS acceptance can't be - activated using this method. An entitlement activation is a - long-running operation and can result in updates to the state of - the customer entitlement. + 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: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the - reseller or if the reseller account making the request and - reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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't activate an - entitlement that is pending TOS acceptance. Only reseller - initiated suspensions can be activated. - - NOT_SUSPENDED: Can't activate entitlements that are already - in ACTIVE state. Can only activate suspended entitlements. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1196,7 +1181,7 @@ def activate_entitlement( self._stubs["activate_entitlement"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/ActivateEntitlement", request_serializer=service.ActivateEntitlementRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["activate_entitlement"] @@ -1204,46 +1189,41 @@ def activate_entitlement( def transfer_entitlements( self, ) -> Callable[ - [service.TransferEntitlementsRequest], Awaitable[operations.Operation] + [service.TransferEntitlementsRequest], Awaitable[operations_pb2.Operation] ]: r"""Return a callable for the transfer entitlements method over gRPC. Transfers customer entitlements to new reseller. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the customer or offer resource is not found for - the reseller. - - ALREADY_EXISTS: If the SKU has been already transferred for - the customer. - - CONDITION_NOT_MET or FAILED_PRECONDITION: This failure can - happen in the following cases: - - - Transferring a SKU that requires domain verification and - the domain has not been verified. - - Transferring an Add-On SKU like Vault or Drive without - transferring the pre-requisite SKU, such as G Suite Basic. - - Applicable only for developer accounts: reseller and - resold domain must follow the domain naming convention as - follows: + - 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. - - Resold domain names must include the reseller domain. + - Domain names must include the reseller domain. - - All transferring entitlements must be specified. + - Specify all transferring entitlements. - INTERNAL: Any non-user error related to a technical issue in - the backend. Please contact Cloud Channel Support in this - case. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. Please contact Cloud Channel Support in this - case. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1264,7 +1244,7 @@ def transfer_entitlements( self._stubs["transfer_entitlements"] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/TransferEntitlements", request_serializer=service.TransferEntitlementsRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["transfer_entitlements"] @@ -1272,45 +1252,42 @@ def transfer_entitlements( def transfer_entitlements_to_google( self, ) -> Callable[ - [service.TransferEntitlementsToGoogleRequest], Awaitable[operations.Operation] + [service.TransferEntitlementsToGoogleRequest], + Awaitable[operations_pb2.Operation], ]: r"""Return a callable for the transfer entitlements to google method over gRPC. - Transfers customer entitlements from current reseller to Google. + Transfers customer entitlements from their current reseller to + Google. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the customer or offer resource is not found for - the reseller. - - ALREADY_EXISTS: If the SKU has been already transferred for - the customer. - - CONDITION_NOT_MET or FAILED_PRECONDITION: This failure can - happen in the following cases: - - - Transferring a SKU that requires domain verification and - the domain has not been verified. - - Transferring an Add-On SKU like Vault or Drive without - purchasing the pre-requisite SKU, such as G Suite Basic. - - Applicable only for developer accounts: reseller and - resold domain must follow the domain naming convention as - follows: + - 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. - - Resold domain names must include the reseller domain. + - Domain names must include the reseller domain. - INTERNAL: Any non-user error related to a technical issue in - the backend. Please contact Cloud Channel Support in this - case. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. Please contact Cloud Channel Support in this - case. + the backend. Contact Cloud Channel support. - Return Value: Long Running Operation ID. + 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 @@ -1334,7 +1311,7 @@ def transfer_entitlements_to_google( ] = self.grpc_channel.unary_unary( "/google.cloud.channel.v1.CloudChannelService/TransferEntitlementsToGoogle", request_serializer=service.TransferEntitlementsToGoogleRequest.serialize, - response_deserializer=operations.Operation.FromString, + response_deserializer=operations_pb2.Operation.FromString, ) return self._stubs["transfer_entitlements_to_google"] @@ -1349,20 +1326,19 @@ def list_channel_partner_links( List [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink]s - belonging to a distributor. To call this method, you must be a - distributor. + belonging to a distributor. You must be a distributor to call + this method. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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: If successful, returns the list of + Return value: The list of the distributor account's [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] - resources for the distributor account, otherwise returns an - error. + resources. Returns: Callable[[~.ListChannelPartnerLinksRequest], @@ -1393,20 +1369,20 @@ def get_channel_partner_link( Returns a requested [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] - resource. To call this method, you must be a distributor. + resource. You must be a distributor to call this method. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: ChannelPartnerLink resource not found. Results due - invalid channel partner link name. + - 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: + Return value: The [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] - resource if found, otherwise returns an error. + resource. Returns: Callable[[~.GetChannelPartnerLinkRequest], @@ -1436,30 +1412,30 @@ def create_channel_partner_link( r"""Return a callable for the create channel partner link method over gRPC. Initiates a channel partner link between a distributor and a - reseller or between resellers in an n-tier reseller channel. To - accept the invite, the invited partner should follow the - invite_link_uri provided in the response. If the link creation - is accepted, a valid link is set up between the two involved - parties. To call this method, you must be a distributor. - - Possible Error Codes: - - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - ALREADY_EXISTS: If the ChannelPartnerLink sent in the request + 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: If no Cloud Identity customer exists for domain - provided. + - NOT_FOUND: No Cloud Identity customer exists for provided + domain. - INTERNAL: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Newly created + Return value: The new [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] - resource if successful, otherwise error is returned. + resource. Returns: Callable[[~.CreateChannelPartnerLinkRequest], @@ -1488,30 +1464,31 @@ def update_channel_partner_link( ]: r"""Return a callable for the update channel partner link method over gRPC. - Updates a channel partner link. A distributor calls this method - to change a link's status. For example, suspend a partner link. - To call this method, you must be a distributor. + 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: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being queried for are different. - - INVALID_ARGUMENT: It can happen in following scenarios - + - PERMISSION_DENIED: The reseller account making the request is + different from the reseller account in the API request. + - INVALID_ARGUMENT: - - Missing or invalid required parameters in the request. - - Updating link state from invited to active or suspended. - - Sending reseller_cloud_identity_id, invite_url or name in - update mask. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: If successful, the updated + Return value: The updated [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] - resource, otherwise returns an error. + resource. Returns: Callable[[~.UpdateChannelPartnerLinkRequest], @@ -1541,10 +1518,10 @@ def list_products( Lists the Products the reseller is authorized to sell. - Possible Error Codes: + Possible error codes: - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. Returns: Callable[[~.ListProductsRequest], @@ -1572,10 +1549,10 @@ def list_skus( Lists the SKUs for a product the reseller is authorized to sell. - Possible Error Codes: + Possible error codes: - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. Returns: Callable[[~.ListSkusRequest], @@ -1603,10 +1580,10 @@ def list_offers( Lists the Offers the reseller can sell. - Possible Error Codes: + Possible error codes: - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. Returns: Callable[[~.ListOffersRequest], @@ -1635,17 +1612,17 @@ def list_purchasable_skus( ]: r"""Return a callable for the list purchasable skus method over gRPC. - Lists the Purchasable SKUs for following cases: + Lists the following: - - SKUs that can be newly purchased for a customer - - SKUs that can be upgraded/downgraded to, for an entitlement. + - SKUs that you can purchase for a customer + - SKUs that you can upgrade or downgrade for an entitlement. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the - reseller - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - PERMISSION_DENIED: The customer doesn't belong to the + reseller. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. Returns: Callable[[~.ListPurchasableSkusRequest], @@ -1674,17 +1651,17 @@ def list_purchasable_offers( ]: r"""Return a callable for the list purchasable offers method over gRPC. - Lists the Purchasable Offers for the following cases: + Lists the following: - - Offers that can be newly purchased for a customer - - Offers that can be changed to, for an entitlement. + - Offers that you can purchase for a customer. + - Offers that you can change for an entitlement. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the customer doesn't belong to the + - PERMISSION_DENIED: The customer doesn't belong to the reseller - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - INVALID_ARGUMENT: Required request parameters are missing or + invalid. Returns: Callable[[~.ListPurchasableOffersRequest], @@ -1714,24 +1691,24 @@ def register_subscriber( r"""Return a callable for the register subscriber method over gRPC. Registers a service account with subscriber privileges on the - Cloud Pub/Sub topic created for this Channel Services account. - Once you create a subscriber, you will get the events as per + 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: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being provided are different, or if - the impersonated user is not a super admin. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Topic name with service email address registered - if successful, otherwise error is returned. + Return value: The topic name with the registered service email + address. Returns: Callable[[~.RegisterSubscriberRequest], @@ -1762,27 +1739,26 @@ def unregister_subscriber( Unregisters a service account with subscriber privileges on the Cloud Pub/Sub topic created for this Channel Services account. - If there are no more service account left with sunbscriber - privileges, the topic will be deleted. You can check this by - calling ListSubscribers api. - - Possible Error Codes: - - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being provided are different, or if - the impersonated user is not a super admin. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the topic resource doesn't exist. + 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: Topic name from which service email address has - been unregistered if successful, otherwise error is returned. If - the service email was already not associated with the topic, the - success response will be returned. + 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. Returns: Callable[[~.UnregisterSubscriberRequest], @@ -1813,21 +1789,20 @@ def list_subscribers( Lists service accounts with subscriber privileges on the Cloud Pub/Sub topic created for this Channel Services account. - Possible Error Codes: + Possible error codes: - - PERMISSION_DENIED: If the reseller account making the request - and the reseller account being provided are different, or if - the account is not a super admin. - - INVALID_ARGUMENT: Missing or invalid required parameters in - the request. - - NOT_FOUND: If the topic resource doesn't exist. + - 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. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - UNKNOWN: Any non-user error related to a technical issue in - the backend. In this case, contact Cloud Channel support. + the backend. Contact Cloud Channel support. - Return Value: List of service email addresses if successful, - otherwise error is returned. + Return value: A list of service email addresses. Returns: Callable[[~.ListSubscribersRequest], diff --git a/google/cloud/channel_v1/types/__init__.py b/google/cloud/channel_v1/types/__init__.py index e0de3c6..ff2b776 100644 --- a/google/cloud/channel_v1/types/__init__.py +++ b/google/cloud/channel_v1/types/__init__.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # - from .channel_partner_links import ( ChannelPartnerLink, ChannelPartnerLinkState, diff --git a/google/cloud/channel_v1/types/channel_partner_links.py b/google/cloud/channel_v1/types/channel_partner_links.py index 3ce6f87..0cf82c4 100644 --- a/google/cloud/channel_v1/types/channel_partner_links.py +++ b/google/cloud/channel_v1/types/channel_partner_links.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,12 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # - import proto # type: ignore - from google.cloud.channel_v1.types import common -from google.protobuf import timestamp_pb2 as timestamp # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore __protobuf__ = proto.module( @@ -85,20 +82,13 @@ class ChannelPartnerLink(proto.Message): channel partner (IR). """ - name = proto.Field(proto.STRING, number=1) - - reseller_cloud_identity_id = proto.Field(proto.STRING, number=2) - + name = proto.Field(proto.STRING, number=1,) + reseller_cloud_identity_id = proto.Field(proto.STRING, number=2,) link_state = proto.Field(proto.ENUM, number=3, enum="ChannelPartnerLinkState",) - - invite_link_uri = proto.Field(proto.STRING, number=4) - - create_time = proto.Field(proto.MESSAGE, number=5, message=timestamp.Timestamp,) - - update_time = proto.Field(proto.MESSAGE, number=6, message=timestamp.Timestamp,) - - public_id = proto.Field(proto.STRING, number=7) - + invite_link_uri = proto.Field(proto.STRING, number=4,) + create_time = proto.Field(proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp,) + update_time = proto.Field(proto.MESSAGE, number=6, message=timestamp_pb2.Timestamp,) + public_id = proto.Field(proto.STRING, number=7,) channel_partner_cloud_identity_info = proto.Field( proto.MESSAGE, number=8, message=common.CloudIdentityInfo, ) diff --git a/google/cloud/channel_v1/types/common.py b/google/cloud/channel_v1/types/common.py index a7669c8..33b5a77 100644 --- a/google/cloud/channel_v1/types/common.py +++ b/google/cloud/channel_v1/types/common.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,11 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # - import proto # type: ignore - -from google.protobuf import any_pb2 as gp_any # type: ignore +from google.protobuf import any_pb2 # type: ignore __protobuf__ = proto.module( @@ -29,7 +26,6 @@ class EduData(proto.Message): r"""Required Edu Attributes - Attributes: institute_type (google.cloud.channel_v1.types.EduData.InstituteType): Designated institute type of customer. @@ -58,15 +54,12 @@ class InstituteSize(proto.Enum): SIZE_10001_OR_MORE = 7 institute_type = proto.Field(proto.ENUM, number=1, enum=InstituteType,) - institute_size = proto.Field(proto.ENUM, number=2, enum=InstituteSize,) - - website = proto.Field(proto.STRING, number=3) + website = proto.Field(proto.STRING, number=3,) class CloudIdentityInfo(proto.Message): r"""Cloud Identity information for the Cloud Channel Customer. - Attributes: customer_type (google.cloud.channel_v1.types.CloudIdentityInfo.CustomerType): CustomerType indicates verification type @@ -74,7 +67,12 @@ class CloudIdentityInfo(proto.Message): primary_domain (str): Output only. The primary domain name. is_domain_verified (bool): - Whether the domain is verified. + 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. alternate_email (str): The alternate email. phone_number (str): @@ -96,25 +94,17 @@ class CustomerType(proto.Enum): TEAM = 2 customer_type = proto.Field(proto.ENUM, number=1, enum=CustomerType,) - - primary_domain = proto.Field(proto.STRING, number=9) - - is_domain_verified = proto.Field(proto.BOOL, number=4) - - alternate_email = proto.Field(proto.STRING, number=6) - - phone_number = proto.Field(proto.STRING, number=7) - - language_code = proto.Field(proto.STRING, number=8) - - admin_console_uri = proto.Field(proto.STRING, number=10) - + primary_domain = proto.Field(proto.STRING, number=9,) + is_domain_verified = proto.Field(proto.BOOL, number=4,) + alternate_email = proto.Field(proto.STRING, number=6,) + phone_number = proto.Field(proto.STRING, number=7,) + language_code = proto.Field(proto.STRING, number=8,) + admin_console_uri = proto.Field(proto.STRING, number=10,) edu_data = proto.Field(proto.MESSAGE, number=22, message="EduData",) class Value(proto.Message): r"""Data type and value of a parameter. - Attributes: int64_value (int): Represents an int64 value. @@ -124,17 +114,17 @@ class Value(proto.Message): Represents a double value. proto_value (google.protobuf.any_pb2.Any): Represents an 'Any' proto value. + bool_value (bool): + Represents a boolean value. """ - int64_value = proto.Field(proto.INT64, number=1, oneof="kind") - - string_value = proto.Field(proto.STRING, number=2, oneof="kind") - - double_value = proto.Field(proto.DOUBLE, number=3, oneof="kind") - + int64_value = proto.Field(proto.INT64, number=1, oneof="kind",) + string_value = proto.Field(proto.STRING, number=2, oneof="kind",) + double_value = proto.Field(proto.DOUBLE, number=3, oneof="kind",) proto_value = proto.Field( - proto.MESSAGE, number=4, oneof="kind", message=gp_any.Any, + proto.MESSAGE, number=4, oneof="kind", message=any_pb2.Any, ) + bool_value = proto.Field(proto.BOOL, number=5, oneof="kind",) class AdminUser(proto.Message): @@ -150,11 +140,9 @@ class AdminUser(proto.Message): Family name of the admin user. """ - email = proto.Field(proto.STRING, number=1) - - given_name = proto.Field(proto.STRING, number=2) - - family_name = proto.Field(proto.STRING, number=3) + email = proto.Field(proto.STRING, number=1,) + given_name = proto.Field(proto.STRING, number=2,) + family_name = proto.Field(proto.STRING, number=3,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/channel_v1/types/customers.py b/google/cloud/channel_v1/types/customers.py index c788211..ae2d89d 100644 --- a/google/cloud/channel_v1/types/customers.py +++ b/google/cloud/channel_v1/types/customers.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,13 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # - import proto # type: ignore - from google.cloud.channel_v1.types import common -from google.protobuf import timestamp_pb2 as timestamp # type: ignore -from google.type import postal_address_pb2 as postal_address # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore +from google.type import postal_address_pb2 # type: ignore __protobuf__ = proto.module( @@ -30,7 +27,6 @@ class Customer(proto.Message): r"""Entity representing a customer of a reseller or distributor. - Attributes: name (str): Output only. Resource name of the customer. Format: @@ -83,38 +79,26 @@ class Customer(proto.Message): exists for this customer. """ - name = proto.Field(proto.STRING, number=1) - - org_display_name = proto.Field(proto.STRING, number=2) - + name = proto.Field(proto.STRING, number=1,) + org_display_name = proto.Field(proto.STRING, number=2,) org_postal_address = proto.Field( - proto.MESSAGE, number=3, message=postal_address.PostalAddress, + proto.MESSAGE, number=3, message=postal_address_pb2.PostalAddress, ) - primary_contact_info = proto.Field(proto.MESSAGE, number=4, message="ContactInfo",) - - alternate_email = proto.Field(proto.STRING, number=5) - - domain = proto.Field(proto.STRING, number=6) - - create_time = proto.Field(proto.MESSAGE, number=7, message=timestamp.Timestamp,) - - update_time = proto.Field(proto.MESSAGE, number=8, message=timestamp.Timestamp,) - - cloud_identity_id = proto.Field(proto.STRING, number=9) - - language_code = proto.Field(proto.STRING, number=10) - + alternate_email = proto.Field(proto.STRING, number=5,) + domain = proto.Field(proto.STRING, number=6,) + create_time = proto.Field(proto.MESSAGE, number=7, message=timestamp_pb2.Timestamp,) + update_time = proto.Field(proto.MESSAGE, number=8, message=timestamp_pb2.Timestamp,) + cloud_identity_id = proto.Field(proto.STRING, number=9,) + language_code = proto.Field(proto.STRING, number=10,) cloud_identity_info = proto.Field( proto.MESSAGE, number=12, message=common.CloudIdentityInfo, ) - - channel_partner_id = proto.Field(proto.STRING, number=13) + channel_partner_id = proto.Field(proto.STRING, number=13,) class ContactInfo(proto.Message): r"""Contact information for a customer account. - Attributes: first_name (str): First name of the contact in the customer @@ -140,17 +124,12 @@ class ContactInfo(proto.Message): account. """ - first_name = proto.Field(proto.STRING, number=1) - - last_name = proto.Field(proto.STRING, number=2) - - display_name = proto.Field(proto.STRING, number=4) - - email = proto.Field(proto.STRING, number=5) - - title = proto.Field(proto.STRING, number=6) - - phone = proto.Field(proto.STRING, number=7) + first_name = proto.Field(proto.STRING, number=1,) + last_name = proto.Field(proto.STRING, number=2,) + display_name = proto.Field(proto.STRING, number=4,) + email = proto.Field(proto.STRING, number=5,) + title = proto.Field(proto.STRING, number=6,) + phone = proto.Field(proto.STRING, number=7,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/channel_v1/types/entitlements.py b/google/cloud/channel_v1/types/entitlements.py index 0099224..2c347ba 100644 --- a/google/cloud/channel_v1/types/entitlements.py +++ b/google/cloud/channel_v1/types/entitlements.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,14 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # - import proto # type: ignore - from google.cloud.channel_v1.types import common from google.cloud.channel_v1.types import offers from google.cloud.channel_v1.types import products -from google.protobuf import timestamp_pb2 as timestamp # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore __protobuf__ = proto.module( @@ -107,40 +104,28 @@ class SuspensionReason(proto.Enum): PENDING_TOS_ACCEPTANCE = 4 OTHER = 100 - name = proto.Field(proto.STRING, number=1) - - create_time = proto.Field(proto.MESSAGE, number=5, message=timestamp.Timestamp,) - - update_time = proto.Field(proto.MESSAGE, number=6, message=timestamp.Timestamp,) - - offer = proto.Field(proto.STRING, number=8) - + name = proto.Field(proto.STRING, number=1,) + create_time = proto.Field(proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp,) + update_time = proto.Field(proto.MESSAGE, number=6, message=timestamp_pb2.Timestamp,) + offer = proto.Field(proto.STRING, number=8,) commitment_settings = proto.Field( proto.MESSAGE, number=12, message="CommitmentSettings", ) - provisioning_state = proto.Field(proto.ENUM, number=13, enum=ProvisioningState,) - provisioned_service = proto.Field( proto.MESSAGE, number=16, message="ProvisionedService", ) - suspension_reasons = proto.RepeatedField( proto.ENUM, number=18, enum=SuspensionReason, ) - - purchase_order_id = proto.Field(proto.STRING, number=19) - + purchase_order_id = proto.Field(proto.STRING, number=19,) trial_settings = proto.Field(proto.MESSAGE, number=21, message="TrialSettings",) - association_info = proto.Field(proto.MESSAGE, number=23, message="AssociationInfo",) - parameters = proto.RepeatedField(proto.MESSAGE, number=26, message="Parameter",) class Parameter(proto.Message): r"""Definition for extended entitlement parameters. - Attributes: name (str): Name of the parameter. @@ -153,11 +138,9 @@ class Parameter(proto.Message): editable when entitlement is active. """ - name = proto.Field(proto.STRING, number=1) - + name = proto.Field(proto.STRING, number=1,) value = proto.Field(proto.MESSAGE, number=2, message=common.Value,) - - editable = proto.Field(proto.BOOL, number=3) + editable = proto.Field(proto.BOOL, number=3,) class AssociationInfo(proto.Message): @@ -170,12 +153,11 @@ class AssociationInfo(proto.Message): this entitlement is an add-on. """ - base_entitlement = proto.Field(proto.STRING, number=1) + base_entitlement = proto.Field(proto.STRING, number=1,) class ProvisionedService(proto.Message): r"""Service provisioned for an entitlement. - Attributes: provisioning_id (str): Output only. Provisioning ID of the @@ -189,16 +171,13 @@ class ProvisionedService(proto.Message): provisioning resource as specified in the Offer. """ - provisioning_id = proto.Field(proto.STRING, number=1) - - product_id = proto.Field(proto.STRING, number=2) - - sku_id = proto.Field(proto.STRING, number=3) + provisioning_id = proto.Field(proto.STRING, number=1,) + product_id = proto.Field(proto.STRING, number=2,) + sku_id = proto.Field(proto.STRING, number=3,) class CommitmentSettings(proto.Message): r"""Commitment settings for commitment-based offers. - Attributes: start_time (google.protobuf.timestamp_pb2.Timestamp): Output only. Commitment start timestamp. @@ -209,16 +188,13 @@ class CommitmentSettings(proto.Message): commitment-based Offer. """ - start_time = proto.Field(proto.MESSAGE, number=1, message=timestamp.Timestamp,) - - end_time = proto.Field(proto.MESSAGE, number=2, message=timestamp.Timestamp,) - + start_time = proto.Field(proto.MESSAGE, number=1, message=timestamp_pb2.Timestamp,) + end_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,) renewal_settings = proto.Field(proto.MESSAGE, number=4, message="RenewalSettings",) class RenewalSettings(proto.Message): r"""Renewal settings for renewable Offers. - Attributes: enable_renewal (bool): If false, the plan will be completed at the @@ -234,18 +210,14 @@ class RenewalSettings(proto.Message): billed, such as once per month. """ - enable_renewal = proto.Field(proto.BOOL, number=1) - - resize_unit_count = proto.Field(proto.BOOL, number=2) - + enable_renewal = proto.Field(proto.BOOL, number=1,) + resize_unit_count = proto.Field(proto.BOOL, number=2,) payment_plan = proto.Field(proto.ENUM, number=5, enum=offers.PaymentPlan,) - payment_cycle = proto.Field(proto.MESSAGE, number=6, message=offers.Period,) class TrialSettings(proto.Message): r"""Settings for trial offers. - Attributes: trial (bool): Determines if the entitlement is in a trial or not: @@ -258,9 +230,8 @@ class TrialSettings(proto.Message): converter `__. """ - trial = proto.Field(proto.BOOL, number=1) - - end_time = proto.Field(proto.MESSAGE, number=2, message=timestamp.Timestamp,) + trial = proto.Field(proto.BOOL, number=1,) + end_time = proto.Field(proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp,) class TransferableSku(proto.Message): @@ -274,18 +245,20 @@ class TransferableSku(proto.Message): sku (google.cloud.channel_v1.types.Sku): The SKU pertaining to the provisioning resource as specified in the Offer. + legacy_sku (google.cloud.channel_v1.types.Sku): + Optional. The customer to transfer has an + entitlement with the populated legacy SKU. """ transfer_eligibility = proto.Field( proto.MESSAGE, number=9, message="TransferEligibility", ) - sku = proto.Field(proto.MESSAGE, number=11, message=products.Sku,) + legacy_sku = proto.Field(proto.MESSAGE, number=12, message=products.Sku,) class TransferEligibility(proto.Message): r"""Specifies transfer eligibility of a SKU. - Attributes: is_eligible (bool): Whether reseller is eligible to transfer the @@ -304,10 +277,8 @@ class Reason(proto.Enum): SKU_NOT_ELIGIBLE = 2 SKU_SUSPENDED = 3 - is_eligible = proto.Field(proto.BOOL, number=1) - - description = proto.Field(proto.STRING, number=2) - + is_eligible = proto.Field(proto.BOOL, number=1,) + description = proto.Field(proto.STRING, number=2,) ineligibility_reason = proto.Field(proto.ENUM, number=3, enum=Reason,) diff --git a/google/cloud/channel_v1/types/offers.py b/google/cloud/channel_v1/types/offers.py index 8685084..3d1f3dc 100644 --- a/google/cloud/channel_v1/types/offers.py +++ b/google/cloud/channel_v1/types/offers.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,14 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # - import proto # type: ignore - from google.cloud.channel_v1.types import common from google.cloud.channel_v1.types import products -from google.protobuf import timestamp_pb2 as timestamp # type: ignore -from google.type import money_pb2 as money # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore +from google.type import money_pb2 # type: ignore __protobuf__ = proto.module( @@ -123,26 +120,18 @@ class Offer(proto.Message): purchase. """ - name = proto.Field(proto.STRING, number=1) - + name = proto.Field(proto.STRING, number=1,) marketing_info = proto.Field( proto.MESSAGE, number=2, message=products.MarketingInfo, ) - sku = proto.Field(proto.MESSAGE, number=3, message=products.Sku,) - plan = proto.Field(proto.MESSAGE, number=4, message="Plan",) - constraints = proto.Field(proto.MESSAGE, number=5, message="Constraints",) - price_by_resources = proto.RepeatedField( proto.MESSAGE, number=6, message="PriceByResource", ) - - start_time = proto.Field(proto.MESSAGE, number=7, message=timestamp.Timestamp,) - - end_time = proto.Field(proto.MESSAGE, number=8, message=timestamp.Timestamp,) - + start_time = proto.Field(proto.MESSAGE, number=7, message=timestamp_pb2.Timestamp,) + end_time = proto.Field(proto.MESSAGE, number=8, message=timestamp_pb2.Timestamp,) parameter_definitions = proto.RepeatedField( proto.MESSAGE, number=9, message="ParameterDefinition", ) @@ -186,22 +175,16 @@ class ParameterType(proto.Enum): STRING = 2 DOUBLE = 3 - name = proto.Field(proto.STRING, number=1) - + name = proto.Field(proto.STRING, number=1,) parameter_type = proto.Field(proto.ENUM, number=2, enum=ParameterType,) - min_value = proto.Field(proto.MESSAGE, number=3, message=common.Value,) - max_value = proto.Field(proto.MESSAGE, number=4, message=common.Value,) - allowed_values = proto.RepeatedField(proto.MESSAGE, number=5, message=common.Value,) - - optional = proto.Field(proto.BOOL, number=6) + optional = proto.Field(proto.BOOL, number=6,) class Constraints(proto.Message): r"""Represents the constraints for buying the Offer. - Attributes: customer_constraints (google.cloud.channel_v1.types.CustomerConstraints): Represents constraints required to purchase @@ -227,12 +210,10 @@ class CustomerConstraints(proto.Message): Promotional offers. """ - allowed_regions = proto.RepeatedField(proto.STRING, number=1) - + allowed_regions = proto.RepeatedField(proto.STRING, number=1,) allowed_customer_types = proto.RepeatedField( proto.ENUM, number=2, enum=common.CloudIdentityInfo.CustomerType, ) - promotional_order_types = proto.RepeatedField( proto.ENUM, number=3, enum="PromotionalOrderType", ) @@ -266,19 +247,14 @@ class Plan(proto.Message): """ payment_plan = proto.Field(proto.ENUM, number=1, enum="PaymentPlan",) - payment_type = proto.Field(proto.ENUM, number=2, enum="PaymentType",) - payment_cycle = proto.Field(proto.MESSAGE, number=3, message="Period",) - trial_period = proto.Field(proto.MESSAGE, number=4, message="Period",) - - billing_account = proto.Field(proto.STRING, number=5) + billing_account = proto.Field(proto.STRING, number=5,) class PriceByResource(proto.Message): r"""Represents price by resource type. - Attributes: resource_type (google.cloud.channel_v1.types.ResourceType): Resource Type. Example: SEAT @@ -290,15 +266,12 @@ class PriceByResource(proto.Message): """ resource_type = proto.Field(proto.ENUM, number=1, enum="ResourceType",) - price = proto.Field(proto.MESSAGE, number=2, message="Price",) - price_phases = proto.RepeatedField(proto.MESSAGE, number=3, message="PricePhase",) class Price(proto.Message): r"""Represents the price of the Offer. - Attributes: base_price (google.type.money_pb2.Money): Base price. @@ -313,13 +286,10 @@ class Price(proto.Message): Google Voice rate card. """ - base_price = proto.Field(proto.MESSAGE, number=1, message=money.Money,) - - discount = proto.Field(proto.DOUBLE, number=2) - - effective_price = proto.Field(proto.MESSAGE, number=3, message=money.Money,) - - external_price_uri = proto.Field(proto.STRING, number=4) + base_price = proto.Field(proto.MESSAGE, number=1, message=money_pb2.Money,) + discount = proto.Field(proto.DOUBLE, number=2,) + effective_price = proto.Field(proto.MESSAGE, number=3, message=money_pb2.Money,) + external_price_uri = proto.Field(proto.STRING, number=4,) class PricePhase(proto.Message): @@ -342,13 +312,9 @@ class PricePhase(proto.Message): """ period_type = proto.Field(proto.ENUM, number=1, enum="PeriodType",) - - first_period = proto.Field(proto.INT32, number=2) - - last_period = proto.Field(proto.INT32, number=3) - + first_period = proto.Field(proto.INT32, number=2,) + last_period = proto.Field(proto.INT32, number=3,) price = proto.Field(proto.MESSAGE, number=4, message="Price",) - price_tiers = proto.RepeatedField(proto.MESSAGE, number=5, message="PriceTier",) @@ -373,16 +339,13 @@ class PriceTier(proto.Message): Price of the tier. """ - first_resource = proto.Field(proto.INT32, number=1) - - last_resource = proto.Field(proto.INT32, number=2) - + first_resource = proto.Field(proto.INT32, number=1,) + last_resource = proto.Field(proto.INT32, number=2,) price = proto.Field(proto.MESSAGE, number=3, message="Price",) class Period(proto.Message): r"""Represents period in days/months/years. - Attributes: duration (int): Total duration of Period Type defined. @@ -390,8 +353,7 @@ class Period(proto.Message): Period Type. """ - duration = proto.Field(proto.INT32, number=1) - + duration = proto.Field(proto.INT32, number=1,) period_type = proto.Field(proto.ENUM, number=2, enum="PeriodType",) diff --git a/google/cloud/channel_v1/types/operations.py b/google/cloud/channel_v1/types/operations.py index 14e305d..daad07d 100644 --- a/google/cloud/channel_v1/types/operations.py +++ b/google/cloud/channel_v1/types/operations.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # - import proto # type: ignore diff --git a/google/cloud/channel_v1/types/products.py b/google/cloud/channel_v1/types/products.py index e057549..6f15a96 100644 --- a/google/cloud/channel_v1/types/products.py +++ b/google/cloud/channel_v1/types/products.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # - import proto # type: ignore @@ -41,8 +39,7 @@ class Product(proto.Message): Marketing information for the product. """ - name = proto.Field(proto.STRING, number=1) - + name = proto.Field(proto.STRING, number=1,) marketing_info = proto.Field(proto.MESSAGE, number=2, message="MarketingInfo",) @@ -62,10 +59,8 @@ class Sku(proto.Message): Product the SKU is associated with. """ - name = proto.Field(proto.STRING, number=1) - + name = proto.Field(proto.STRING, number=1,) marketing_info = proto.Field(proto.MESSAGE, number=2, message="MarketingInfo",) - product = proto.Field(proto.MESSAGE, number=3, message="Product",) @@ -83,16 +78,13 @@ class MarketingInfo(proto.Message): Default logo. """ - display_name = proto.Field(proto.STRING, number=1) - - description = proto.Field(proto.STRING, number=2) - + display_name = proto.Field(proto.STRING, number=1,) + description = proto.Field(proto.STRING, number=2,) default_logo = proto.Field(proto.MESSAGE, number=3, message="Media",) class Media(proto.Message): r"""Represents media information. - Attributes: title (str): Title of the media. @@ -102,10 +94,8 @@ class Media(proto.Message): Type of the media. """ - title = proto.Field(proto.STRING, number=1) - - content = proto.Field(proto.STRING, number=2) - + title = proto.Field(proto.STRING, number=1,) + content = proto.Field(proto.STRING, number=2,) type_ = proto.Field(proto.ENUM, number=3, enum="MediaType",) diff --git a/google/cloud/channel_v1/types/service.py b/google/cloud/channel_v1/types/service.py index 819bf70..fe71563 100644 --- a/google/cloud/channel_v1/types/service.py +++ b/google/cloud/channel_v1/types/service.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,10 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # - import proto # type: ignore - from google.cloud.channel_v1.types import ( channel_partner_links as gcc_channel_partner_links, ) @@ -26,7 +23,7 @@ from google.cloud.channel_v1.types import entitlements as gcc_entitlements from google.cloud.channel_v1.types import offers as gcc_offers from google.cloud.channel_v1.types import products as gcc_products -from google.protobuf import field_mask_pb2 as field_mask # type: ignore +from google.protobuf import field_mask_pb2 # type: ignore __protobuf__ = proto.module( @@ -94,47 +91,42 @@ class CheckCloudIdentityAccountsExistRequest(proto.Message): Attributes: parent (str): - Required. The resource name of the reseller account. The - parent takes the format: accounts/{account_id} + Required. The reseller account's resource name. Parent uses + the format: accounts/{account_id} domain (str): - Required. Domain for which the Cloud Identity - account customer is fetched. + Required. Domain to fetch for Cloud Identity + account customer. """ - parent = proto.Field(proto.STRING, number=1) - - domain = proto.Field(proto.STRING, number=2) + parent = proto.Field(proto.STRING, number=1,) + domain = proto.Field(proto.STRING, number=2,) class CloudIdentityCustomerAccount(proto.Message): - r"""Entity representing a Cloud Identity account which may or may - not be associated with a Channel Services API partner. + r"""Entity representing a Cloud Identity account that may be + associated with a Channel Services API partner. Attributes: existing (bool): - True if a Cloud Identity account exists for a - specific domain. + Returns true if a Cloud Identity account + exists for a specific domain. owned (bool): - True if the Cloud Identity account is - associated with a customer belonging to the - Channel Services partner making the API call. + Returns true if the Cloud Identity account is + associated with a customer of the Channel + Services partner. customer_name (str): - Name of the customer that owns the Cloud Identity account. - This field is populated ONLY if owned = true. The - customer_name takes the format: + 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} customer_cloud_identity_id (str): - Cloud Identity ID of the customer. This field - is populated ONLY if existing = true. + If existing = true, the Cloud Identity ID of + the customer. """ - existing = proto.Field(proto.BOOL, number=1) - - owned = proto.Field(proto.BOOL, number=2) - - customer_name = proto.Field(proto.STRING, number=3) - - customer_cloud_identity_id = proto.Field(proto.STRING, number=4) + existing = proto.Field(proto.BOOL, number=1,) + owned = proto.Field(proto.BOOL, number=2,) + customer_name = proto.Field(proto.STRING, number=3,) + customer_cloud_identity_id = proto.Field(proto.STRING, number=4,) class CheckCloudIdentityAccountsExistResponse(proto.Message): @@ -158,29 +150,26 @@ class ListCustomersRequest(proto.Message): Attributes: parent (str): - Required. The resource name of the reseller account from - which to list customers. The parent takes the format: + Required. The resource name of the reseller account to list + customers from. Parent uses the format: accounts/{account_id}. page_size (int): Optional. The maximum number of customers to return. The service may return fewer than this - value. If unspecified, at most 10 customers will - be returned. The maximum value is 50; values - about 50 will be coerced to 50. + value. If unspecified, returns at most 10 + customers. The maximum value is 50. page_token (str): - Optional. A token identifying a page of results, if other - than the first one. Typically obtained via + 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. """ - parent = proto.Field(proto.STRING, number=1) - - page_size = proto.Field(proto.INT32, number=2) - - page_token = proto.Field(proto.STRING, number=3) + parent = proto.Field(proto.STRING, number=1,) + page_size = proto.Field(proto.INT32, number=2,) + page_token = proto.Field(proto.STRING, number=3,) class ListCustomersResponse(proto.Message): @@ -189,7 +178,7 @@ class ListCustomersResponse(proto.Message): Attributes: customers (Sequence[google.cloud.channel_v1.types.Customer]): - The customers belonging to the reseller or + The customers belonging to a reseller or distributor. next_page_token (str): A token to retrieve the next page of results. Pass to @@ -204,8 +193,7 @@ def raw_page(self): customers = proto.RepeatedField( proto.MESSAGE, number=1, message=gcc_customers.Customer, ) - - next_page_token = proto.Field(proto.STRING, number=2) + next_page_token = proto.Field(proto.STRING, number=2,) class GetCustomerRequest(proto.Message): @@ -214,12 +202,12 @@ class GetCustomerRequest(proto.Message): Attributes: name (str): - Required. The resource name of the customer to retrieve. The - name takes the format: + Required. The resource name of the customer to retrieve. + Name uses the format: accounts/{account_id}/customers/{customer_id} """ - name = proto.Field(proto.STRING, number=1) + name = proto.Field(proto.STRING, number=1,) class CreateCustomerRequest(proto.Message): @@ -229,14 +217,13 @@ class CreateCustomerRequest(proto.Message): Attributes: parent (str): Required. The resource name of reseller account in which to - create the customer. The parent takes the format: + create the customer. Parent uses the format: accounts/{account_id} customer (google.cloud.channel_v1.types.Customer): Required. The customer to create. """ - parent = proto.Field(proto.STRING, number=1) - + parent = proto.Field(proto.STRING, number=1,) customer = proto.Field(proto.MESSAGE, number=2, message=gcc_customers.Customer,) @@ -253,8 +240,9 @@ class UpdateCustomerRequest(proto.Message): """ customer = proto.Field(proto.MESSAGE, number=2, message=gcc_customers.Customer,) - - update_mask = proto.Field(proto.MESSAGE, number=3, message=field_mask.FieldMask,) + update_mask = proto.Field( + proto.MESSAGE, number=3, message=field_mask_pb2.FieldMask, + ) class DeleteCustomerRequest(proto.Message): @@ -267,7 +255,7 @@ class DeleteCustomerRequest(proto.Message): to delete. """ - name = proto.Field(proto.STRING, number=1) + name = proto.Field(proto.STRING, number=1,) class ProvisionCloudIdentityRequest(proto.Message): @@ -283,19 +271,16 @@ class ProvisionCloudIdentityRequest(proto.Message): user (google.cloud.channel_v1.types.AdminUser): Admin user information. validate_only (bool): - If set, validate the request and preview the - review, but do not actually post it. + Validate the request and preview the review, + but do not post it. """ - customer = proto.Field(proto.STRING, number=1) - + customer = proto.Field(proto.STRING, number=1,) cloud_identity_info = proto.Field( proto.MESSAGE, number=2, message=common.CloudIdentityInfo, ) - user = proto.Field(proto.MESSAGE, number=3, message=common.AdminUser,) - - validate_only = proto.Field(proto.BOOL, number=4) + validate_only = proto.Field(proto.BOOL, number=4,) class ListEntitlementsRequest(proto.Message): @@ -305,28 +290,26 @@ class ListEntitlementsRequest(proto.Message): Attributes: parent (str): Required. The resource name of the reseller's customer - account for which to list entitlements. The parent takes the - format: accounts/{account_id}/customers/{customer_id} + account to list entitlements for. Parent uses the format: + accounts/{account_id}/customers/{customer_id} page_size (int): Optional. Requested page size. Server might return fewer results than requested. If - unspecified, at most 50 entitlements will be - returned. The maximum value is 100; values above - 100 will be coerced to 100. + unspecified, return at most 50 entitlements. The + maximum value is 100; the server will coerce + values above 100. page_token (str): - Optional. A token identifying a page of results, if other - than the first one. Typically obtained via + 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. """ - parent = proto.Field(proto.STRING, number=1) - - page_size = proto.Field(proto.INT32, number=2) - - page_token = proto.Field(proto.STRING, number=3) + parent = proto.Field(proto.STRING, number=1,) + page_size = proto.Field(proto.INT32, number=2,) + page_token = proto.Field(proto.STRING, number=3,) class ListEntitlementsResponse(proto.Message): @@ -335,10 +318,9 @@ class ListEntitlementsResponse(proto.Message): Attributes: entitlements (Sequence[google.cloud.channel_v1.types.Entitlement]): - The entitlements belonging to the reseller's - customer. + The reseller customer's entitlements. next_page_token (str): - A token to List next page of results. Pass to + 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. """ @@ -350,8 +332,7 @@ def raw_page(self): entitlements = proto.RepeatedField( proto.MESSAGE, number=1, message=gcc_entitlements.Entitlement, ) - - next_page_token = proto.Field(proto.STRING, number=2) + next_page_token = proto.Field(proto.STRING, number=2,) class ListTransferableSkusRequest(proto.Message): @@ -363,58 +344,52 @@ class ListTransferableSkusRequest(proto.Message): Customer's Cloud Identity ID customer_name (str): A reseller is required to create a customer and use the - resource name of the created customer here. The - customer_name takes the format: + resource name of the created customer here. Customer_name + uses the format: accounts/{account_id}/customers/{customer_id} parent (str): - Required. The resource name of the reseller's account. The - parent takes the format: accounts/{account_id} + Required. The reseller account's resource name. Parent uses + the format: accounts/{account_id} page_size (int): - Requested page size. Server might return - fewer results than requested. If unspecified, at - most 100 SKUs will be returned. The maximum - value is 1000; values above 1000 will be coerced - to 1000. Optional. + 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. page_token (str): - A token identifying a page of results, if other than the - first one. Typically obtained via + 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. auth_token (str): - This token is generated by the Super Admin of - the resold customer to authorize a reseller to + 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. This token can be - omitted once the authorization is generated. See + entitlements on their behalf. You can omit this + token after authorization. See https://support.google.com/a/answer/7643790 for more details. language_code (str): - The BCP-47 language code, such as "en-US". - If specified, the response will be localized to - the corresponding language code. Default is "en- - US". + The BCP-47 language code. For example, "en- + S". The response will localize in the + corresponding language code, if specified. The + default value is "en-US". Optional. """ cloud_identity_id = proto.Field( - proto.STRING, number=4, oneof="transferred_customer_identity" + proto.STRING, number=4, oneof="transferred_customer_identity", ) - customer_name = proto.Field( - proto.STRING, number=7, oneof="transferred_customer_identity" + proto.STRING, number=7, oneof="transferred_customer_identity", ) - - parent = proto.Field(proto.STRING, number=1) - - page_size = proto.Field(proto.INT32, number=2) - - page_token = proto.Field(proto.STRING, number=3) - - auth_token = proto.Field(proto.STRING, number=5) - - language_code = proto.Field(proto.STRING, number=6) + parent = proto.Field(proto.STRING, number=1,) + page_size = proto.Field(proto.INT32, number=2,) + page_token = proto.Field(proto.STRING, number=3,) + auth_token = proto.Field(proto.STRING, number=5,) + language_code = proto.Field(proto.STRING, number=6,) class ListTransferableSkusResponse(proto.Message): @@ -424,7 +399,7 @@ class ListTransferableSkusResponse(proto.Message): Attributes: transferable_skus (Sequence[google.cloud.channel_v1.types.TransferableSku]): Information about existing SKUs for a - customer that would need to be transferred. + customer that needs a transfer. next_page_token (str): A token to retrieve the next page of results. Pass to [ListTransferableSkusRequest.page_token][google.cloud.channel.v1.ListTransferableSkusRequest.page_token] @@ -438,8 +413,7 @@ def raw_page(self): transferable_skus = proto.RepeatedField( proto.MESSAGE, number=1, message=gcc_entitlements.TransferableSku, ) - - next_page_token = proto.Field(proto.STRING, number=2) + next_page_token = proto.Field(proto.STRING, number=2,) class ListTransferableOffersRequest(proto.Message): @@ -451,50 +425,42 @@ class ListTransferableOffersRequest(proto.Message): Customer's Cloud Identity ID customer_name (str): A reseller should create a customer and use - the resource name of the created customer here. + the resource name of that customer here. parent (str): Required. The resource name of the reseller's account. page_size (int): Requested page size. Server might return - fewer results than requested. If unspecified, at - most 100 Offers will be returned. The maximum - value is 1000; values above 1000 will be coerced - to 1000. + fewer results than requested. If unspecified, + returns at most 100 offers. The maximum value is + 1000; the server will coerce values above 1000. page_token (str): - A token identifying a page of results, if other than the - first one. Typically obtained via + 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. sku (str): - Required. SKU for which the Offers are being - looked up. + Required. The SKU to look up Offers for. language_code (str): - The BCP-47 language code, such as "en-US". - If specified, the response will be localized to - the corresponding language code. Default is "en- - US". + The BCP-47 language code. For example, "en- + S". The response will localize in the + corresponding language code, if specified. The + default value is "en-US". """ cloud_identity_id = proto.Field( - proto.STRING, number=4, oneof="transferred_customer_identity" + proto.STRING, number=4, oneof="transferred_customer_identity", ) - customer_name = proto.Field( - proto.STRING, number=5, oneof="transferred_customer_identity" + proto.STRING, number=5, oneof="transferred_customer_identity", ) - - parent = proto.Field(proto.STRING, number=1) - - page_size = proto.Field(proto.INT32, number=2) - - page_token = proto.Field(proto.STRING, number=3) - - sku = proto.Field(proto.STRING, number=6) - - language_code = proto.Field(proto.STRING, number=7) + parent = proto.Field(proto.STRING, number=1,) + page_size = proto.Field(proto.INT32, number=2,) + page_token = proto.Field(proto.STRING, number=3,) + sku = proto.Field(proto.STRING, number=6,) + language_code = proto.Field(proto.STRING, number=7,) class ListTransferableOffersResponse(proto.Message): @@ -518,8 +484,7 @@ def raw_page(self): transferable_offers = proto.RepeatedField( proto.MESSAGE, number=1, message="TransferableOffer", ) - - next_page_token = proto.Field(proto.STRING, number=2) + next_page_token = proto.Field(proto.STRING, number=2,) class TransferableOffer(proto.Message): @@ -542,11 +507,11 @@ class GetEntitlementRequest(proto.Message): Attributes: name (str): Required. The resource name of the entitlement to retrieve. - The name takes the format: - accounts/{account_id}/customers/{customer_id}/entitlements/{id} + Name uses the format: + accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} """ - name = proto.Field(proto.STRING, number=1) + name = proto.Field(proto.STRING, number=1,) class ListChannelPartnerLinksRequest(proto.Message): @@ -556,17 +521,17 @@ class ListChannelPartnerLinksRequest(proto.Message): Attributes: parent (str): Required. The resource name of the reseller account for - listing channel partner links. The parent takes the format: + listing channel partner links. Parent uses the format: accounts/{account_id} page_size (int): 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, values above 200 - will be coerced to 200. + (25). The maximum value is 200; the server will + coerce values above 200. page_token (str): - Optional. A token identifying a page of results, if other - than the first one. Typically obtained via + 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] @@ -576,12 +541,9 @@ class ListChannelPartnerLinksRequest(proto.Message): ChannelPartnerLink will display. """ - parent = proto.Field(proto.STRING, number=1) - - page_size = proto.Field(proto.INT32, number=2) - - page_token = proto.Field(proto.STRING, number=3) - + parent = proto.Field(proto.STRING, number=1,) + page_size = proto.Field(proto.INT32, number=2,) + page_token = proto.Field(proto.STRING, number=3,) view = proto.Field( proto.ENUM, number=4, enum=gcc_channel_partner_links.ChannelPartnerLinkView, ) @@ -607,8 +569,7 @@ def raw_page(self): channel_partner_links = proto.RepeatedField( proto.MESSAGE, number=1, message=gcc_channel_partner_links.ChannelPartnerLink, ) - - next_page_token = proto.Field(proto.STRING, number=2) + next_page_token = proto.Field(proto.STRING, number=2,) class GetChannelPartnerLinkRequest(proto.Message): @@ -618,7 +579,7 @@ class GetChannelPartnerLinkRequest(proto.Message): Attributes: name (str): Required. The resource name of the channel partner link to - retrieve. The name takes the format: + retrieve. Name uses the format: accounts/{account_id}/channelPartnerLinks/{id} where {id} is the Cloud Identity ID of the partner. view (google.cloud.channel_v1.types.ChannelPartnerLinkView): @@ -626,8 +587,7 @@ class GetChannelPartnerLinkRequest(proto.Message): ChannelPartnerLink will display. """ - name = proto.Field(proto.STRING, number=1) - + name = proto.Field(proto.STRING, number=1,) view = proto.Field( proto.ENUM, number=2, enum=gcc_channel_partner_links.ChannelPartnerLinkView, ) @@ -639,17 +599,16 @@ class CreateChannelPartnerLinkRequest(proto.Message): Attributes: parent (str): - Required. The resource name of reseller's account for which - to create a channel partner link. The parent takes the - format: accounts/{account_id} + Required. Create a channel partner link for the provided + reseller account's resource name. Parent uses the format: + accounts/{account_id} channel_partner_link (google.cloud.channel_v1.types.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. """ - parent = proto.Field(proto.STRING, number=1) - + parent = proto.Field(proto.STRING, number=1,) channel_partner_link = proto.Field( proto.MESSAGE, number=2, message=gcc_channel_partner_links.ChannelPartnerLink, ) @@ -662,25 +621,25 @@ class UpdateChannelPartnerLinkRequest(proto.Message): Attributes: name (str): Required. The resource name of the channel partner link to - cancel. The name takes the format: + cancel. Name uses the format: accounts/{account_id}/channelPartnerLinks/{id} where {id} is the Cloud Identity ID of the partner. channel_partner_link (google.cloud.channel_v1.types.ChannelPartnerLink): - Required. The channel partner link to update. Only field - channel_partner_link.link_state is allowed to be updated. + Required. The channel partner link to update. Only + channel_partner_link.link_state is allowed for updates. update_mask (google.protobuf.field_mask_pb2.FieldMask): Required. The update mask that applies to the resource. The - only allowable value for update mask is + only allowable value for an update mask is channel_partner_link.link_state. """ - name = proto.Field(proto.STRING, number=1) - + name = proto.Field(proto.STRING, number=1,) channel_partner_link = proto.Field( proto.MESSAGE, number=2, message=gcc_channel_partner_links.ChannelPartnerLink, ) - - update_mask = proto.Field(proto.MESSAGE, number=3, message=field_mask.FieldMask,) + update_mask = proto.Field( + proto.MESSAGE, number=3, message=field_mask_pb2.FieldMask, + ) class CreateEntitlementRequest(proto.Message): @@ -689,22 +648,21 @@ class CreateEntitlementRequest(proto.Message): Attributes: parent (str): - Required. The resource name of reseller's customer account - in which to create the entitlement. The parent takes the + 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} entitlement (google.cloud.channel_v1.types.Entitlement): Required. The entitlement to create. request_id (str): - Optional. An optional request ID to identify requests. - Specify a unique request ID so that if you must retry your - request, the server will know to ignore the request if it - has already been completed. + 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, consider a situation where 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 the - original operation with the same request ID was received, - and if so, will ignore the second request. + 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 `__ with the @@ -712,13 +670,11 @@ class CreateEntitlementRequest(proto.Message): (``00000000-0000-0000-0000-000000000000``). """ - parent = proto.Field(proto.STRING, number=1) - + parent = proto.Field(proto.STRING, number=1,) entitlement = proto.Field( proto.MESSAGE, number=2, message=gcc_entitlements.Entitlement, ) - - request_id = proto.Field(proto.STRING, number=5) + request_id = proto.Field(proto.STRING, number=5,) class TransferEntitlementsRequest(proto.Message): @@ -727,31 +683,31 @@ class TransferEntitlementsRequest(proto.Message): Attributes: parent (str): - Required. The resource name of reseller's customer account - where the entitlements transfer to. The parent takes 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} entitlements (Sequence[google.cloud.channel_v1.types.Entitlement]): - Required. The new entitlements to be created - or transferred. + Required. The new entitlements to create or + transfer. auth_token (str): - This token is generated by the Super Admin of - the resold customer to authorize a reseller to + 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. This token can be - omitted once the authorization is generated. See + entitlements on their behalf. You can omit this + token after authorization. See https://support.google.com/a/answer/7643790 for more details. request_id (str): - Optional. An optional request ID to identify requests. - Specify a unique request ID so that if you must retry your - request, the server will know to ignore the request if it - has already been completed. + 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, consider a situation where 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 the - original operation with the same request ID was received, - and if so, will ignore the second request. + 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 `__ with the @@ -759,26 +715,22 @@ class TransferEntitlementsRequest(proto.Message): (``00000000-0000-0000-0000-000000000000``). """ - parent = proto.Field(proto.STRING, number=1) - + parent = proto.Field(proto.STRING, number=1,) entitlements = proto.RepeatedField( proto.MESSAGE, number=2, message=gcc_entitlements.Entitlement, ) - - auth_token = proto.Field(proto.STRING, number=4) - - request_id = proto.Field(proto.STRING, number=6) + auth_token = proto.Field(proto.STRING, number=4,) + request_id = proto.Field(proto.STRING, number=6,) class TransferEntitlementsResponse(proto.Message): r"""Response message for [CloudChannelService.TransferEntitlements][google.cloud.channel.v1.CloudChannelService.TransferEntitlements]. - This will be put into the response field of - google.longrunning.Operation. + This is put in the response field of google.longrunning.Operation. Attributes: entitlements (Sequence[google.cloud.channel_v1.types.Entitlement]): - The entitlements that have been transferred. + The transferred entitlements. """ entitlements = proto.RepeatedField( @@ -792,23 +744,22 @@ class TransferEntitlementsToGoogleRequest(proto.Message): Attributes: parent (str): - Required. The resource name of reseller's customer account - where the entitlements transfer from. The parent takes 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} entitlements (Sequence[google.cloud.channel_v1.types.Entitlement]): - Required. The entitlements to be transferred - to Google. + Required. The entitlements to transfer to + Google. request_id (str): - Optional. An optional request ID to identify requests. - Specify a unique request ID so that if you must retry your - request, the server will know to ignore the request if it - has already been completed. + 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, consider a situation where 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 the - original operation with the same request ID was received, - and if so, will ignore the second request. + 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 `__ with the @@ -816,38 +767,33 @@ class TransferEntitlementsToGoogleRequest(proto.Message): (``00000000-0000-0000-0000-000000000000``). """ - parent = proto.Field(proto.STRING, number=1) - + parent = proto.Field(proto.STRING, number=1,) entitlements = proto.RepeatedField( proto.MESSAGE, number=2, message=gcc_entitlements.Entitlement, ) - - request_id = proto.Field(proto.STRING, number=3) + request_id = proto.Field(proto.STRING, number=3,) class ChangeParametersRequest(proto.Message): r"""Request message for [CloudChannelService.ChangeParametersRequest][]. - Attributes: name (str): - Required. The name of the entitlement to update. The name - takes the format: + Required. The name of the entitlement to update. Name uses + the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} parameters (Sequence[google.cloud.channel_v1.types.Parameter]): Required. Entitlement parameters to update. - Only editable parameters are allowed to be - changed. + You can only change editable parameters. request_id (str): - Optional. An optional request ID to identify requests. - Specify a unique request ID so that if you must retry your - request, the server will know to ignore the request if it - has already been completed. + 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, consider a situation where 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 the - original operation with the same request ID was received, - and if so, will ignore the second request. + 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 `__ with the @@ -858,15 +804,12 @@ class ChangeParametersRequest(proto.Message): reseller. """ - name = proto.Field(proto.STRING, number=1) - + name = proto.Field(proto.STRING, number=1,) parameters = proto.RepeatedField( proto.MESSAGE, number=2, message=gcc_entitlements.Parameter, ) - - request_id = proto.Field(proto.STRING, number=4) - - purchase_order_id = proto.Field(proto.STRING, number=5) + request_id = proto.Field(proto.STRING, number=4,) + purchase_order_id = proto.Field(proto.STRING, number=5,) class ChangeRenewalSettingsRequest(proto.Message): @@ -875,22 +818,21 @@ class ChangeRenewalSettingsRequest(proto.Message): Attributes: name (str): - Required. The name of the entitlement to update. The name - takes the format: + Required. The name of the entitlement to update. Name uses + the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} renewal_settings (google.cloud.channel_v1.types.RenewalSettings): Required. New renewal settings. request_id (str): - Optional. A request ID to identify requests. Specify a - unique request ID so that if you must retry your request, - the server will know to ignore the request if it has already - been completed. + 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, consider a situation where 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 the - original operation with the same request ID was received, - and if so, will ignore the second request. + 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 `__ with the @@ -898,13 +840,11 @@ class ChangeRenewalSettingsRequest(proto.Message): (``00000000-0000-0000-0000-000000000000``). """ - name = proto.Field(proto.STRING, number=1) - + name = proto.Field(proto.STRING, number=1,) renewal_settings = proto.Field( proto.MESSAGE, number=4, message=gcc_entitlements.RenewalSettings, ) - - request_id = proto.Field(proto.STRING, number=5) + request_id = proto.Field(proto.STRING, number=5,) class ChangeOfferRequest(proto.Message): @@ -913,7 +853,8 @@ class ChangeOfferRequest(proto.Message): Attributes: name (str): - Required. The name of the entitlement to update. Format: + Required. The resource name of the entitlement to update. + Name uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} offer (str): Required. New Offer. Format: @@ -925,16 +866,15 @@ class ChangeOfferRequest(proto.Message): Optional. Purchase order id provided by the reseller. request_id (str): - Optional. An optional request ID to identify requests. - Specify a unique request ID so that if you must retry your - request, the server will know to ignore the request if it - has already been completed. + 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, consider a situation where 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 the - original operation with the same request ID was received, - and if so, will ignore the second request. + 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 `__ with the @@ -942,17 +882,13 @@ class ChangeOfferRequest(proto.Message): (``00000000-0000-0000-0000-000000000000``). """ - name = proto.Field(proto.STRING, number=1) - - offer = proto.Field(proto.STRING, number=2) - + name = proto.Field(proto.STRING, number=1,) + offer = proto.Field(proto.STRING, number=2,) parameters = proto.RepeatedField( proto.MESSAGE, number=3, message=gcc_entitlements.Parameter, ) - - purchase_order_id = proto.Field(proto.STRING, number=5) - - request_id = proto.Field(proto.STRING, number=6) + purchase_order_id = proto.Field(proto.STRING, number=5,) + request_id = proto.Field(proto.STRING, number=6,) class StartPaidServiceRequest(proto.Message): @@ -961,20 +897,19 @@ class StartPaidServiceRequest(proto.Message): Attributes: name (str): - Required. The name of the entitlement for which paid service - is being started. The name takes the format: + 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} request_id (str): - Optional. An optional request ID to identify requests. - Specify a unique request ID so that if you must retry your - request, the server will know to ignore the request if it - has already been completed. + 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, consider a situation where 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 the - original operation with the same request ID was received, - and if so, will ignore the second request. + 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 `__ with the @@ -982,9 +917,8 @@ class StartPaidServiceRequest(proto.Message): (``00000000-0000-0000-0000-000000000000``). """ - name = proto.Field(proto.STRING, number=1) - - request_id = proto.Field(proto.STRING, number=3) + name = proto.Field(proto.STRING, number=1,) + request_id = proto.Field(proto.STRING, number=3,) class CancelEntitlementRequest(proto.Message): @@ -994,19 +928,18 @@ class CancelEntitlementRequest(proto.Message): Attributes: name (str): Required. The resource name of the entitlement to cancel. - The name takes the format: + Name uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} request_id (str): - Optional. An optional request ID to identify requests. - Specify a unique request ID so that if you must retry your - request, the server will know to ignore the request if it - has already been completed. + 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, consider a situation where 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 the - original operation with the same request ID was received, - and if so, will ignore the second request. + 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 `__ with the @@ -1014,9 +947,8 @@ class CancelEntitlementRequest(proto.Message): (``00000000-0000-0000-0000-000000000000``). """ - name = proto.Field(proto.STRING, number=1) - - request_id = proto.Field(proto.STRING, number=3) + name = proto.Field(proto.STRING, number=1,) + request_id = proto.Field(proto.STRING, number=3,) class SuspendEntitlementRequest(proto.Message): @@ -1026,19 +958,18 @@ class SuspendEntitlementRequest(proto.Message): Attributes: name (str): Required. The resource name of the entitlement to suspend. - The name takes the format: + Name uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} request_id (str): - Optional. An optional request ID to identify requests. - Specify a unique request ID so that if you must retry your - request, the server will know to ignore the request if it - has already been completed. + 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, consider a situation where 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 the - original operation with the same request ID was received, - and if so, will ignore the second request. + 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 `__ with the @@ -1046,9 +977,8 @@ class SuspendEntitlementRequest(proto.Message): (``00000000-0000-0000-0000-000000000000``). """ - name = proto.Field(proto.STRING, number=1) - - request_id = proto.Field(proto.STRING, number=3) + name = proto.Field(proto.STRING, number=1,) + request_id = proto.Field(proto.STRING, number=3,) class ActivateEntitlementRequest(proto.Message): @@ -1058,19 +988,18 @@ class ActivateEntitlementRequest(proto.Message): Attributes: name (str): Required. The resource name of the entitlement to activate. - The name takes the format: + Name uses the format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} request_id (str): - Optional. An optional request ID to identify requests. - Specify a unique request ID so that if you must retry your - request, the server will know to ignore the request if it - has already been completed. + 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, consider a situation where 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 the - original operation with the same request ID was received, - and if so, will ignore the second request. + 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 `__ with the @@ -1078,14 +1007,12 @@ class ActivateEntitlementRequest(proto.Message): (``00000000-0000-0000-0000-000000000000``). """ - name = proto.Field(proto.STRING, number=1) - - request_id = proto.Field(proto.STRING, number=3) + name = proto.Field(proto.STRING, number=1,) + request_id = proto.Field(proto.STRING, number=3,) class ListProductsRequest(proto.Message): r"""Request message for ListProducts. - Attributes: account (str): Required. The resource name of the reseller account. Format: @@ -1093,31 +1020,27 @@ class ListProductsRequest(proto.Message): page_size (int): Optional. Requested page size. Server might return fewer results than requested. If - unspecified, at most 100 Products will be - returned. The maximum value is 1000; values - above 1000 will be coerced to 1000. + unspecified, returns at most 100 Products. The + maximum value is 1000; the server will coerce + values above 1000. page_token (str): - Optional. A token identifying a page of - results, if other than the first one. + Optional. A token for a page of results other + than the first page. language_code (str): - Optional. The BCP-47 language code, such as - "en-US". If specified, the response will be - localized to the corresponding language code. - Default is "en-US". + 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". """ - account = proto.Field(proto.STRING, number=1) - - page_size = proto.Field(proto.INT32, number=2) - - page_token = proto.Field(proto.STRING, number=3) - - language_code = proto.Field(proto.STRING, number=4) + account = proto.Field(proto.STRING, number=1,) + page_size = proto.Field(proto.INT32, number=2,) + page_token = proto.Field(proto.STRING, number=3,) + language_code = proto.Field(proto.STRING, number=4,) class ListProductsResponse(proto.Message): r"""Response message for ListProducts. - Attributes: products (Sequence[google.cloud.channel_v1.types.Product]): List of Products requested. @@ -1132,51 +1055,44 @@ def raw_page(self): products = proto.RepeatedField( proto.MESSAGE, number=1, message=gcc_products.Product, ) - - next_page_token = proto.Field(proto.STRING, number=2) + next_page_token = proto.Field(proto.STRING, number=2,) class ListSkusRequest(proto.Message): r"""Request message for ListSkus. - Attributes: parent (str): - Required. The resource name of the Product for which to list - SKUs. The parent takes the format: products/{product_id}. - Supports products/- to retrieve SKUs for all products. + 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. account (str): Required. Resource name of the reseller. Format: accounts/{account_id}. page_size (int): Optional. Requested page size. Server might return fewer results than requested. If - unspecified, at most 100 SKUs will be returned. - The maximum value is 1000; values above 1000 - will be coerced to 1000. + unspecified, returns at most 100 SKUs. The + maximum value is 1000; the server will coerce + values above 1000. page_token (str): - Optional. A token identifying a page of - results, if other than the first one. Optional. + Optional. A token for a page of results other + than the first page. Optional. language_code (str): - Optional. The BCP-47 language code, such as - "en-US". If specified, the response will be - localized to the corresponding language code. - Default is "en-US". + 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". """ - parent = proto.Field(proto.STRING, number=1) - - account = proto.Field(proto.STRING, number=2) - - page_size = proto.Field(proto.INT32, number=3) - - page_token = proto.Field(proto.STRING, number=4) - - language_code = proto.Field(proto.STRING, number=5) + parent = proto.Field(proto.STRING, number=1,) + account = proto.Field(proto.STRING, number=2,) + page_size = proto.Field(proto.INT32, number=3,) + page_token = proto.Field(proto.STRING, number=4,) + language_code = proto.Field(proto.STRING, number=5,) class ListSkusResponse(proto.Message): r"""Response message for ListSkus. - Attributes: skus (Sequence[google.cloud.channel_v1.types.Sku]): The list of SKUs requested. @@ -1189,55 +1105,48 @@ def raw_page(self): return self skus = proto.RepeatedField(proto.MESSAGE, number=1, message=gcc_products.Sku,) - - next_page_token = proto.Field(proto.STRING, number=2) + next_page_token = proto.Field(proto.STRING, number=2,) class ListOffersRequest(proto.Message): r"""Request message for ListOffers. - Attributes: parent (str): Required. The resource name of the reseller account from - which to list Offers. The parent takes the format: + which to list Offers. Parent uses the format: accounts/{account_id}. page_size (int): Optional. Requested page size. Server might return fewer results than requested. If - unspecified, at most 500 Offers will be - returned. The maximum value is 1000; values - above 1000 will be coerced to 1000. + unspecified, returns at most 500 Offers. The + maximum value is 1000; the server will coerce + values above 1000. page_token (str): - Optional. A token identifying a page of - results, if other than the first one. + Optional. A token for a page of results other + than the first page. filter (str): 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). + 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 language_code (str): - Optional. The BCP-47 language code, such as - "en-US". If specified, the response will be - localized to the corresponding language code. - Default is "en-US". + 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". """ - parent = proto.Field(proto.STRING, number=1) - - page_size = proto.Field(proto.INT32, number=2) - - page_token = proto.Field(proto.STRING, number=3) - - filter = proto.Field(proto.STRING, number=4) - - language_code = proto.Field(proto.STRING, number=5) + parent = proto.Field(proto.STRING, number=1,) + page_size = proto.Field(proto.INT32, number=2,) + page_token = proto.Field(proto.STRING, number=3,) + filter = proto.Field(proto.STRING, number=4,) + language_code = proto.Field(proto.STRING, number=5,) class ListOffersResponse(proto.Message): r"""Response message for ListOffers. - Attributes: offers (Sequence[google.cloud.channel_v1.types.Offer]): The list of Offers requested. @@ -1250,13 +1159,11 @@ def raw_page(self): return self offers = proto.RepeatedField(proto.MESSAGE, number=1, message=gcc_offers.Offer,) - - next_page_token = proto.Field(proto.STRING, number=2) + next_page_token = proto.Field(proto.STRING, number=2,) class ListPurchasableSkusRequest(proto.Message): r"""Request message for ListPurchasableSkus. - Attributes: create_entitlement_purchase (google.cloud.channel_v1.types.ListPurchasableSkusRequest.CreateEntitlementPurchase): List SKUs for CreateEntitlement purchase. @@ -1264,23 +1171,22 @@ class ListPurchasableSkusRequest(proto.Message): List SKUs for ChangeOffer purchase with a new SKU. customer (str): - Required. The resource name of the customer for which to - list SKUs. Format: - accounts/{account_id}/customers/{customer_id}. + Required. The resource name of the customer to list SKUs + for. Format: accounts/{account_id}/customers/{customer_id}. page_size (int): Optional. Requested page size. Server might return fewer results than requested. If - unspecified, at most 100 SKUs will be returned. - The maximum value is 1000; values above 1000 - will be coerced to 1000. + unspecified, returns at most 100 SKUs. The + maximum value is 1000; the server will coerce + values above 1000. page_token (str): - Optional. A token identifying a page of - results, if other than the first one. + Optional. A token for a page of results other + than the first page. language_code (str): - Optional. The BCP-47 language code, such as - "en-US". If specified, the response will be - localized to the corresponding language code. - Default is "en-US". + 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". """ class CreateEntitlementPurchase(proto.Message): @@ -1294,7 +1200,7 @@ class CreateEntitlementPurchase(proto.Message): for all products. """ - product = proto.Field(proto.STRING, number=1) + product = proto.Field(proto.STRING, number=1,) class ChangeOfferPurchase(proto.Message): r"""List SKUs for upgrading or downgrading an entitlement. Make the @@ -1315,8 +1221,7 @@ class ChangeType(proto.Enum): UPGRADE = 1 DOWNGRADE = 2 - entitlement = proto.Field(proto.STRING, number=1) - + entitlement = proto.Field(proto.STRING, number=1,) change_type = proto.Field( proto.ENUM, number=2, @@ -1329,23 +1234,17 @@ class ChangeType(proto.Enum): oneof="purchase_option", message=CreateEntitlementPurchase, ) - change_offer_purchase = proto.Field( proto.MESSAGE, number=3, oneof="purchase_option", message=ChangeOfferPurchase, ) - - customer = proto.Field(proto.STRING, number=1) - - page_size = proto.Field(proto.INT32, number=4) - - page_token = proto.Field(proto.STRING, number=5) - - language_code = proto.Field(proto.STRING, number=6) + customer = proto.Field(proto.STRING, number=1,) + page_size = proto.Field(proto.INT32, number=4,) + page_token = proto.Field(proto.STRING, number=5,) + language_code = proto.Field(proto.STRING, number=6,) class ListPurchasableSkusResponse(proto.Message): r"""Response message for ListPurchasableSkus. - Attributes: purchasable_skus (Sequence[google.cloud.channel_v1.types.PurchasableSku]): The list of SKUs requested. @@ -1360,13 +1259,12 @@ def raw_page(self): purchasable_skus = proto.RepeatedField( proto.MESSAGE, number=1, message="PurchasableSku", ) - - next_page_token = proto.Field(proto.STRING, number=2) + next_page_token = proto.Field(proto.STRING, number=2,) class PurchasableSku(proto.Message): - r"""SKU that can be used for a puchase. This is used in - ListPurchasableSku API response. + r"""SKU that you can purchase. This is used in ListPurchasableSku + API response. Attributes: sku (google.cloud.channel_v1.types.Sku): @@ -1378,59 +1276,54 @@ class PurchasableSku(proto.Message): class ListPurchasableOffersRequest(proto.Message): r"""Request message for ListPurchasableOffers. - Attributes: create_entitlement_purchase (google.cloud.channel_v1.types.ListPurchasableOffersRequest.CreateEntitlementPurchase): List Offers for CreateEntitlement purchase. change_offer_purchase (google.cloud.channel_v1.types.ListPurchasableOffersRequest.ChangeOfferPurchase): List Offers for ChangeOffer purchase. customer (str): - Required. The resource name of the customer for which to - list Offers. Format: - accounts/{account_id}/customers/{customer_id}. + Required. The resource name of the customer to list Offers + for. Format: accounts/{account_id}/customers/{customer_id}. page_size (int): Optional. Requested page size. Server might return fewer results than requested. If - unspecified, at most 100 Offers will be - returned. The maximum value is 1000; values - above 1000 will be coerced to 1000. + unspecified, returns at most 100 Offers. The + maximum value is 1000; the server will coerce + values above 1000. page_token (str): - Optional. A token identifying a page of - results, if other than the first one. + Optional. A token for a page of results other + than the first page. language_code (str): - Optional. The BCP-47 language code, such as - "en-US". If specified, the response will be - localized to the corresponding language code. - Default is "en-US". + 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". """ class CreateEntitlementPurchase(proto.Message): r"""List Offers for CreateEntitlement purchase. - Attributes: sku (str): Required. SKU that the result should be restricted to. Format: products/{product_id}/skus/{sku_id}. """ - sku = proto.Field(proto.STRING, number=1) + sku = proto.Field(proto.STRING, number=1,) class ChangeOfferPurchase(proto.Message): r"""List Offers for ChangeOffer purchase. - Attributes: entitlement (str): Required. Resource name of the entitlement. Format: accounts/{account_id}/customers/{customer_id}/entitlements/{entitlement_id} new_sku (str): - Optional. Resource name of the SKU that is being changed to. - Should be provided if upgrading or downgrading an - entitlement. Format: products/{product_id}/skus/{sku_id} + Optional. Resource name of the new target SKU. Provide this + SKU when upgrading or downgrading an entitlement. Format: + products/{product_id}/skus/{sku_id} """ - entitlement = proto.Field(proto.STRING, number=1) - - new_sku = proto.Field(proto.STRING, number=2) + entitlement = proto.Field(proto.STRING, number=1,) + new_sku = proto.Field(proto.STRING, number=2,) create_entitlement_purchase = proto.Field( proto.MESSAGE, @@ -1438,23 +1331,17 @@ class ChangeOfferPurchase(proto.Message): oneof="purchase_option", message=CreateEntitlementPurchase, ) - change_offer_purchase = proto.Field( proto.MESSAGE, number=3, oneof="purchase_option", message=ChangeOfferPurchase, ) - - customer = proto.Field(proto.STRING, number=1) - - page_size = proto.Field(proto.INT32, number=4) - - page_token = proto.Field(proto.STRING, number=5) - - language_code = proto.Field(proto.STRING, number=6) + customer = proto.Field(proto.STRING, number=1,) + page_size = proto.Field(proto.INT32, number=4,) + page_token = proto.Field(proto.STRING, number=5,) + language_code = proto.Field(proto.STRING, number=6,) class ListPurchasableOffersResponse(proto.Message): r"""Response message for ListPurchasableOffers. - Attributes: purchasable_offers (Sequence[google.cloud.channel_v1.types.PurchasableOffer]): The list of Offers requested. @@ -1469,13 +1356,12 @@ def raw_page(self): purchasable_offers = proto.RepeatedField( proto.MESSAGE, number=1, message="PurchasableOffer", ) - - next_page_token = proto.Field(proto.STRING, number=2) + next_page_token = proto.Field(proto.STRING, number=2,) class PurchasableOffer(proto.Message): - r"""Offer that can be puchased for a customer. This is used in - ListPurchasableOffer API response. + r"""Offer that you can purchase for a customer. This is used in + the ListPurchasableOffer API response. Attributes: offer (google.cloud.channel_v1.types.Offer): @@ -1487,74 +1373,65 @@ class PurchasableOffer(proto.Message): class RegisterSubscriberRequest(proto.Message): r"""Request Message for RegisterSubscriber. - Attributes: account (str): Required. Resource name of the account. service_account (str): - Required. Service account which will provide + Required. Service account that provides subscriber access to the registered topic. """ - account = proto.Field(proto.STRING, number=1) - - service_account = proto.Field(proto.STRING, number=2) + account = proto.Field(proto.STRING, number=1,) + service_account = proto.Field(proto.STRING, number=2,) class RegisterSubscriberResponse(proto.Message): r"""Response Message for RegisterSubscriber. - Attributes: topic (str): - Name of the topic to which the subscriber - will listen to. + Name of the topic the subscriber will listen + to. """ - topic = proto.Field(proto.STRING, number=1) + topic = proto.Field(proto.STRING, number=1,) class UnregisterSubscriberRequest(proto.Message): r"""Request Message for UnregisterSubscriber. - Attributes: account (str): Required. Resource name of the account. service_account (str): - Required. Service account which will be - unregistered from getting subscriber access to - the topic. + Required. Service account to unregister from + subscriber access to the topic. """ - account = proto.Field(proto.STRING, number=1) - - service_account = proto.Field(proto.STRING, number=2) + account = proto.Field(proto.STRING, number=1,) + service_account = proto.Field(proto.STRING, number=2,) class UnregisterSubscriberResponse(proto.Message): r"""Response Message for UnregisterSubscriber. - Attributes: topic (str): - Name of the topic from which the service - account subscriber access has been removed. + Name of the topic the service account + subscriber access was removed from. """ - topic = proto.Field(proto.STRING, number=1) + topic = proto.Field(proto.STRING, number=1,) class ListSubscribersRequest(proto.Message): r"""Request Message for ListSubscribers. - Attributes: account (str): Required. Resource name of the account. page_size (int): Optional. The maximum number of service accounts to return. The service may return fewer - than this value. If unspecified, at most 100 - service accounts will be returned. The maximum - value is 1000; values above 1000 will be coerced - to 1000. + than this value. If unspecified, returns at most + 100 service accounts. The maximum value is 1000; + the server will coerce values above 1000. page_token (str): Optional. A page token, received from a previous ``ListSubscribers`` call. Provide this to retrieve the @@ -1565,16 +1442,13 @@ class ListSubscribersRequest(proto.Message): page token. """ - account = proto.Field(proto.STRING, number=1) - - page_size = proto.Field(proto.INT32, number=2) - - page_token = proto.Field(proto.STRING, number=3) + account = proto.Field(proto.STRING, number=1,) + page_size = proto.Field(proto.INT32, number=2,) + page_token = proto.Field(proto.STRING, number=3,) class ListSubscribersResponse(proto.Message): r"""Response Message for ListSubscribers. - Attributes: topic (str): Name of the topic registered with the @@ -1592,11 +1466,9 @@ class ListSubscribersResponse(proto.Message): def raw_page(self): return self - topic = proto.Field(proto.STRING, number=1) - - service_accounts = proto.RepeatedField(proto.STRING, number=2) - - next_page_token = proto.Field(proto.STRING, number=3) + topic = proto.Field(proto.STRING, number=1,) + service_accounts = proto.RepeatedField(proto.STRING, number=2,) + next_page_token = proto.Field(proto.STRING, number=3,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/channel_v1/types/subscriber_event.py b/google/cloud/channel_v1/types/subscriber_event.py index ff51579..5e95493 100644 --- a/google/cloud/channel_v1/types/subscriber_event.py +++ b/google/cloud/channel_v1/types/subscriber_event.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,7 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # - import proto # type: ignore @@ -39,9 +37,10 @@ class CustomerEvent(proto.Message): class Type(proto.Enum): r"""Type of customer event.""" TYPE_UNSPECIFIED = 0 + PRIMARY_DOMAIN_CHANGED = 1 + PRIMARY_DOMAIN_VERIFIED = 2 - customer = proto.Field(proto.STRING, number=1) - + customer = proto.Field(proto.STRING, number=1,) event_type = proto.Field(proto.ENUM, number=2, enum=Type,) @@ -73,8 +72,7 @@ class Type(proto.Enum): PAID_SERVICE_STARTED = 11 LICENSE_ASSIGNMENT_CHANGED = 12 - entitlement = proto.Field(proto.STRING, number=1) - + entitlement = proto.Field(proto.STRING, number=1,) event_type = proto.Field(proto.ENUM, number=2, enum=Type,) @@ -94,7 +92,6 @@ class SubscriberEvent(proto.Message): customer_event = proto.Field( proto.MESSAGE, number=1, oneof="event", message="CustomerEvent", ) - entitlement_event = proto.Field( proto.MESSAGE, number=2, oneof="event", message="EntitlementEvent", ) diff --git a/noxfile.py b/noxfile.py index af50a60..94ee6a8 100644 --- a/noxfile.py +++ b/noxfile.py @@ -62,16 +62,9 @@ def lint(session): session.run("flake8", "google", "tests") -@nox.session(python="3.6") +@nox.session(python=DEFAULT_PYTHON_VERSION) def blacken(session): - """Run black. - - Format code to uniform standard. - - This currently uses Python 3.6 due to the automated Kokoro run of synthtool. - That run uses an image that doesn't have 3.6 installed. Before updating this - check the state of the `gcp_ubuntu_config` we use for that Kokoro run. - """ + """Run black. Format code to uniform standard.""" session.install(BLACK_VERSION) session.run( "black", *BLACK_PATHS, @@ -131,9 +124,6 @@ def system(session): # Check the value of `RUN_SYSTEM_TESTS` env var. It defaults to true. if os.environ.get("RUN_SYSTEM_TESTS", "true") == "false": session.skip("RUN_SYSTEM_TESTS is set to false, skipping") - # Sanity check: Only run tests if the environment variable is set. - if not os.environ.get("GOOGLE_APPLICATION_CREDENTIALS", ""): - session.skip("Credentials must be set via environment variable") # Install pyopenssl for mTLS testing. if os.environ.get("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true": session.install("pyopenssl") @@ -189,7 +179,7 @@ def docs(session): """Build the docs for this library.""" session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark") + session.install("sphinx==4.0.1", "alabaster", "recommonmark") shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( @@ -211,7 +201,9 @@ def docfx(session): """Build the docfx yaml files for this library.""" session.install("-e", ".") - session.install("sphinx", "alabaster", "recommonmark", "gcp-sphinx-docfx-yaml") + session.install( + "sphinx==4.0.1", "alabaster", "recommonmark", "gcp-sphinx-docfx-yaml" + ) shutil.rmtree(os.path.join("docs", "_build"), ignore_errors=True) session.run( diff --git a/renovate.json b/renovate.json index f08bc22..c048955 100644 --- a/renovate.json +++ b/renovate.json @@ -2,5 +2,8 @@ "extends": [ "config:base", ":preserveSemverRanges" ], - "ignorePaths": [".pre-commit-config.yaml"] + "ignorePaths": [".pre-commit-config.yaml"], + "pip_requirements": { + "fileMatch": ["requirements-test.txt", "samples/[\\S/]*constraints.txt", "samples/[\\S/]*constraints-test.txt"] + } } diff --git a/scripts/fixup_channel_v1_keywords.py b/scripts/fixup_channel_v1_keywords.py index 7324026..bb71227 100644 --- a/scripts/fixup_channel_v1_keywords.py +++ b/scripts/fixup_channel_v1_keywords.py @@ -1,6 +1,5 @@ #! /usr/bin/env python3 # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -15,7 +14,6 @@ # See the License for the specific language governing permissions and # limitations under the License. # - import argparse import os import libcst as cst @@ -41,40 +39,39 @@ def partition( class channelCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { - 'activate_entitlement': ('name', 'request_id', ), - 'cancel_entitlement': ('name', 'request_id', ), - 'change_offer': ('name', 'offer', 'parameters', 'purchase_order_id', 'request_id', ), - 'change_parameters': ('name', 'parameters', 'request_id', 'purchase_order_id', ), - 'change_renewal_settings': ('name', 'renewal_settings', 'request_id', ), - 'check_cloud_identity_accounts_exist': ('parent', 'domain', ), - 'create_channel_partner_link': ('parent', 'channel_partner_link', ), - 'create_customer': ('parent', 'customer', ), - 'create_entitlement': ('parent', 'entitlement', 'request_id', ), - 'delete_customer': ('name', ), - 'get_channel_partner_link': ('name', 'view', ), - 'get_customer': ('name', ), - 'get_entitlement': ('name', ), - 'list_channel_partner_links': ('parent', 'page_size', 'page_token', 'view', ), - 'list_customers': ('parent', 'page_size', 'page_token', ), - 'list_entitlements': ('parent', 'page_size', 'page_token', ), - 'list_offers': ('parent', 'page_size', 'page_token', 'filter', 'language_code', ), - 'list_products': ('account', 'page_size', 'page_token', 'language_code', ), - 'list_purchasable_offers': ('customer', 'create_entitlement_purchase', 'change_offer_purchase', 'page_size', 'page_token', 'language_code', ), - 'list_purchasable_skus': ('customer', 'create_entitlement_purchase', 'change_offer_purchase', 'page_size', 'page_token', 'language_code', ), - 'list_skus': ('parent', 'account', 'page_size', 'page_token', 'language_code', ), - 'list_subscribers': ('account', 'page_size', 'page_token', ), - 'list_transferable_offers': ('parent', 'sku', 'cloud_identity_id', 'customer_name', 'page_size', 'page_token', 'language_code', ), - 'list_transferable_skus': ('parent', 'cloud_identity_id', 'customer_name', 'page_size', 'page_token', 'auth_token', 'language_code', ), - 'provision_cloud_identity': ('customer', 'cloud_identity_info', 'user', 'validate_only', ), - 'register_subscriber': ('account', 'service_account', ), - 'start_paid_service': ('name', 'request_id', ), - 'suspend_entitlement': ('name', 'request_id', ), - 'transfer_entitlements': ('parent', 'entitlements', 'auth_token', 'request_id', ), - 'transfer_entitlements_to_google': ('parent', 'entitlements', 'request_id', ), - 'unregister_subscriber': ('account', 'service_account', ), - 'update_channel_partner_link': ('name', 'channel_partner_link', 'update_mask', ), - 'update_customer': ('customer', 'update_mask', ), - + 'activate_entitlement': ('name', 'request_id', ), + 'cancel_entitlement': ('name', 'request_id', ), + 'change_offer': ('name', 'offer', 'parameters', 'purchase_order_id', 'request_id', ), + 'change_parameters': ('name', 'parameters', 'request_id', 'purchase_order_id', ), + 'change_renewal_settings': ('name', 'renewal_settings', 'request_id', ), + 'check_cloud_identity_accounts_exist': ('parent', 'domain', ), + 'create_channel_partner_link': ('parent', 'channel_partner_link', ), + 'create_customer': ('parent', 'customer', ), + 'create_entitlement': ('parent', 'entitlement', 'request_id', ), + 'delete_customer': ('name', ), + 'get_channel_partner_link': ('name', 'view', ), + 'get_customer': ('name', ), + 'get_entitlement': ('name', ), + 'list_channel_partner_links': ('parent', 'page_size', 'page_token', 'view', ), + 'list_customers': ('parent', 'page_size', 'page_token', ), + 'list_entitlements': ('parent', 'page_size', 'page_token', ), + 'list_offers': ('parent', 'page_size', 'page_token', 'filter', 'language_code', ), + 'list_products': ('account', 'page_size', 'page_token', 'language_code', ), + 'list_purchasable_offers': ('customer', 'create_entitlement_purchase', 'change_offer_purchase', 'page_size', 'page_token', 'language_code', ), + 'list_purchasable_skus': ('customer', 'create_entitlement_purchase', 'change_offer_purchase', 'page_size', 'page_token', 'language_code', ), + 'list_skus': ('parent', 'account', 'page_size', 'page_token', 'language_code', ), + 'list_subscribers': ('account', 'page_size', 'page_token', ), + 'list_transferable_offers': ('parent', 'sku', 'cloud_identity_id', 'customer_name', 'page_size', 'page_token', 'language_code', ), + 'list_transferable_skus': ('parent', 'cloud_identity_id', 'customer_name', 'page_size', 'page_token', 'auth_token', 'language_code', ), + 'provision_cloud_identity': ('customer', 'cloud_identity_info', 'user', 'validate_only', ), + 'register_subscriber': ('account', 'service_account', ), + 'start_paid_service': ('name', 'request_id', ), + 'suspend_entitlement': ('name', 'request_id', ), + 'transfer_entitlements': ('parent', 'entitlements', 'auth_token', 'request_id', ), + 'transfer_entitlements_to_google': ('parent', 'entitlements', 'request_id', ), + 'unregister_subscriber': ('account', 'service_account', ), + 'update_channel_partner_link': ('name', 'channel_partner_link', 'update_mask', ), + 'update_customer': ('customer', 'update_mask', ), } def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: @@ -105,7 +102,7 @@ def leave_Call(self, original: cst.Call, updated: cst.Call) -> cst.CSTNode: value=cst.Dict([ cst.DictElement( cst.SimpleString("'{}'".format(name)), - cst.Element(value=arg.value) +cst.Element(value=arg.value) ) # Note: the args + kwargs looks silly, but keep in mind that # the control parameters had to be stripped out, and that diff --git a/setup.py b/setup.py index 92b6c5f..b83e47a 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ import os import setuptools # type: ignore -version = "0.2.1" +version = "0.3.0" package_root = os.path.abspath(os.path.dirname(__file__)) @@ -43,6 +43,7 @@ install_requires=( "google-api-core[grpc] >= 1.22.2, < 2.0.0dev", "proto-plus >= 1.4.0", + "packaging >= 14.3", ), python_requires=">=3.6", classifiers=[ diff --git a/testing/constraints-3.6.txt b/testing/constraints-3.6.txt index 650f2c5..a85c4a1 100644 --- a/testing/constraints-3.6.txt +++ b/testing/constraints-3.6.txt @@ -21,3 +21,4 @@ # Then this file should have foo==1.14.0 google-api-core==1.22.2 proto-plus==1.4.0 +packaging==14.3 diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000..4de6597 --- /dev/null +++ b/tests/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py new file mode 100644 index 0000000..4de6597 --- /dev/null +++ b/tests/unit/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/tests/unit/gapic/__init__.py b/tests/unit/gapic/__init__.py new file mode 100644 index 0000000..4de6597 --- /dev/null +++ b/tests/unit/gapic/__init__.py @@ -0,0 +1,15 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# diff --git a/tests/unit/gapic/channel_v1/__init__.py b/tests/unit/gapic/channel_v1/__init__.py index 42ffdf2..4de6597 100644 --- a/tests/unit/gapic/channel_v1/__init__.py +++ b/tests/unit/gapic/channel_v1/__init__.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/tests/unit/gapic/channel_v1/test_cloud_channel_service.py b/tests/unit/gapic/channel_v1/test_cloud_channel_service.py index a593db5..e14cca5 100644 --- a/tests/unit/gapic/channel_v1/test_cloud_channel_service.py +++ b/tests/unit/gapic/channel_v1/test_cloud_channel_service.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- - # Copyright 2020 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -14,9 +13,9 @@ # See the License for the specific language governing permissions and # limitations under the License. # - import os import mock +import packaging.version import grpc from grpc.experimental import aio @@ -24,16 +23,16 @@ import pytest from proto.marshal.rules.dates import DurationRule, TimestampRule -from google import auth + from google.api_core import client_options -from google.api_core import exceptions +from google.api_core import exceptions as core_exceptions from google.api_core import future from google.api_core import gapic_v1 from google.api_core import grpc_helpers from google.api_core import grpc_helpers_async from google.api_core import operation_async # type: ignore from google.api_core import operations_v1 -from google.auth import credentials +from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError from google.cloud.channel_v1.services.cloud_channel_service import ( CloudChannelServiceAsyncClient, @@ -43,6 +42,12 @@ ) from google.cloud.channel_v1.services.cloud_channel_service import pagers from google.cloud.channel_v1.services.cloud_channel_service import transports +from google.cloud.channel_v1.services.cloud_channel_service.transports.base import ( + _API_CORE_VERSION, +) +from google.cloud.channel_v1.services.cloud_channel_service.transports.base import ( + _GOOGLE_AUTH_VERSION, +) from google.cloud.channel_v1.types import channel_partner_links from google.cloud.channel_v1.types import common from google.cloud.channel_v1.types import customers @@ -53,10 +58,34 @@ from google.cloud.channel_v1.types import service from google.longrunning import operations_pb2 from google.oauth2 import service_account -from google.protobuf import any_pb2 as gp_any # type: ignore -from google.protobuf import field_mask_pb2 as field_mask # type: ignore -from google.protobuf import timestamp_pb2 as timestamp # type: ignore -from google.type import postal_address_pb2 as postal_address # type: ignore +from google.protobuf import any_pb2 # type: ignore +from google.protobuf import field_mask_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore +from google.type import postal_address_pb2 # type: ignore +import google.auth + + +# TODO(busunkim): Once google-api-core >= 1.26.0 is required: +# - Delete all the api-core and auth "less than" test cases +# - Delete these pytest markers (Make the "greater than or equal to" tests the default). +requires_google_auth_lt_1_25_0 = pytest.mark.skipif( + packaging.version.parse(_GOOGLE_AUTH_VERSION) >= packaging.version.parse("1.25.0"), + reason="This test requires google-auth < 1.25.0", +) +requires_google_auth_gte_1_25_0 = pytest.mark.skipif( + packaging.version.parse(_GOOGLE_AUTH_VERSION) < packaging.version.parse("1.25.0"), + reason="This test requires google-auth >= 1.25.0", +) + +requires_api_core_lt_1_26_0 = pytest.mark.skipif( + packaging.version.parse(_API_CORE_VERSION) >= packaging.version.parse("1.26.0"), + reason="This test requires google-api-core < 1.26.0", +) + +requires_api_core_gte_1_26_0 = pytest.mark.skipif( + packaging.version.parse(_API_CORE_VERSION) < packaging.version.parse("1.26.0"), + reason="This test requires google-api-core >= 1.26.0", +) def client_cert_source_callback(): @@ -108,7 +137,7 @@ def test__get_default_mtls_endpoint(): "client_class", [CloudChannelServiceClient, CloudChannelServiceAsyncClient,] ) def test_cloud_channel_service_client_from_service_account_info(client_class): - creds = credentials.AnonymousCredentials() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: @@ -125,7 +154,7 @@ def test_cloud_channel_service_client_from_service_account_info(client_class): "client_class", [CloudChannelServiceClient, CloudChannelServiceAsyncClient,] ) def test_cloud_channel_service_client_from_service_account_file(client_class): - creds = credentials.AnonymousCredentials() + creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: @@ -182,7 +211,7 @@ def test_cloud_channel_service_client_client_options( ): # Check that if channel is provided we won't create a new one. with mock.patch.object(CloudChannelServiceClient, "get_transport_class") as gtc: - transport = transport_class(credentials=credentials.AnonymousCredentials()) + transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() @@ -488,7 +517,7 @@ def test_list_customers( transport: str = "grpc", request_type=service.ListCustomersRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -501,19 +530,15 @@ def test_list_customers( call.return_value = service.ListCustomersResponse( next_page_token="next_page_token_value", ) - response = client.list_customers(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.ListCustomersRequest() # Establish that the response is the type that we expect. - assert isinstance(response, pagers.ListCustomersPager) - assert response.next_page_token == "next_page_token_value" @@ -525,7 +550,7 @@ def test_list_customers_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -533,7 +558,6 @@ def test_list_customers_empty_call(): client.list_customers() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.ListCustomersRequest() @@ -542,7 +566,7 @@ async def test_list_customers_async( transport: str = "grpc_asyncio", request_type=service.ListCustomersRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -555,18 +579,15 @@ async def test_list_customers_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.ListCustomersResponse(next_page_token="next_page_token_value",) ) - response = await client.list_customers(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.ListCustomersRequest() # Establish that the response is the type that we expect. assert isinstance(response, pagers.ListCustomersAsyncPager) - assert response.next_page_token == "next_page_token_value" @@ -576,17 +597,19 @@ async def test_list_customers_async_from_dict(): def test_list_customers_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ListCustomersRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_customers), "__call__") as call: call.return_value = service.ListCustomersResponse() - client.list_customers(request) # Establish that the underlying gRPC stub method was called. @@ -602,12 +625,13 @@ def test_list_customers_field_headers(): @pytest.mark.asyncio async def test_list_customers_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ListCustomersRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -615,7 +639,6 @@ async def test_list_customers_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.ListCustomersResponse() ) - await client.list_customers(request) # Establish that the underlying gRPC stub method was called. @@ -629,7 +652,7 @@ async def test_list_customers_field_headers_async(): def test_list_customers_pager(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_customers), "__call__") as call: @@ -667,7 +690,7 @@ def test_list_customers_pager(): def test_list_customers_pages(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_customers), "__call__") as call: @@ -698,7 +721,7 @@ def test_list_customers_pages(): @pytest.mark.asyncio async def test_list_customers_async_pager(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -737,7 +760,7 @@ async def test_list_customers_async_pager(): @pytest.mark.asyncio async def test_list_customers_async_pages(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -772,7 +795,7 @@ async def test_list_customers_async_pages(): def test_get_customer(transport: str = "grpc", request_type=service.GetCustomerRequest): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -791,31 +814,21 @@ def test_get_customer(transport: str = "grpc", request_type=service.GetCustomerR language_code="language_code_value", channel_partner_id="channel_partner_id_value", ) - response = client.get_customer(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.GetCustomerRequest() # Establish that the response is the type that we expect. - assert isinstance(response, customers.Customer) - assert response.name == "name_value" - assert response.org_display_name == "org_display_name_value" - assert response.alternate_email == "alternate_email_value" - assert response.domain == "domain_value" - assert response.cloud_identity_id == "cloud_identity_id_value" - assert response.language_code == "language_code_value" - assert response.channel_partner_id == "channel_partner_id_value" @@ -827,7 +840,7 @@ def test_get_customer_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -835,7 +848,6 @@ def test_get_customer_empty_call(): client.get_customer() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.GetCustomerRequest() @@ -844,7 +856,7 @@ async def test_get_customer_async( transport: str = "grpc_asyncio", request_type=service.GetCustomerRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -865,30 +877,21 @@ async def test_get_customer_async( channel_partner_id="channel_partner_id_value", ) ) - response = await client.get_customer(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.GetCustomerRequest() # Establish that the response is the type that we expect. assert isinstance(response, customers.Customer) - assert response.name == "name_value" - assert response.org_display_name == "org_display_name_value" - assert response.alternate_email == "alternate_email_value" - assert response.domain == "domain_value" - assert response.cloud_identity_id == "cloud_identity_id_value" - assert response.language_code == "language_code_value" - assert response.channel_partner_id == "channel_partner_id_value" @@ -898,17 +901,19 @@ async def test_get_customer_async_from_dict(): def test_get_customer_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.GetCustomerRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_customer), "__call__") as call: call.return_value = customers.Customer() - client.get_customer(request) # Establish that the underlying gRPC stub method was called. @@ -924,18 +929,18 @@ def test_get_customer_field_headers(): @pytest.mark.asyncio async def test_get_customer_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.GetCustomerRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_customer), "__call__") as call: call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(customers.Customer()) - await client.get_customer(request) # Establish that the underlying gRPC stub method was called. @@ -949,13 +954,14 @@ async def test_get_customer_field_headers_async(): def test_get_customer_flattened(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_customer), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = customers.Customer() - # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.get_customer(name="name_value",) @@ -964,12 +970,13 @@ def test_get_customer_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" def test_get_customer_flattened_error(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -982,7 +989,7 @@ def test_get_customer_flattened_error(): @pytest.mark.asyncio async def test_get_customer_flattened_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -999,14 +1006,13 @@ async def test_get_customer_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" @pytest.mark.asyncio async def test_get_customer_flattened_error_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1021,7 +1027,7 @@ def test_check_cloud_identity_accounts_exist( transport: str = "grpc", request_type=service.CheckCloudIdentityAccountsExistRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1034,17 +1040,14 @@ def test_check_cloud_identity_accounts_exist( ) as call: # Designate an appropriate return value for the call. call.return_value = service.CheckCloudIdentityAccountsExistResponse() - response = client.check_cloud_identity_accounts_exist(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.CheckCloudIdentityAccountsExistRequest() # Establish that the response is the type that we expect. - assert isinstance(response, service.CheckCloudIdentityAccountsExistResponse) @@ -1056,7 +1059,7 @@ def test_check_cloud_identity_accounts_exist_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1066,7 +1069,6 @@ def test_check_cloud_identity_accounts_exist_empty_call(): client.check_cloud_identity_accounts_exist() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.CheckCloudIdentityAccountsExistRequest() @@ -1076,7 +1078,7 @@ async def test_check_cloud_identity_accounts_exist_async( request_type=service.CheckCloudIdentityAccountsExistRequest, ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1091,13 +1093,11 @@ async def test_check_cloud_identity_accounts_exist_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.CheckCloudIdentityAccountsExistResponse() ) - response = await client.check_cloud_identity_accounts_exist(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.CheckCloudIdentityAccountsExistRequest() # Establish that the response is the type that we expect. @@ -1110,11 +1110,14 @@ async def test_check_cloud_identity_accounts_exist_async_from_dict(): def test_check_cloud_identity_accounts_exist_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.CheckCloudIdentityAccountsExistRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -1122,7 +1125,6 @@ def test_check_cloud_identity_accounts_exist_field_headers(): type(client.transport.check_cloud_identity_accounts_exist), "__call__" ) as call: call.return_value = service.CheckCloudIdentityAccountsExistResponse() - client.check_cloud_identity_accounts_exist(request) # Establish that the underlying gRPC stub method was called. @@ -1138,12 +1140,13 @@ def test_check_cloud_identity_accounts_exist_field_headers(): @pytest.mark.asyncio async def test_check_cloud_identity_accounts_exist_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.CheckCloudIdentityAccountsExistRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -1153,7 +1156,6 @@ async def test_check_cloud_identity_accounts_exist_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.CheckCloudIdentityAccountsExistResponse() ) - await client.check_cloud_identity_accounts_exist(request) # Establish that the underlying gRPC stub method was called. @@ -1170,7 +1172,7 @@ def test_create_customer( transport: str = "grpc", request_type=service.CreateCustomerRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1189,31 +1191,21 @@ def test_create_customer( language_code="language_code_value", channel_partner_id="channel_partner_id_value", ) - response = client.create_customer(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.CreateCustomerRequest() # Establish that the response is the type that we expect. - assert isinstance(response, customers.Customer) - assert response.name == "name_value" - assert response.org_display_name == "org_display_name_value" - assert response.alternate_email == "alternate_email_value" - assert response.domain == "domain_value" - assert response.cloud_identity_id == "cloud_identity_id_value" - assert response.language_code == "language_code_value" - assert response.channel_partner_id == "channel_partner_id_value" @@ -1225,7 +1217,7 @@ def test_create_customer_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1233,7 +1225,6 @@ def test_create_customer_empty_call(): client.create_customer() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.CreateCustomerRequest() @@ -1242,7 +1233,7 @@ async def test_create_customer_async( transport: str = "grpc_asyncio", request_type=service.CreateCustomerRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1263,30 +1254,21 @@ async def test_create_customer_async( channel_partner_id="channel_partner_id_value", ) ) - response = await client.create_customer(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.CreateCustomerRequest() # Establish that the response is the type that we expect. assert isinstance(response, customers.Customer) - assert response.name == "name_value" - assert response.org_display_name == "org_display_name_value" - assert response.alternate_email == "alternate_email_value" - assert response.domain == "domain_value" - assert response.cloud_identity_id == "cloud_identity_id_value" - assert response.language_code == "language_code_value" - assert response.channel_partner_id == "channel_partner_id_value" @@ -1296,17 +1278,19 @@ async def test_create_customer_async_from_dict(): def test_create_customer_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.CreateCustomerRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_customer), "__call__") as call: call.return_value = customers.Customer() - client.create_customer(request) # Establish that the underlying gRPC stub method was called. @@ -1322,18 +1306,18 @@ def test_create_customer_field_headers(): @pytest.mark.asyncio async def test_create_customer_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.CreateCustomerRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_customer), "__call__") as call: call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(customers.Customer()) - await client.create_customer(request) # Establish that the underlying gRPC stub method was called. @@ -1350,7 +1334,7 @@ def test_update_customer( transport: str = "grpc", request_type=service.UpdateCustomerRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1369,31 +1353,21 @@ def test_update_customer( language_code="language_code_value", channel_partner_id="channel_partner_id_value", ) - response = client.update_customer(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.UpdateCustomerRequest() # Establish that the response is the type that we expect. - assert isinstance(response, customers.Customer) - assert response.name == "name_value" - assert response.org_display_name == "org_display_name_value" - assert response.alternate_email == "alternate_email_value" - assert response.domain == "domain_value" - assert response.cloud_identity_id == "cloud_identity_id_value" - assert response.language_code == "language_code_value" - assert response.channel_partner_id == "channel_partner_id_value" @@ -1405,7 +1379,7 @@ def test_update_customer_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1413,7 +1387,6 @@ def test_update_customer_empty_call(): client.update_customer() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.UpdateCustomerRequest() @@ -1422,7 +1395,7 @@ async def test_update_customer_async( transport: str = "grpc_asyncio", request_type=service.UpdateCustomerRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1443,30 +1416,21 @@ async def test_update_customer_async( channel_partner_id="channel_partner_id_value", ) ) - response = await client.update_customer(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.UpdateCustomerRequest() # Establish that the response is the type that we expect. assert isinstance(response, customers.Customer) - assert response.name == "name_value" - assert response.org_display_name == "org_display_name_value" - assert response.alternate_email == "alternate_email_value" - assert response.domain == "domain_value" - assert response.cloud_identity_id == "cloud_identity_id_value" - assert response.language_code == "language_code_value" - assert response.channel_partner_id == "channel_partner_id_value" @@ -1476,17 +1440,19 @@ async def test_update_customer_async_from_dict(): def test_update_customer_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.UpdateCustomerRequest() + request.customer.name = "customer.name/value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_customer), "__call__") as call: call.return_value = customers.Customer() - client.update_customer(request) # Establish that the underlying gRPC stub method was called. @@ -1504,18 +1470,18 @@ def test_update_customer_field_headers(): @pytest.mark.asyncio async def test_update_customer_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.UpdateCustomerRequest() + request.customer.name = "customer.name/value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_customer), "__call__") as call: call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(customers.Customer()) - await client.update_customer(request) # Establish that the underlying gRPC stub method was called. @@ -1534,7 +1500,7 @@ def test_delete_customer( transport: str = "grpc", request_type=service.DeleteCustomerRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1545,13 +1511,11 @@ def test_delete_customer( with mock.patch.object(type(client.transport.delete_customer), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = None - response = client.delete_customer(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.DeleteCustomerRequest() # Establish that the response is the type that we expect. @@ -1566,7 +1530,7 @@ def test_delete_customer_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1574,7 +1538,6 @@ def test_delete_customer_empty_call(): client.delete_customer() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.DeleteCustomerRequest() @@ -1583,7 +1546,7 @@ async def test_delete_customer_async( transport: str = "grpc_asyncio", request_type=service.DeleteCustomerRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1594,13 +1557,11 @@ async def test_delete_customer_async( with mock.patch.object(type(client.transport.delete_customer), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - response = await client.delete_customer(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.DeleteCustomerRequest() # Establish that the response is the type that we expect. @@ -1613,17 +1574,19 @@ async def test_delete_customer_async_from_dict(): def test_delete_customer_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.DeleteCustomerRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_customer), "__call__") as call: call.return_value = None - client.delete_customer(request) # Establish that the underlying gRPC stub method was called. @@ -1639,18 +1602,18 @@ def test_delete_customer_field_headers(): @pytest.mark.asyncio async def test_delete_customer_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.DeleteCustomerRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_customer), "__call__") as call: call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_customer(request) # Establish that the underlying gRPC stub method was called. @@ -1664,13 +1627,14 @@ async def test_delete_customer_field_headers_async(): def test_delete_customer_flattened(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_customer), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = None - # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.delete_customer(name="name_value",) @@ -1679,12 +1643,13 @@ def test_delete_customer_flattened(): # request object values. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" def test_delete_customer_flattened_error(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1697,7 +1662,7 @@ def test_delete_customer_flattened_error(): @pytest.mark.asyncio async def test_delete_customer_flattened_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1714,14 +1679,13 @@ async def test_delete_customer_flattened_async(): # request object values. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0].name == "name_value" @pytest.mark.asyncio async def test_delete_customer_flattened_error_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened @@ -1736,7 +1700,7 @@ def test_provision_cloud_identity( transport: str = "grpc", request_type=service.ProvisionCloudIdentityRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1749,13 +1713,11 @@ def test_provision_cloud_identity( ) as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/spam") - response = client.provision_cloud_identity(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.ProvisionCloudIdentityRequest() # Establish that the response is the type that we expect. @@ -1770,7 +1732,7 @@ def test_provision_cloud_identity_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1780,7 +1742,6 @@ def test_provision_cloud_identity_empty_call(): client.provision_cloud_identity() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.ProvisionCloudIdentityRequest() @@ -1789,7 +1750,7 @@ async def test_provision_cloud_identity_async( transport: str = "grpc_asyncio", request_type=service.ProvisionCloudIdentityRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1804,13 +1765,11 @@ async def test_provision_cloud_identity_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/spam") ) - response = await client.provision_cloud_identity(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.ProvisionCloudIdentityRequest() # Establish that the response is the type that we expect. @@ -1823,11 +1782,14 @@ async def test_provision_cloud_identity_async_from_dict(): def test_provision_cloud_identity_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ProvisionCloudIdentityRequest() + request.customer = "customer/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -1835,7 +1797,6 @@ def test_provision_cloud_identity_field_headers(): type(client.transport.provision_cloud_identity), "__call__" ) as call: call.return_value = operations_pb2.Operation(name="operations/op") - client.provision_cloud_identity(request) # Establish that the underlying gRPC stub method was called. @@ -1851,12 +1812,13 @@ def test_provision_cloud_identity_field_headers(): @pytest.mark.asyncio async def test_provision_cloud_identity_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ProvisionCloudIdentityRequest() + request.customer = "customer/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -1866,7 +1828,6 @@ async def test_provision_cloud_identity_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/op") ) - await client.provision_cloud_identity(request) # Establish that the underlying gRPC stub method was called. @@ -1883,7 +1844,7 @@ def test_list_entitlements( transport: str = "grpc", request_type=service.ListEntitlementsRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1898,19 +1859,15 @@ def test_list_entitlements( call.return_value = service.ListEntitlementsResponse( next_page_token="next_page_token_value", ) - response = client.list_entitlements(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.ListEntitlementsRequest() # Establish that the response is the type that we expect. - assert isinstance(response, pagers.ListEntitlementsPager) - assert response.next_page_token == "next_page_token_value" @@ -1922,7 +1879,7 @@ def test_list_entitlements_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1932,7 +1889,6 @@ def test_list_entitlements_empty_call(): client.list_entitlements() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.ListEntitlementsRequest() @@ -1941,7 +1897,7 @@ async def test_list_entitlements_async( transport: str = "grpc_asyncio", request_type=service.ListEntitlementsRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1956,18 +1912,15 @@ async def test_list_entitlements_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.ListEntitlementsResponse(next_page_token="next_page_token_value",) ) - response = await client.list_entitlements(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.ListEntitlementsRequest() # Establish that the response is the type that we expect. assert isinstance(response, pagers.ListEntitlementsAsyncPager) - assert response.next_page_token == "next_page_token_value" @@ -1977,11 +1930,14 @@ async def test_list_entitlements_async_from_dict(): def test_list_entitlements_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ListEntitlementsRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -1989,7 +1945,6 @@ def test_list_entitlements_field_headers(): type(client.transport.list_entitlements), "__call__" ) as call: call.return_value = service.ListEntitlementsResponse() - client.list_entitlements(request) # Establish that the underlying gRPC stub method was called. @@ -2005,12 +1960,13 @@ def test_list_entitlements_field_headers(): @pytest.mark.asyncio async def test_list_entitlements_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ListEntitlementsRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -2020,7 +1976,6 @@ async def test_list_entitlements_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.ListEntitlementsResponse() ) - await client.list_entitlements(request) # Establish that the underlying gRPC stub method was called. @@ -2034,7 +1989,7 @@ async def test_list_entitlements_field_headers_async(): def test_list_entitlements_pager(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2074,7 +2029,7 @@ def test_list_entitlements_pager(): def test_list_entitlements_pages(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2107,7 +2062,7 @@ def test_list_entitlements_pages(): @pytest.mark.asyncio async def test_list_entitlements_async_pager(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2148,7 +2103,7 @@ async def test_list_entitlements_async_pager(): @pytest.mark.asyncio async def test_list_entitlements_async_pages(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2187,7 +2142,7 @@ def test_list_transferable_skus( transport: str = "grpc", request_type=service.ListTransferableSkusRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2202,19 +2157,15 @@ def test_list_transferable_skus( call.return_value = service.ListTransferableSkusResponse( next_page_token="next_page_token_value", ) - response = client.list_transferable_skus(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.ListTransferableSkusRequest() # Establish that the response is the type that we expect. - assert isinstance(response, pagers.ListTransferableSkusPager) - assert response.next_page_token == "next_page_token_value" @@ -2226,7 +2177,7 @@ def test_list_transferable_skus_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2236,7 +2187,6 @@ def test_list_transferable_skus_empty_call(): client.list_transferable_skus() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.ListTransferableSkusRequest() @@ -2245,7 +2195,7 @@ async def test_list_transferable_skus_async( transport: str = "grpc_asyncio", request_type=service.ListTransferableSkusRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2262,18 +2212,15 @@ async def test_list_transferable_skus_async( next_page_token="next_page_token_value", ) ) - response = await client.list_transferable_skus(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.ListTransferableSkusRequest() # Establish that the response is the type that we expect. assert isinstance(response, pagers.ListTransferableSkusAsyncPager) - assert response.next_page_token == "next_page_token_value" @@ -2283,11 +2230,14 @@ async def test_list_transferable_skus_async_from_dict(): def test_list_transferable_skus_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ListTransferableSkusRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -2295,7 +2245,6 @@ def test_list_transferable_skus_field_headers(): type(client.transport.list_transferable_skus), "__call__" ) as call: call.return_value = service.ListTransferableSkusResponse() - client.list_transferable_skus(request) # Establish that the underlying gRPC stub method was called. @@ -2311,12 +2260,13 @@ def test_list_transferable_skus_field_headers(): @pytest.mark.asyncio async def test_list_transferable_skus_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ListTransferableSkusRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -2326,7 +2276,6 @@ async def test_list_transferable_skus_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.ListTransferableSkusResponse() ) - await client.list_transferable_skus(request) # Establish that the underlying gRPC stub method was called. @@ -2340,7 +2289,7 @@ async def test_list_transferable_skus_field_headers_async(): def test_list_transferable_skus_pager(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2386,7 +2335,7 @@ def test_list_transferable_skus_pager(): def test_list_transferable_skus_pages(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2425,7 +2374,7 @@ def test_list_transferable_skus_pages(): @pytest.mark.asyncio async def test_list_transferable_skus_async_pager(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2472,7 +2421,7 @@ async def test_list_transferable_skus_async_pager(): @pytest.mark.asyncio async def test_list_transferable_skus_async_pages(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2517,7 +2466,7 @@ def test_list_transferable_offers( transport: str = "grpc", request_type=service.ListTransferableOffersRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2532,19 +2481,15 @@ def test_list_transferable_offers( call.return_value = service.ListTransferableOffersResponse( next_page_token="next_page_token_value", ) - response = client.list_transferable_offers(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.ListTransferableOffersRequest() # Establish that the response is the type that we expect. - assert isinstance(response, pagers.ListTransferableOffersPager) - assert response.next_page_token == "next_page_token_value" @@ -2556,7 +2501,7 @@ def test_list_transferable_offers_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2566,7 +2511,6 @@ def test_list_transferable_offers_empty_call(): client.list_transferable_offers() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.ListTransferableOffersRequest() @@ -2575,7 +2519,7 @@ async def test_list_transferable_offers_async( transport: str = "grpc_asyncio", request_type=service.ListTransferableOffersRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2592,18 +2536,15 @@ async def test_list_transferable_offers_async( next_page_token="next_page_token_value", ) ) - response = await client.list_transferable_offers(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.ListTransferableOffersRequest() # Establish that the response is the type that we expect. assert isinstance(response, pagers.ListTransferableOffersAsyncPager) - assert response.next_page_token == "next_page_token_value" @@ -2613,11 +2554,14 @@ async def test_list_transferable_offers_async_from_dict(): def test_list_transferable_offers_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ListTransferableOffersRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -2625,7 +2569,6 @@ def test_list_transferable_offers_field_headers(): type(client.transport.list_transferable_offers), "__call__" ) as call: call.return_value = service.ListTransferableOffersResponse() - client.list_transferable_offers(request) # Establish that the underlying gRPC stub method was called. @@ -2641,12 +2584,13 @@ def test_list_transferable_offers_field_headers(): @pytest.mark.asyncio async def test_list_transferable_offers_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ListTransferableOffersRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -2656,7 +2600,6 @@ async def test_list_transferable_offers_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.ListTransferableOffersResponse() ) - await client.list_transferable_offers(request) # Establish that the underlying gRPC stub method was called. @@ -2670,7 +2613,7 @@ async def test_list_transferable_offers_field_headers_async(): def test_list_transferable_offers_pager(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2716,7 +2659,7 @@ def test_list_transferable_offers_pager(): def test_list_transferable_offers_pages(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2755,7 +2698,7 @@ def test_list_transferable_offers_pages(): @pytest.mark.asyncio async def test_list_transferable_offers_async_pager(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2802,7 +2745,7 @@ async def test_list_transferable_offers_async_pager(): @pytest.mark.asyncio async def test_list_transferable_offers_async_pages(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2847,7 +2790,7 @@ def test_get_entitlement( transport: str = "grpc", request_type=service.GetEntitlementRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2866,31 +2809,23 @@ def test_get_entitlement( ], purchase_order_id="purchase_order_id_value", ) - response = client.get_entitlement(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.GetEntitlementRequest() # Establish that the response is the type that we expect. - assert isinstance(response, entitlements.Entitlement) - assert response.name == "name_value" - assert response.offer == "offer_value" - assert ( response.provisioning_state == entitlements.Entitlement.ProvisioningState.ACTIVE ) - assert response.suspension_reasons == [ entitlements.Entitlement.SuspensionReason.RESELLER_INITIATED ] - assert response.purchase_order_id == "purchase_order_id_value" @@ -2902,7 +2837,7 @@ def test_get_entitlement_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2910,7 +2845,6 @@ def test_get_entitlement_empty_call(): client.get_entitlement() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.GetEntitlementRequest() @@ -2919,7 +2853,7 @@ async def test_get_entitlement_async( transport: str = "grpc_asyncio", request_type=service.GetEntitlementRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2940,30 +2874,23 @@ async def test_get_entitlement_async( purchase_order_id="purchase_order_id_value", ) ) - response = await client.get_entitlement(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.GetEntitlementRequest() # Establish that the response is the type that we expect. assert isinstance(response, entitlements.Entitlement) - assert response.name == "name_value" - assert response.offer == "offer_value" - assert ( response.provisioning_state == entitlements.Entitlement.ProvisioningState.ACTIVE ) - assert response.suspension_reasons == [ entitlements.Entitlement.SuspensionReason.RESELLER_INITIATED ] - assert response.purchase_order_id == "purchase_order_id_value" @@ -2973,17 +2900,19 @@ async def test_get_entitlement_async_from_dict(): def test_get_entitlement_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.GetEntitlementRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_entitlement), "__call__") as call: call.return_value = entitlements.Entitlement() - client.get_entitlement(request) # Establish that the underlying gRPC stub method was called. @@ -2999,12 +2928,13 @@ def test_get_entitlement_field_headers(): @pytest.mark.asyncio async def test_get_entitlement_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.GetEntitlementRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -3012,7 +2942,6 @@ async def test_get_entitlement_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( entitlements.Entitlement() ) - await client.get_entitlement(request) # Establish that the underlying gRPC stub method was called. @@ -3029,7 +2958,7 @@ def test_create_entitlement( transport: str = "grpc", request_type=service.CreateEntitlementRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3042,13 +2971,11 @@ def test_create_entitlement( ) as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/spam") - response = client.create_entitlement(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.CreateEntitlementRequest() # Establish that the response is the type that we expect. @@ -3063,7 +2990,7 @@ def test_create_entitlement_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3073,7 +3000,6 @@ def test_create_entitlement_empty_call(): client.create_entitlement() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.CreateEntitlementRequest() @@ -3082,7 +3008,7 @@ async def test_create_entitlement_async( transport: str = "grpc_asyncio", request_type=service.CreateEntitlementRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3097,13 +3023,11 @@ async def test_create_entitlement_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/spam") ) - response = await client.create_entitlement(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.CreateEntitlementRequest() # Establish that the response is the type that we expect. @@ -3116,11 +3040,14 @@ async def test_create_entitlement_async_from_dict(): def test_create_entitlement_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.CreateEntitlementRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -3128,7 +3055,6 @@ def test_create_entitlement_field_headers(): type(client.transport.create_entitlement), "__call__" ) as call: call.return_value = operations_pb2.Operation(name="operations/op") - client.create_entitlement(request) # Establish that the underlying gRPC stub method was called. @@ -3144,12 +3070,13 @@ def test_create_entitlement_field_headers(): @pytest.mark.asyncio async def test_create_entitlement_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.CreateEntitlementRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -3159,7 +3086,6 @@ async def test_create_entitlement_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/op") ) - await client.create_entitlement(request) # Establish that the underlying gRPC stub method was called. @@ -3176,7 +3102,7 @@ def test_change_parameters( transport: str = "grpc", request_type=service.ChangeParametersRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3189,13 +3115,11 @@ def test_change_parameters( ) as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/spam") - response = client.change_parameters(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.ChangeParametersRequest() # Establish that the response is the type that we expect. @@ -3210,7 +3134,7 @@ def test_change_parameters_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3220,7 +3144,6 @@ def test_change_parameters_empty_call(): client.change_parameters() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.ChangeParametersRequest() @@ -3229,7 +3152,7 @@ async def test_change_parameters_async( transport: str = "grpc_asyncio", request_type=service.ChangeParametersRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3244,13 +3167,11 @@ async def test_change_parameters_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/spam") ) - response = await client.change_parameters(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.ChangeParametersRequest() # Establish that the response is the type that we expect. @@ -3263,11 +3184,14 @@ async def test_change_parameters_async_from_dict(): def test_change_parameters_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ChangeParametersRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -3275,7 +3199,6 @@ def test_change_parameters_field_headers(): type(client.transport.change_parameters), "__call__" ) as call: call.return_value = operations_pb2.Operation(name="operations/op") - client.change_parameters(request) # Establish that the underlying gRPC stub method was called. @@ -3291,12 +3214,13 @@ def test_change_parameters_field_headers(): @pytest.mark.asyncio async def test_change_parameters_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ChangeParametersRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -3306,7 +3230,6 @@ async def test_change_parameters_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/op") ) - await client.change_parameters(request) # Establish that the underlying gRPC stub method was called. @@ -3323,7 +3246,7 @@ def test_change_renewal_settings( transport: str = "grpc", request_type=service.ChangeRenewalSettingsRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3336,13 +3259,11 @@ def test_change_renewal_settings( ) as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/spam") - response = client.change_renewal_settings(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.ChangeRenewalSettingsRequest() # Establish that the response is the type that we expect. @@ -3357,7 +3278,7 @@ def test_change_renewal_settings_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3367,7 +3288,6 @@ def test_change_renewal_settings_empty_call(): client.change_renewal_settings() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.ChangeRenewalSettingsRequest() @@ -3376,7 +3296,7 @@ async def test_change_renewal_settings_async( transport: str = "grpc_asyncio", request_type=service.ChangeRenewalSettingsRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3391,13 +3311,11 @@ async def test_change_renewal_settings_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/spam") ) - response = await client.change_renewal_settings(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.ChangeRenewalSettingsRequest() # Establish that the response is the type that we expect. @@ -3410,11 +3328,14 @@ async def test_change_renewal_settings_async_from_dict(): def test_change_renewal_settings_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ChangeRenewalSettingsRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -3422,7 +3343,6 @@ def test_change_renewal_settings_field_headers(): type(client.transport.change_renewal_settings), "__call__" ) as call: call.return_value = operations_pb2.Operation(name="operations/op") - client.change_renewal_settings(request) # Establish that the underlying gRPC stub method was called. @@ -3438,12 +3358,13 @@ def test_change_renewal_settings_field_headers(): @pytest.mark.asyncio async def test_change_renewal_settings_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ChangeRenewalSettingsRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -3453,7 +3374,6 @@ async def test_change_renewal_settings_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/op") ) - await client.change_renewal_settings(request) # Establish that the underlying gRPC stub method was called. @@ -3468,7 +3388,7 @@ async def test_change_renewal_settings_field_headers_async(): def test_change_offer(transport: str = "grpc", request_type=service.ChangeOfferRequest): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3479,13 +3399,11 @@ def test_change_offer(transport: str = "grpc", request_type=service.ChangeOfferR with mock.patch.object(type(client.transport.change_offer), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/spam") - response = client.change_offer(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.ChangeOfferRequest() # Establish that the response is the type that we expect. @@ -3500,7 +3418,7 @@ def test_change_offer_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3508,7 +3426,6 @@ def test_change_offer_empty_call(): client.change_offer() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.ChangeOfferRequest() @@ -3517,7 +3434,7 @@ async def test_change_offer_async( transport: str = "grpc_asyncio", request_type=service.ChangeOfferRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3530,13 +3447,11 @@ async def test_change_offer_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/spam") ) - response = await client.change_offer(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.ChangeOfferRequest() # Establish that the response is the type that we expect. @@ -3549,17 +3464,19 @@ async def test_change_offer_async_from_dict(): def test_change_offer_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ChangeOfferRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.change_offer), "__call__") as call: call.return_value = operations_pb2.Operation(name="operations/op") - client.change_offer(request) # Establish that the underlying gRPC stub method was called. @@ -3575,12 +3492,13 @@ def test_change_offer_field_headers(): @pytest.mark.asyncio async def test_change_offer_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ChangeOfferRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -3588,7 +3506,6 @@ async def test_change_offer_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/op") ) - await client.change_offer(request) # Establish that the underlying gRPC stub method was called. @@ -3605,7 +3522,7 @@ def test_start_paid_service( transport: str = "grpc", request_type=service.StartPaidServiceRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3618,13 +3535,11 @@ def test_start_paid_service( ) as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/spam") - response = client.start_paid_service(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.StartPaidServiceRequest() # Establish that the response is the type that we expect. @@ -3639,7 +3554,7 @@ def test_start_paid_service_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3649,7 +3564,6 @@ def test_start_paid_service_empty_call(): client.start_paid_service() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.StartPaidServiceRequest() @@ -3658,7 +3572,7 @@ async def test_start_paid_service_async( transport: str = "grpc_asyncio", request_type=service.StartPaidServiceRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3673,13 +3587,11 @@ async def test_start_paid_service_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/spam") ) - response = await client.start_paid_service(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.StartPaidServiceRequest() # Establish that the response is the type that we expect. @@ -3692,11 +3604,14 @@ async def test_start_paid_service_async_from_dict(): def test_start_paid_service_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.StartPaidServiceRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -3704,7 +3619,6 @@ def test_start_paid_service_field_headers(): type(client.transport.start_paid_service), "__call__" ) as call: call.return_value = operations_pb2.Operation(name="operations/op") - client.start_paid_service(request) # Establish that the underlying gRPC stub method was called. @@ -3720,12 +3634,13 @@ def test_start_paid_service_field_headers(): @pytest.mark.asyncio async def test_start_paid_service_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.StartPaidServiceRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -3735,7 +3650,6 @@ async def test_start_paid_service_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/op") ) - await client.start_paid_service(request) # Establish that the underlying gRPC stub method was called. @@ -3752,7 +3666,7 @@ def test_suspend_entitlement( transport: str = "grpc", request_type=service.SuspendEntitlementRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3765,13 +3679,11 @@ def test_suspend_entitlement( ) as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/spam") - response = client.suspend_entitlement(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.SuspendEntitlementRequest() # Establish that the response is the type that we expect. @@ -3786,7 +3698,7 @@ def test_suspend_entitlement_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3796,7 +3708,6 @@ def test_suspend_entitlement_empty_call(): client.suspend_entitlement() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.SuspendEntitlementRequest() @@ -3805,7 +3716,7 @@ async def test_suspend_entitlement_async( transport: str = "grpc_asyncio", request_type=service.SuspendEntitlementRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3820,13 +3731,11 @@ async def test_suspend_entitlement_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/spam") ) - response = await client.suspend_entitlement(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.SuspendEntitlementRequest() # Establish that the response is the type that we expect. @@ -3839,11 +3748,14 @@ async def test_suspend_entitlement_async_from_dict(): def test_suspend_entitlement_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.SuspendEntitlementRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -3851,7 +3763,6 @@ def test_suspend_entitlement_field_headers(): type(client.transport.suspend_entitlement), "__call__" ) as call: call.return_value = operations_pb2.Operation(name="operations/op") - client.suspend_entitlement(request) # Establish that the underlying gRPC stub method was called. @@ -3867,12 +3778,13 @@ def test_suspend_entitlement_field_headers(): @pytest.mark.asyncio async def test_suspend_entitlement_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.SuspendEntitlementRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -3882,7 +3794,6 @@ async def test_suspend_entitlement_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/op") ) - await client.suspend_entitlement(request) # Establish that the underlying gRPC stub method was called. @@ -3899,7 +3810,7 @@ def test_cancel_entitlement( transport: str = "grpc", request_type=service.CancelEntitlementRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3912,13 +3823,11 @@ def test_cancel_entitlement( ) as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/spam") - response = client.cancel_entitlement(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.CancelEntitlementRequest() # Establish that the response is the type that we expect. @@ -3933,7 +3842,7 @@ def test_cancel_entitlement_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3943,7 +3852,6 @@ def test_cancel_entitlement_empty_call(): client.cancel_entitlement() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.CancelEntitlementRequest() @@ -3952,7 +3860,7 @@ async def test_cancel_entitlement_async( transport: str = "grpc_asyncio", request_type=service.CancelEntitlementRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3967,13 +3875,11 @@ async def test_cancel_entitlement_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/spam") ) - response = await client.cancel_entitlement(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.CancelEntitlementRequest() # Establish that the response is the type that we expect. @@ -3986,11 +3892,14 @@ async def test_cancel_entitlement_async_from_dict(): def test_cancel_entitlement_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.CancelEntitlementRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -3998,7 +3907,6 @@ def test_cancel_entitlement_field_headers(): type(client.transport.cancel_entitlement), "__call__" ) as call: call.return_value = operations_pb2.Operation(name="operations/op") - client.cancel_entitlement(request) # Establish that the underlying gRPC stub method was called. @@ -4014,12 +3922,13 @@ def test_cancel_entitlement_field_headers(): @pytest.mark.asyncio async def test_cancel_entitlement_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.CancelEntitlementRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -4029,7 +3938,6 @@ async def test_cancel_entitlement_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/op") ) - await client.cancel_entitlement(request) # Establish that the underlying gRPC stub method was called. @@ -4046,7 +3954,7 @@ def test_activate_entitlement( transport: str = "grpc", request_type=service.ActivateEntitlementRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4059,13 +3967,11 @@ def test_activate_entitlement( ) as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/spam") - response = client.activate_entitlement(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.ActivateEntitlementRequest() # Establish that the response is the type that we expect. @@ -4080,7 +3986,7 @@ def test_activate_entitlement_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4090,7 +3996,6 @@ def test_activate_entitlement_empty_call(): client.activate_entitlement() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.ActivateEntitlementRequest() @@ -4099,7 +4004,7 @@ async def test_activate_entitlement_async( transport: str = "grpc_asyncio", request_type=service.ActivateEntitlementRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4114,13 +4019,11 @@ async def test_activate_entitlement_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/spam") ) - response = await client.activate_entitlement(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.ActivateEntitlementRequest() # Establish that the response is the type that we expect. @@ -4133,11 +4036,14 @@ async def test_activate_entitlement_async_from_dict(): def test_activate_entitlement_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ActivateEntitlementRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -4145,7 +4051,6 @@ def test_activate_entitlement_field_headers(): type(client.transport.activate_entitlement), "__call__" ) as call: call.return_value = operations_pb2.Operation(name="operations/op") - client.activate_entitlement(request) # Establish that the underlying gRPC stub method was called. @@ -4161,12 +4066,13 @@ def test_activate_entitlement_field_headers(): @pytest.mark.asyncio async def test_activate_entitlement_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ActivateEntitlementRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -4176,7 +4082,6 @@ async def test_activate_entitlement_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/op") ) - await client.activate_entitlement(request) # Establish that the underlying gRPC stub method was called. @@ -4193,7 +4098,7 @@ def test_transfer_entitlements( transport: str = "grpc", request_type=service.TransferEntitlementsRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4206,13 +4111,11 @@ def test_transfer_entitlements( ) as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/spam") - response = client.transfer_entitlements(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.TransferEntitlementsRequest() # Establish that the response is the type that we expect. @@ -4227,7 +4130,7 @@ def test_transfer_entitlements_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4237,7 +4140,6 @@ def test_transfer_entitlements_empty_call(): client.transfer_entitlements() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.TransferEntitlementsRequest() @@ -4246,7 +4148,7 @@ async def test_transfer_entitlements_async( transport: str = "grpc_asyncio", request_type=service.TransferEntitlementsRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4261,13 +4163,11 @@ async def test_transfer_entitlements_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/spam") ) - response = await client.transfer_entitlements(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.TransferEntitlementsRequest() # Establish that the response is the type that we expect. @@ -4280,11 +4180,14 @@ async def test_transfer_entitlements_async_from_dict(): def test_transfer_entitlements_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.TransferEntitlementsRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -4292,7 +4195,6 @@ def test_transfer_entitlements_field_headers(): type(client.transport.transfer_entitlements), "__call__" ) as call: call.return_value = operations_pb2.Operation(name="operations/op") - client.transfer_entitlements(request) # Establish that the underlying gRPC stub method was called. @@ -4308,12 +4210,13 @@ def test_transfer_entitlements_field_headers(): @pytest.mark.asyncio async def test_transfer_entitlements_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.TransferEntitlementsRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -4323,7 +4226,6 @@ async def test_transfer_entitlements_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/op") ) - await client.transfer_entitlements(request) # Establish that the underlying gRPC stub method was called. @@ -4340,7 +4242,7 @@ def test_transfer_entitlements_to_google( transport: str = "grpc", request_type=service.TransferEntitlementsToGoogleRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4353,13 +4255,11 @@ def test_transfer_entitlements_to_google( ) as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/spam") - response = client.transfer_entitlements_to_google(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.TransferEntitlementsToGoogleRequest() # Establish that the response is the type that we expect. @@ -4374,7 +4274,7 @@ def test_transfer_entitlements_to_google_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4384,7 +4284,6 @@ def test_transfer_entitlements_to_google_empty_call(): client.transfer_entitlements_to_google() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.TransferEntitlementsToGoogleRequest() @@ -4394,7 +4293,7 @@ async def test_transfer_entitlements_to_google_async( request_type=service.TransferEntitlementsToGoogleRequest, ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4409,13 +4308,11 @@ async def test_transfer_entitlements_to_google_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/spam") ) - response = await client.transfer_entitlements_to_google(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.TransferEntitlementsToGoogleRequest() # Establish that the response is the type that we expect. @@ -4428,11 +4325,14 @@ async def test_transfer_entitlements_to_google_async_from_dict(): def test_transfer_entitlements_to_google_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.TransferEntitlementsToGoogleRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -4440,7 +4340,6 @@ def test_transfer_entitlements_to_google_field_headers(): type(client.transport.transfer_entitlements_to_google), "__call__" ) as call: call.return_value = operations_pb2.Operation(name="operations/op") - client.transfer_entitlements_to_google(request) # Establish that the underlying gRPC stub method was called. @@ -4456,12 +4355,13 @@ def test_transfer_entitlements_to_google_field_headers(): @pytest.mark.asyncio async def test_transfer_entitlements_to_google_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.TransferEntitlementsToGoogleRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -4471,7 +4371,6 @@ async def test_transfer_entitlements_to_google_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/op") ) - await client.transfer_entitlements_to_google(request) # Establish that the underlying gRPC stub method was called. @@ -4488,7 +4387,7 @@ def test_list_channel_partner_links( transport: str = "grpc", request_type=service.ListChannelPartnerLinksRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4503,19 +4402,15 @@ def test_list_channel_partner_links( call.return_value = service.ListChannelPartnerLinksResponse( next_page_token="next_page_token_value", ) - response = client.list_channel_partner_links(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.ListChannelPartnerLinksRequest() # Establish that the response is the type that we expect. - assert isinstance(response, pagers.ListChannelPartnerLinksPager) - assert response.next_page_token == "next_page_token_value" @@ -4527,7 +4422,7 @@ def test_list_channel_partner_links_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4537,7 +4432,6 @@ def test_list_channel_partner_links_empty_call(): client.list_channel_partner_links() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.ListChannelPartnerLinksRequest() @@ -4546,7 +4440,7 @@ async def test_list_channel_partner_links_async( transport: str = "grpc_asyncio", request_type=service.ListChannelPartnerLinksRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4563,18 +4457,15 @@ async def test_list_channel_partner_links_async( next_page_token="next_page_token_value", ) ) - response = await client.list_channel_partner_links(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.ListChannelPartnerLinksRequest() # Establish that the response is the type that we expect. assert isinstance(response, pagers.ListChannelPartnerLinksAsyncPager) - assert response.next_page_token == "next_page_token_value" @@ -4584,11 +4475,14 @@ async def test_list_channel_partner_links_async_from_dict(): def test_list_channel_partner_links_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ListChannelPartnerLinksRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -4596,7 +4490,6 @@ def test_list_channel_partner_links_field_headers(): type(client.transport.list_channel_partner_links), "__call__" ) as call: call.return_value = service.ListChannelPartnerLinksResponse() - client.list_channel_partner_links(request) # Establish that the underlying gRPC stub method was called. @@ -4612,12 +4505,13 @@ def test_list_channel_partner_links_field_headers(): @pytest.mark.asyncio async def test_list_channel_partner_links_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ListChannelPartnerLinksRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -4627,7 +4521,6 @@ async def test_list_channel_partner_links_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.ListChannelPartnerLinksResponse() ) - await client.list_channel_partner_links(request) # Establish that the underlying gRPC stub method was called. @@ -4641,7 +4534,7 @@ async def test_list_channel_partner_links_field_headers_async(): def test_list_channel_partner_links_pager(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4689,7 +4582,7 @@ def test_list_channel_partner_links_pager(): def test_list_channel_partner_links_pages(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4728,7 +4621,7 @@ def test_list_channel_partner_links_pages(): @pytest.mark.asyncio async def test_list_channel_partner_links_async_pager(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4777,7 +4670,7 @@ async def test_list_channel_partner_links_async_pager(): @pytest.mark.asyncio async def test_list_channel_partner_links_async_pages(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4822,7 +4715,7 @@ def test_get_channel_partner_link( transport: str = "grpc", request_type=service.GetChannelPartnerLinkRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4841,27 +4734,19 @@ def test_get_channel_partner_link( invite_link_uri="invite_link_uri_value", public_id="public_id_value", ) - response = client.get_channel_partner_link(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.GetChannelPartnerLinkRequest() # Establish that the response is the type that we expect. - assert isinstance(response, channel_partner_links.ChannelPartnerLink) - assert response.name == "name_value" - assert response.reseller_cloud_identity_id == "reseller_cloud_identity_id_value" - assert response.link_state == channel_partner_links.ChannelPartnerLinkState.INVITED - assert response.invite_link_uri == "invite_link_uri_value" - assert response.public_id == "public_id_value" @@ -4873,7 +4758,7 @@ def test_get_channel_partner_link_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4883,7 +4768,6 @@ def test_get_channel_partner_link_empty_call(): client.get_channel_partner_link() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.GetChannelPartnerLinkRequest() @@ -4892,7 +4776,7 @@ async def test_get_channel_partner_link_async( transport: str = "grpc_asyncio", request_type=service.GetChannelPartnerLinkRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4913,26 +4797,19 @@ async def test_get_channel_partner_link_async( public_id="public_id_value", ) ) - response = await client.get_channel_partner_link(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.GetChannelPartnerLinkRequest() # Establish that the response is the type that we expect. assert isinstance(response, channel_partner_links.ChannelPartnerLink) - assert response.name == "name_value" - assert response.reseller_cloud_identity_id == "reseller_cloud_identity_id_value" - assert response.link_state == channel_partner_links.ChannelPartnerLinkState.INVITED - assert response.invite_link_uri == "invite_link_uri_value" - assert response.public_id == "public_id_value" @@ -4942,11 +4819,14 @@ async def test_get_channel_partner_link_async_from_dict(): def test_get_channel_partner_link_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.GetChannelPartnerLinkRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -4954,7 +4834,6 @@ def test_get_channel_partner_link_field_headers(): type(client.transport.get_channel_partner_link), "__call__" ) as call: call.return_value = channel_partner_links.ChannelPartnerLink() - client.get_channel_partner_link(request) # Establish that the underlying gRPC stub method was called. @@ -4970,12 +4849,13 @@ def test_get_channel_partner_link_field_headers(): @pytest.mark.asyncio async def test_get_channel_partner_link_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.GetChannelPartnerLinkRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -4985,7 +4865,6 @@ async def test_get_channel_partner_link_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( channel_partner_links.ChannelPartnerLink() ) - await client.get_channel_partner_link(request) # Establish that the underlying gRPC stub method was called. @@ -5002,7 +4881,7 @@ def test_create_channel_partner_link( transport: str = "grpc", request_type=service.CreateChannelPartnerLinkRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5021,27 +4900,19 @@ def test_create_channel_partner_link( invite_link_uri="invite_link_uri_value", public_id="public_id_value", ) - response = client.create_channel_partner_link(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.CreateChannelPartnerLinkRequest() # Establish that the response is the type that we expect. - assert isinstance(response, channel_partner_links.ChannelPartnerLink) - assert response.name == "name_value" - assert response.reseller_cloud_identity_id == "reseller_cloud_identity_id_value" - assert response.link_state == channel_partner_links.ChannelPartnerLinkState.INVITED - assert response.invite_link_uri == "invite_link_uri_value" - assert response.public_id == "public_id_value" @@ -5053,7 +4924,7 @@ def test_create_channel_partner_link_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5063,7 +4934,6 @@ def test_create_channel_partner_link_empty_call(): client.create_channel_partner_link() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.CreateChannelPartnerLinkRequest() @@ -5073,7 +4943,7 @@ async def test_create_channel_partner_link_async( request_type=service.CreateChannelPartnerLinkRequest, ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5094,26 +4964,19 @@ async def test_create_channel_partner_link_async( public_id="public_id_value", ) ) - response = await client.create_channel_partner_link(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.CreateChannelPartnerLinkRequest() # Establish that the response is the type that we expect. assert isinstance(response, channel_partner_links.ChannelPartnerLink) - assert response.name == "name_value" - assert response.reseller_cloud_identity_id == "reseller_cloud_identity_id_value" - assert response.link_state == channel_partner_links.ChannelPartnerLinkState.INVITED - assert response.invite_link_uri == "invite_link_uri_value" - assert response.public_id == "public_id_value" @@ -5123,11 +4986,14 @@ async def test_create_channel_partner_link_async_from_dict(): def test_create_channel_partner_link_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.CreateChannelPartnerLinkRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -5135,7 +5001,6 @@ def test_create_channel_partner_link_field_headers(): type(client.transport.create_channel_partner_link), "__call__" ) as call: call.return_value = channel_partner_links.ChannelPartnerLink() - client.create_channel_partner_link(request) # Establish that the underlying gRPC stub method was called. @@ -5151,12 +5016,13 @@ def test_create_channel_partner_link_field_headers(): @pytest.mark.asyncio async def test_create_channel_partner_link_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.CreateChannelPartnerLinkRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -5166,7 +5032,6 @@ async def test_create_channel_partner_link_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( channel_partner_links.ChannelPartnerLink() ) - await client.create_channel_partner_link(request) # Establish that the underlying gRPC stub method was called. @@ -5183,7 +5048,7 @@ def test_update_channel_partner_link( transport: str = "grpc", request_type=service.UpdateChannelPartnerLinkRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5202,27 +5067,19 @@ def test_update_channel_partner_link( invite_link_uri="invite_link_uri_value", public_id="public_id_value", ) - response = client.update_channel_partner_link(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.UpdateChannelPartnerLinkRequest() # Establish that the response is the type that we expect. - assert isinstance(response, channel_partner_links.ChannelPartnerLink) - assert response.name == "name_value" - assert response.reseller_cloud_identity_id == "reseller_cloud_identity_id_value" - assert response.link_state == channel_partner_links.ChannelPartnerLinkState.INVITED - assert response.invite_link_uri == "invite_link_uri_value" - assert response.public_id == "public_id_value" @@ -5234,7 +5091,7 @@ def test_update_channel_partner_link_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5244,7 +5101,6 @@ def test_update_channel_partner_link_empty_call(): client.update_channel_partner_link() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.UpdateChannelPartnerLinkRequest() @@ -5254,7 +5110,7 @@ async def test_update_channel_partner_link_async( request_type=service.UpdateChannelPartnerLinkRequest, ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5275,26 +5131,19 @@ async def test_update_channel_partner_link_async( public_id="public_id_value", ) ) - response = await client.update_channel_partner_link(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.UpdateChannelPartnerLinkRequest() # Establish that the response is the type that we expect. assert isinstance(response, channel_partner_links.ChannelPartnerLink) - assert response.name == "name_value" - assert response.reseller_cloud_identity_id == "reseller_cloud_identity_id_value" - assert response.link_state == channel_partner_links.ChannelPartnerLinkState.INVITED - assert response.invite_link_uri == "invite_link_uri_value" - assert response.public_id == "public_id_value" @@ -5304,11 +5153,14 @@ async def test_update_channel_partner_link_async_from_dict(): def test_update_channel_partner_link_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.UpdateChannelPartnerLinkRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -5316,7 +5168,6 @@ def test_update_channel_partner_link_field_headers(): type(client.transport.update_channel_partner_link), "__call__" ) as call: call.return_value = channel_partner_links.ChannelPartnerLink() - client.update_channel_partner_link(request) # Establish that the underlying gRPC stub method was called. @@ -5332,12 +5183,13 @@ def test_update_channel_partner_link_field_headers(): @pytest.mark.asyncio async def test_update_channel_partner_link_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.UpdateChannelPartnerLinkRequest() + request.name = "name/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -5347,7 +5199,6 @@ async def test_update_channel_partner_link_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( channel_partner_links.ChannelPartnerLink() ) - await client.update_channel_partner_link(request) # Establish that the underlying gRPC stub method was called. @@ -5364,7 +5215,7 @@ def test_list_products( transport: str = "grpc", request_type=service.ListProductsRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5377,19 +5228,15 @@ def test_list_products( call.return_value = service.ListProductsResponse( next_page_token="next_page_token_value", ) - response = client.list_products(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.ListProductsRequest() # Establish that the response is the type that we expect. - assert isinstance(response, pagers.ListProductsPager) - assert response.next_page_token == "next_page_token_value" @@ -5401,7 +5248,7 @@ def test_list_products_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5409,7 +5256,6 @@ def test_list_products_empty_call(): client.list_products() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.ListProductsRequest() @@ -5418,7 +5264,7 @@ async def test_list_products_async( transport: str = "grpc_asyncio", request_type=service.ListProductsRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5431,18 +5277,15 @@ async def test_list_products_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.ListProductsResponse(next_page_token="next_page_token_value",) ) - response = await client.list_products(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.ListProductsRequest() # Establish that the response is the type that we expect. assert isinstance(response, pagers.ListProductsAsyncPager) - assert response.next_page_token == "next_page_token_value" @@ -5452,7 +5295,7 @@ async def test_list_products_async_from_dict(): def test_list_products_pager(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_products), "__call__") as call: @@ -5483,7 +5326,7 @@ def test_list_products_pager(): def test_list_products_pages(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_products), "__call__") as call: @@ -5510,7 +5353,7 @@ def test_list_products_pages(): @pytest.mark.asyncio async def test_list_products_async_pager(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5545,7 +5388,7 @@ async def test_list_products_async_pager(): @pytest.mark.asyncio async def test_list_products_async_pages(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5576,7 +5419,7 @@ async def test_list_products_async_pages(): def test_list_skus(transport: str = "grpc", request_type=service.ListSkusRequest): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5589,19 +5432,15 @@ def test_list_skus(transport: str = "grpc", request_type=service.ListSkusRequest call.return_value = service.ListSkusResponse( next_page_token="next_page_token_value", ) - response = client.list_skus(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.ListSkusRequest() # Establish that the response is the type that we expect. - assert isinstance(response, pagers.ListSkusPager) - assert response.next_page_token == "next_page_token_value" @@ -5613,7 +5452,7 @@ def test_list_skus_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5621,7 +5460,6 @@ def test_list_skus_empty_call(): client.list_skus() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.ListSkusRequest() @@ -5630,7 +5468,7 @@ async def test_list_skus_async( transport: str = "grpc_asyncio", request_type=service.ListSkusRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5643,18 +5481,15 @@ async def test_list_skus_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.ListSkusResponse(next_page_token="next_page_token_value",) ) - response = await client.list_skus(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.ListSkusRequest() # Establish that the response is the type that we expect. assert isinstance(response, pagers.ListSkusAsyncPager) - assert response.next_page_token == "next_page_token_value" @@ -5664,17 +5499,19 @@ async def test_list_skus_async_from_dict(): def test_list_skus_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ListSkusRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_skus), "__call__") as call: call.return_value = service.ListSkusResponse() - client.list_skus(request) # Establish that the underlying gRPC stub method was called. @@ -5690,12 +5527,13 @@ def test_list_skus_field_headers(): @pytest.mark.asyncio async def test_list_skus_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ListSkusRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -5703,7 +5541,6 @@ async def test_list_skus_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.ListSkusResponse() ) - await client.list_skus(request) # Establish that the underlying gRPC stub method was called. @@ -5717,7 +5554,7 @@ async def test_list_skus_field_headers_async(): def test_list_skus_pager(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_skus), "__call__") as call: @@ -5747,7 +5584,7 @@ def test_list_skus_pager(): def test_list_skus_pages(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_skus), "__call__") as call: @@ -5770,7 +5607,7 @@ def test_list_skus_pages(): @pytest.mark.asyncio async def test_list_skus_async_pager(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5801,7 +5638,7 @@ async def test_list_skus_async_pager(): @pytest.mark.asyncio async def test_list_skus_async_pages(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5828,7 +5665,7 @@ async def test_list_skus_async_pages(): def test_list_offers(transport: str = "grpc", request_type=service.ListOffersRequest): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5841,19 +5678,15 @@ def test_list_offers(transport: str = "grpc", request_type=service.ListOffersReq call.return_value = service.ListOffersResponse( next_page_token="next_page_token_value", ) - response = client.list_offers(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.ListOffersRequest() # Establish that the response is the type that we expect. - assert isinstance(response, pagers.ListOffersPager) - assert response.next_page_token == "next_page_token_value" @@ -5865,7 +5698,7 @@ def test_list_offers_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5873,7 +5706,6 @@ def test_list_offers_empty_call(): client.list_offers() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.ListOffersRequest() @@ -5882,7 +5714,7 @@ async def test_list_offers_async( transport: str = "grpc_asyncio", request_type=service.ListOffersRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5895,18 +5727,15 @@ async def test_list_offers_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.ListOffersResponse(next_page_token="next_page_token_value",) ) - response = await client.list_offers(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.ListOffersRequest() # Establish that the response is the type that we expect. assert isinstance(response, pagers.ListOffersAsyncPager) - assert response.next_page_token == "next_page_token_value" @@ -5916,17 +5745,19 @@ async def test_list_offers_async_from_dict(): def test_list_offers_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ListOffersRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_offers), "__call__") as call: call.return_value = service.ListOffersResponse() - client.list_offers(request) # Establish that the underlying gRPC stub method was called. @@ -5942,12 +5773,13 @@ def test_list_offers_field_headers(): @pytest.mark.asyncio async def test_list_offers_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ListOffersRequest() + request.parent = "parent/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -5955,7 +5787,6 @@ async def test_list_offers_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.ListOffersResponse() ) - await client.list_offers(request) # Establish that the underlying gRPC stub method was called. @@ -5969,7 +5800,7 @@ async def test_list_offers_field_headers_async(): def test_list_offers_pager(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_offers), "__call__") as call: @@ -6001,7 +5832,7 @@ def test_list_offers_pager(): def test_list_offers_pages(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_offers), "__call__") as call: @@ -6026,7 +5857,7 @@ def test_list_offers_pages(): @pytest.mark.asyncio async def test_list_offers_async_pager(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6059,7 +5890,7 @@ async def test_list_offers_async_pager(): @pytest.mark.asyncio async def test_list_offers_async_pages(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6090,7 +5921,7 @@ def test_list_purchasable_skus( transport: str = "grpc", request_type=service.ListPurchasableSkusRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6105,19 +5936,15 @@ def test_list_purchasable_skus( call.return_value = service.ListPurchasableSkusResponse( next_page_token="next_page_token_value", ) - response = client.list_purchasable_skus(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.ListPurchasableSkusRequest() # Establish that the response is the type that we expect. - assert isinstance(response, pagers.ListPurchasableSkusPager) - assert response.next_page_token == "next_page_token_value" @@ -6129,7 +5956,7 @@ def test_list_purchasable_skus_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6139,7 +5966,6 @@ def test_list_purchasable_skus_empty_call(): client.list_purchasable_skus() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.ListPurchasableSkusRequest() @@ -6148,7 +5974,7 @@ async def test_list_purchasable_skus_async( transport: str = "grpc_asyncio", request_type=service.ListPurchasableSkusRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6165,18 +5991,15 @@ async def test_list_purchasable_skus_async( next_page_token="next_page_token_value", ) ) - response = await client.list_purchasable_skus(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.ListPurchasableSkusRequest() # Establish that the response is the type that we expect. assert isinstance(response, pagers.ListPurchasableSkusAsyncPager) - assert response.next_page_token == "next_page_token_value" @@ -6186,11 +6009,14 @@ async def test_list_purchasable_skus_async_from_dict(): def test_list_purchasable_skus_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ListPurchasableSkusRequest() + request.customer = "customer/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -6198,7 +6024,6 @@ def test_list_purchasable_skus_field_headers(): type(client.transport.list_purchasable_skus), "__call__" ) as call: call.return_value = service.ListPurchasableSkusResponse() - client.list_purchasable_skus(request) # Establish that the underlying gRPC stub method was called. @@ -6214,12 +6039,13 @@ def test_list_purchasable_skus_field_headers(): @pytest.mark.asyncio async def test_list_purchasable_skus_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ListPurchasableSkusRequest() + request.customer = "customer/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -6229,7 +6055,6 @@ async def test_list_purchasable_skus_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.ListPurchasableSkusResponse() ) - await client.list_purchasable_skus(request) # Establish that the underlying gRPC stub method was called. @@ -6243,7 +6068,7 @@ async def test_list_purchasable_skus_field_headers_async(): def test_list_purchasable_skus_pager(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6285,7 +6110,7 @@ def test_list_purchasable_skus_pager(): def test_list_purchasable_skus_pages(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6320,7 +6145,7 @@ def test_list_purchasable_skus_pages(): @pytest.mark.asyncio async def test_list_purchasable_skus_async_pager(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6363,7 +6188,7 @@ async def test_list_purchasable_skus_async_pager(): @pytest.mark.asyncio async def test_list_purchasable_skus_async_pages(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6404,7 +6229,7 @@ def test_list_purchasable_offers( transport: str = "grpc", request_type=service.ListPurchasableOffersRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6419,19 +6244,15 @@ def test_list_purchasable_offers( call.return_value = service.ListPurchasableOffersResponse( next_page_token="next_page_token_value", ) - response = client.list_purchasable_offers(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.ListPurchasableOffersRequest() # Establish that the response is the type that we expect. - assert isinstance(response, pagers.ListPurchasableOffersPager) - assert response.next_page_token == "next_page_token_value" @@ -6443,7 +6264,7 @@ def test_list_purchasable_offers_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6453,7 +6274,6 @@ def test_list_purchasable_offers_empty_call(): client.list_purchasable_offers() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.ListPurchasableOffersRequest() @@ -6462,7 +6282,7 @@ async def test_list_purchasable_offers_async( transport: str = "grpc_asyncio", request_type=service.ListPurchasableOffersRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6479,18 +6299,15 @@ async def test_list_purchasable_offers_async( next_page_token="next_page_token_value", ) ) - response = await client.list_purchasable_offers(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.ListPurchasableOffersRequest() # Establish that the response is the type that we expect. assert isinstance(response, pagers.ListPurchasableOffersAsyncPager) - assert response.next_page_token == "next_page_token_value" @@ -6500,11 +6317,14 @@ async def test_list_purchasable_offers_async_from_dict(): def test_list_purchasable_offers_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ListPurchasableOffersRequest() + request.customer = "customer/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -6512,7 +6332,6 @@ def test_list_purchasable_offers_field_headers(): type(client.transport.list_purchasable_offers), "__call__" ) as call: call.return_value = service.ListPurchasableOffersResponse() - client.list_purchasable_offers(request) # Establish that the underlying gRPC stub method was called. @@ -6528,12 +6347,13 @@ def test_list_purchasable_offers_field_headers(): @pytest.mark.asyncio async def test_list_purchasable_offers_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ListPurchasableOffersRequest() + request.customer = "customer/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -6543,7 +6363,6 @@ async def test_list_purchasable_offers_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.ListPurchasableOffersResponse() ) - await client.list_purchasable_offers(request) # Establish that the underlying gRPC stub method was called. @@ -6557,7 +6376,7 @@ async def test_list_purchasable_offers_field_headers_async(): def test_list_purchasable_offers_pager(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6602,7 +6421,7 @@ def test_list_purchasable_offers_pager(): def test_list_purchasable_offers_pages(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6640,7 +6459,7 @@ def test_list_purchasable_offers_pages(): @pytest.mark.asyncio async def test_list_purchasable_offers_async_pager(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6686,7 +6505,7 @@ async def test_list_purchasable_offers_async_pager(): @pytest.mark.asyncio async def test_list_purchasable_offers_async_pages(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6730,7 +6549,7 @@ def test_register_subscriber( transport: str = "grpc", request_type=service.RegisterSubscriberRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6743,19 +6562,15 @@ def test_register_subscriber( ) as call: # Designate an appropriate return value for the call. call.return_value = service.RegisterSubscriberResponse(topic="topic_value",) - response = client.register_subscriber(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.RegisterSubscriberRequest() # Establish that the response is the type that we expect. - assert isinstance(response, service.RegisterSubscriberResponse) - assert response.topic == "topic_value" @@ -6767,7 +6582,7 @@ def test_register_subscriber_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6777,7 +6592,6 @@ def test_register_subscriber_empty_call(): client.register_subscriber() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.RegisterSubscriberRequest() @@ -6786,7 +6600,7 @@ async def test_register_subscriber_async( transport: str = "grpc_asyncio", request_type=service.RegisterSubscriberRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6801,18 +6615,15 @@ async def test_register_subscriber_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.RegisterSubscriberResponse(topic="topic_value",) ) - response = await client.register_subscriber(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.RegisterSubscriberRequest() # Establish that the response is the type that we expect. assert isinstance(response, service.RegisterSubscriberResponse) - assert response.topic == "topic_value" @@ -6822,11 +6633,14 @@ async def test_register_subscriber_async_from_dict(): def test_register_subscriber_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.RegisterSubscriberRequest() + request.account = "account/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -6834,7 +6648,6 @@ def test_register_subscriber_field_headers(): type(client.transport.register_subscriber), "__call__" ) as call: call.return_value = service.RegisterSubscriberResponse() - client.register_subscriber(request) # Establish that the underlying gRPC stub method was called. @@ -6850,12 +6663,13 @@ def test_register_subscriber_field_headers(): @pytest.mark.asyncio async def test_register_subscriber_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.RegisterSubscriberRequest() + request.account = "account/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -6865,7 +6679,6 @@ async def test_register_subscriber_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.RegisterSubscriberResponse() ) - await client.register_subscriber(request) # Establish that the underlying gRPC stub method was called. @@ -6882,7 +6695,7 @@ def test_unregister_subscriber( transport: str = "grpc", request_type=service.UnregisterSubscriberRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6895,19 +6708,15 @@ def test_unregister_subscriber( ) as call: # Designate an appropriate return value for the call. call.return_value = service.UnregisterSubscriberResponse(topic="topic_value",) - response = client.unregister_subscriber(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.UnregisterSubscriberRequest() # Establish that the response is the type that we expect. - assert isinstance(response, service.UnregisterSubscriberResponse) - assert response.topic == "topic_value" @@ -6919,7 +6728,7 @@ def test_unregister_subscriber_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -6929,7 +6738,6 @@ def test_unregister_subscriber_empty_call(): client.unregister_subscriber() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.UnregisterSubscriberRequest() @@ -6938,7 +6746,7 @@ async def test_unregister_subscriber_async( transport: str = "grpc_asyncio", request_type=service.UnregisterSubscriberRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -6953,18 +6761,15 @@ async def test_unregister_subscriber_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.UnregisterSubscriberResponse(topic="topic_value",) ) - response = await client.unregister_subscriber(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.UnregisterSubscriberRequest() # Establish that the response is the type that we expect. assert isinstance(response, service.UnregisterSubscriberResponse) - assert response.topic == "topic_value" @@ -6974,11 +6779,14 @@ async def test_unregister_subscriber_async_from_dict(): def test_unregister_subscriber_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.UnregisterSubscriberRequest() + request.account = "account/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -6986,7 +6794,6 @@ def test_unregister_subscriber_field_headers(): type(client.transport.unregister_subscriber), "__call__" ) as call: call.return_value = service.UnregisterSubscriberResponse() - client.unregister_subscriber(request) # Establish that the underlying gRPC stub method was called. @@ -7002,12 +6809,13 @@ def test_unregister_subscriber_field_headers(): @pytest.mark.asyncio async def test_unregister_subscriber_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.UnregisterSubscriberRequest() + request.account = "account/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -7017,7 +6825,6 @@ async def test_unregister_subscriber_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.UnregisterSubscriberResponse() ) - await client.unregister_subscriber(request) # Establish that the underlying gRPC stub method was called. @@ -7034,7 +6841,7 @@ def test_list_subscribers( transport: str = "grpc", request_type=service.ListSubscribersRequest ): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -7049,23 +6856,17 @@ def test_list_subscribers( service_accounts=["service_accounts_value"], next_page_token="next_page_token_value", ) - response = client.list_subscribers(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 _, args, _ = call.mock_calls[0] - assert args[0] == service.ListSubscribersRequest() # Establish that the response is the type that we expect. - assert isinstance(response, pagers.ListSubscribersPager) - assert response.topic == "topic_value" - assert response.service_accounts == ["service_accounts_value"] - assert response.next_page_token == "next_page_token_value" @@ -7077,7 +6878,7 @@ def test_list_subscribers_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7085,7 +6886,6 @@ def test_list_subscribers_empty_call(): client.list_subscribers() call.assert_called() _, args, _ = call.mock_calls[0] - assert args[0] == service.ListSubscribersRequest() @@ -7094,7 +6894,7 @@ async def test_list_subscribers_async( transport: str = "grpc_asyncio", request_type=service.ListSubscribersRequest ): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -7111,22 +6911,17 @@ async def test_list_subscribers_async( next_page_token="next_page_token_value", ) ) - response = await client.list_subscribers(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) _, args, _ = call.mock_calls[0] - assert args[0] == service.ListSubscribersRequest() # Establish that the response is the type that we expect. assert isinstance(response, pagers.ListSubscribersAsyncPager) - assert response.topic == "topic_value" - assert response.service_accounts == ["service_accounts_value"] - assert response.next_page_token == "next_page_token_value" @@ -7136,17 +6931,19 @@ async def test_list_subscribers_async_from_dict(): def test_list_subscribers_field_headers(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ListSubscribersRequest() + request.account = "account/value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_subscribers), "__call__") as call: call.return_value = service.ListSubscribersResponse() - client.list_subscribers(request) # Establish that the underlying gRPC stub method was called. @@ -7162,12 +6959,13 @@ def test_list_subscribers_field_headers(): @pytest.mark.asyncio async def test_list_subscribers_field_headers_async(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = service.ListSubscribersRequest() + request.account = "account/value" # Mock the actual call within the gRPC stub, and fake the request. @@ -7175,7 +6973,6 @@ async def test_list_subscribers_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( service.ListSubscribersResponse() ) - await client.list_subscribers(request) # Establish that the underlying gRPC stub method was called. @@ -7189,7 +6986,7 @@ async def test_list_subscribers_field_headers_async(): def test_list_subscribers_pager(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_subscribers), "__call__") as call: @@ -7222,7 +7019,7 @@ def test_list_subscribers_pager(): def test_list_subscribers_pages(): - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials,) + client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_subscribers), "__call__") as call: @@ -7248,7 +7045,7 @@ def test_list_subscribers_pages(): @pytest.mark.asyncio async def test_list_subscribers_async_pager(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7282,7 +7079,7 @@ async def test_list_subscribers_async_pager(): @pytest.mark.asyncio async def test_list_subscribers_async_pages(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials, + credentials=ga_credentials.AnonymousCredentials, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -7313,16 +7110,16 @@ async def test_list_subscribers_async_pages(): def test_credentials_transport_error(): # It is an error to provide credentials and a transport instance. transport = transports.CloudChannelServiceGrpcTransport( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) # It is an error to provide a credentials file and a transport instance. transport = transports.CloudChannelServiceGrpcTransport( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = CloudChannelServiceClient( @@ -7332,7 +7129,7 @@ def test_credentials_transport_error(): # It is an error to provide scopes and a transport instance. transport = transports.CloudChannelServiceGrpcTransport( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): client = CloudChannelServiceClient( @@ -7343,7 +7140,7 @@ def test_credentials_transport_error(): def test_transport_instance(): # A client may be instantiated with a custom transport instance. transport = transports.CloudChannelServiceGrpcTransport( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) client = CloudChannelServiceClient(transport=transport) assert client.transport is transport @@ -7352,13 +7149,13 @@ def test_transport_instance(): def test_transport_get_channel(): # A client may be instantiated with a custom transport instance. transport = transports.CloudChannelServiceGrpcTransport( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel transport = transports.CloudChannelServiceGrpcAsyncIOTransport( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) channel = transport.grpc_channel assert channel @@ -7373,23 +7170,25 @@ def test_transport_get_channel(): ) def test_transport_adc(transport_class): # Test default credentials are used if not provided. - with mock.patch.object(auth, "default") as adc: - adc.return_value = (credentials.AnonymousCredentials(), None) + with mock.patch.object(google.auth, "default") as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport_class() adc.assert_called_once() def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = CloudChannelServiceClient(credentials=credentials.AnonymousCredentials(),) + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials(), + ) assert isinstance(client.transport, transports.CloudChannelServiceGrpcTransport,) def test_cloud_channel_service_base_transport_error(): # Passing both a credentials object and credentials_file should raise an error - with pytest.raises(exceptions.DuplicateCredentialArgs): + with pytest.raises(core_exceptions.DuplicateCredentialArgs): transport = transports.CloudChannelServiceTransport( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), credentials_file="credentials.json", ) @@ -7401,7 +7200,7 @@ def test_cloud_channel_service_base_transport(): ) as Transport: Transport.return_value = None transport = transports.CloudChannelServiceTransport( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), ) # Every method on the transport should just blindly @@ -7451,15 +7250,37 @@ def test_cloud_channel_service_base_transport(): transport.operations_client +@requires_google_auth_gte_1_25_0 def test_cloud_channel_service_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file with mock.patch.object( - auth, "load_credentials_from_file" + google.auth, "load_credentials_from_file", autospec=True ) as load_creds, mock.patch( "google.cloud.channel_v1.services.cloud_channel_service.transports.CloudChannelServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - load_creds.return_value = (credentials.AnonymousCredentials(), None) + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) + transport = transports.CloudChannelServiceTransport( + credentials_file="credentials.json", quota_project_id="octopus", + ) + load_creds.assert_called_once_with( + "credentials.json", + scopes=None, + default_scopes=("https://www.googleapis.com/auth/apps.order",), + quota_project_id="octopus", + ) + + +@requires_google_auth_lt_1_25_0 +def test_cloud_channel_service_base_transport_with_credentials_file_old_google_auth(): + # Instantiate the base transport with a credentials file + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch( + "google.cloud.channel_v1.services.cloud_channel_service.transports.CloudChannelServiceTransport._prep_wrapped_messages" + ) as Transport: + Transport.return_value = None + load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.CloudChannelServiceTransport( credentials_file="credentials.json", quota_project_id="octopus", ) @@ -7472,19 +7293,33 @@ def test_cloud_channel_service_base_transport_with_credentials_file(): def test_cloud_channel_service_base_transport_with_adc(): # Test the default credentials are used if credentials and credentials_file are None. - with mock.patch.object(auth, "default") as adc, mock.patch( + with mock.patch.object(google.auth, "default", autospec=True) as adc, mock.patch( "google.cloud.channel_v1.services.cloud_channel_service.transports.CloudChannelServiceTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None - adc.return_value = (credentials.AnonymousCredentials(), None) + adc.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.CloudChannelServiceTransport() adc.assert_called_once() +@requires_google_auth_gte_1_25_0 def test_cloud_channel_service_auth_adc(): # If no credentials are provided, we should use ADC credentials. - with mock.patch.object(auth, "default") as adc: - adc.return_value = (credentials.AnonymousCredentials(), None) + with mock.patch.object(google.auth, "default", autospec=True) as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + CloudChannelServiceClient() + adc.assert_called_once_with( + scopes=None, + default_scopes=("https://www.googleapis.com/auth/apps.order",), + quota_project_id=None, + ) + + +@requires_google_auth_lt_1_25_0 +def test_cloud_channel_service_auth_adc_old_google_auth(): + # If no credentials are provided, we should use ADC credentials. + with mock.patch.object(google.auth, "default", autospec=True) as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) CloudChannelServiceClient() adc.assert_called_once_with( scopes=("https://www.googleapis.com/auth/apps.order",), @@ -7492,20 +7327,156 @@ def test_cloud_channel_service_auth_adc(): ) -def test_cloud_channel_service_transport_auth_adc(): +@pytest.mark.parametrize( + "transport_class", + [ + transports.CloudChannelServiceGrpcTransport, + transports.CloudChannelServiceGrpcAsyncIOTransport, + ], +) +@requires_google_auth_gte_1_25_0 +def test_cloud_channel_service_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use # ADC credentials. - with mock.patch.object(auth, "default") as adc: - adc.return_value = (credentials.AnonymousCredentials(), None) - transports.CloudChannelServiceGrpcTransport( - host="squid.clam.whelk", quota_project_id="octopus" + with mock.patch.object(google.auth, "default", autospec=True) as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport_class(quota_project_id="octopus", scopes=["1", "2"]) + adc.assert_called_once_with( + scopes=["1", "2"], + default_scopes=("https://www.googleapis.com/auth/apps.order",), + quota_project_id="octopus", ) + + +@pytest.mark.parametrize( + "transport_class", + [ + transports.CloudChannelServiceGrpcTransport, + transports.CloudChannelServiceGrpcAsyncIOTransport, + ], +) +@requires_google_auth_lt_1_25_0 +def test_cloud_channel_service_transport_auth_adc_old_google_auth(transport_class): + # If credentials and host are not provided, the transport class should use + # ADC credentials. + with mock.patch.object(google.auth, "default", autospec=True) as adc: + adc.return_value = (ga_credentials.AnonymousCredentials(), None) + transport_class(quota_project_id="octopus") adc.assert_called_once_with( scopes=("https://www.googleapis.com/auth/apps.order",), quota_project_id="octopus", ) +@pytest.mark.parametrize( + "transport_class,grpc_helpers", + [ + (transports.CloudChannelServiceGrpcTransport, grpc_helpers), + (transports.CloudChannelServiceGrpcAsyncIOTransport, grpc_helpers_async), + ], +) +@requires_api_core_gte_1_26_0 +def test_cloud_channel_service_transport_create_channel(transport_class, grpc_helpers): + # If credentials and host are not provided, the transport class should use + # ADC credentials. + with mock.patch.object( + google.auth, "default", autospec=True + ) as adc, mock.patch.object( + grpc_helpers, "create_channel", autospec=True + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + adc.return_value = (creds, None) + transport_class(quota_project_id="octopus", scopes=["1", "2"]) + + create_channel.assert_called_with( + "cloudchannel.googleapis.com:443", + credentials=creds, + credentials_file=None, + quota_project_id="octopus", + default_scopes=("https://www.googleapis.com/auth/apps.order",), + scopes=["1", "2"], + default_host="cloudchannel.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + +@pytest.mark.parametrize( + "transport_class,grpc_helpers", + [ + (transports.CloudChannelServiceGrpcTransport, grpc_helpers), + (transports.CloudChannelServiceGrpcAsyncIOTransport, grpc_helpers_async), + ], +) +@requires_api_core_lt_1_26_0 +def test_cloud_channel_service_transport_create_channel_old_api_core( + transport_class, grpc_helpers +): + # If credentials and host are not provided, the transport class should use + # ADC credentials. + with mock.patch.object( + google.auth, "default", autospec=True + ) as adc, mock.patch.object( + grpc_helpers, "create_channel", autospec=True + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + adc.return_value = (creds, None) + transport_class(quota_project_id="octopus") + + create_channel.assert_called_with( + "cloudchannel.googleapis.com:443", + credentials=creds, + credentials_file=None, + quota_project_id="octopus", + scopes=("https://www.googleapis.com/auth/apps.order",), + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + +@pytest.mark.parametrize( + "transport_class,grpc_helpers", + [ + (transports.CloudChannelServiceGrpcTransport, grpc_helpers), + (transports.CloudChannelServiceGrpcAsyncIOTransport, grpc_helpers_async), + ], +) +@requires_api_core_lt_1_26_0 +def test_cloud_channel_service_transport_create_channel_user_scopes( + transport_class, grpc_helpers +): + # If credentials and host are not provided, the transport class should use + # ADC credentials. + with mock.patch.object( + google.auth, "default", autospec=True + ) as adc, mock.patch.object( + grpc_helpers, "create_channel", autospec=True + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + adc.return_value = (creds, None) + + transport_class(quota_project_id="octopus", scopes=["1", "2"]) + + create_channel.assert_called_with( + "cloudchannel.googleapis.com:443", + credentials=creds, + credentials_file=None, + quota_project_id="octopus", + scopes=["1", "2"], + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + @pytest.mark.parametrize( "transport_class", [ @@ -7516,7 +7487,7 @@ def test_cloud_channel_service_transport_auth_adc(): def test_cloud_channel_service_grpc_transport_client_cert_source_for_mtls( transport_class, ): - cred = credentials.AnonymousCredentials() + cred = ga_credentials.AnonymousCredentials() # Check ssl_channel_credentials is used if provided. with mock.patch.object(transport_class, "create_channel") as mock_create_channel: @@ -7555,7 +7526,7 @@ def test_cloud_channel_service_grpc_transport_client_cert_source_for_mtls( def test_cloud_channel_service_host_no_port(): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="cloudchannel.googleapis.com" ), @@ -7565,7 +7536,7 @@ def test_cloud_channel_service_host_no_port(): def test_cloud_channel_service_host_with_port(): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), + credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="cloudchannel.googleapis.com:8000" ), @@ -7621,9 +7592,9 @@ def test_cloud_channel_service_transport_channel_mtls_with_client_cert_source( mock_grpc_channel = mock.Mock() grpc_create_channel.return_value = mock_grpc_channel - cred = credentials.AnonymousCredentials() + cred = ga_credentials.AnonymousCredentials() with pytest.warns(DeprecationWarning): - with mock.patch.object(auth, "default") as adc: + with mock.patch.object(google.auth, "default") as adc: adc.return_value = (cred, None) transport = transport_class( host="squid.clam.whelk", @@ -7699,7 +7670,7 @@ def test_cloud_channel_service_transport_channel_mtls_with_adc(transport_class): def test_cloud_channel_service_grpc_lro_client(): client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) transport = client.transport @@ -7712,7 +7683,7 @@ def test_cloud_channel_service_grpc_lro_client(): def test_cloud_channel_service_grpc_lro_async_client(): client = CloudChannelServiceAsyncClient( - credentials=credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) transport = client.transport @@ -7726,7 +7697,6 @@ def test_cloud_channel_service_grpc_lro_async_client(): def test_customer_path(): account = "squid" customer = "clam" - expected = "accounts/{account}/customers/{customer}".format( account=account, customer=customer, ) @@ -7750,7 +7720,6 @@ def test_entitlement_path(): account = "oyster" customer = "nudibranch" entitlement = "cuttlefish" - expected = "accounts/{account}/customers/{customer}/entitlements/{entitlement}".format( account=account, customer=customer, entitlement=entitlement, ) @@ -7774,7 +7743,6 @@ def test_parse_entitlement_path(): def test_offer_path(): account = "scallop" offer = "abalone" - expected = "accounts/{account}/offers/{offer}".format(account=account, offer=offer,) actual = CloudChannelServiceClient.offer_path(account, offer) assert expected == actual @@ -7794,7 +7762,6 @@ def test_parse_offer_path(): def test_product_path(): product = "whelk" - expected = "products/{product}".format(product=product,) actual = CloudChannelServiceClient.product_path(product) assert expected == actual @@ -7814,7 +7781,6 @@ def test_parse_product_path(): def test_sku_path(): product = "oyster" sku = "nudibranch" - expected = "products/{product}/skus/{sku}".format(product=product, sku=sku,) actual = CloudChannelServiceClient.sku_path(product, sku) assert expected == actual @@ -7834,7 +7800,6 @@ def test_parse_sku_path(): def test_common_billing_account_path(): billing_account = "winkle" - expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) @@ -7855,7 +7820,6 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): folder = "scallop" - expected = "folders/{folder}".format(folder=folder,) actual = CloudChannelServiceClient.common_folder_path(folder) assert expected == actual @@ -7874,7 +7838,6 @@ def test_parse_common_folder_path(): def test_common_organization_path(): organization = "squid" - expected = "organizations/{organization}".format(organization=organization,) actual = CloudChannelServiceClient.common_organization_path(organization) assert expected == actual @@ -7893,7 +7856,6 @@ def test_parse_common_organization_path(): def test_common_project_path(): project = "whelk" - expected = "projects/{project}".format(project=project,) actual = CloudChannelServiceClient.common_project_path(project) assert expected == actual @@ -7913,7 +7875,6 @@ def test_parse_common_project_path(): def test_common_location_path(): project = "oyster" location = "nudibranch" - expected = "projects/{project}/locations/{location}".format( project=project, location=location, ) @@ -7940,7 +7901,7 @@ def test_client_withDEFAULT_CLIENT_INFO(): transports.CloudChannelServiceTransport, "_prep_wrapped_messages" ) as prep: client = CloudChannelServiceClient( - credentials=credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -7949,6 +7910,6 @@ def test_client_withDEFAULT_CLIENT_INFO(): ) as prep: transport_class = CloudChannelServiceClient.get_transport_class() transport = transport_class( - credentials=credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) prep.assert_called_once_with(client_info)