diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 7519fa3..b668c04 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,17 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:0e18b9475fbeb12d9ad4302283171edebb6baf2dfca1bd215ee3b34ed79d95d7 + digest: sha256:ed1f9983d5a935a89fe8085e8bb97d94e41015252c5b6c9771257cf8624367e6 + diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 44cc868..e446644 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -8,5 +8,5 @@ # @googleapis/yoshi-python is the default owner for changes in this repo * @googleapis/yoshi-python -# @googleapis/python-samples-owners is the default owner for samples changes -/samples/ @googleapis/python-samples-owners +# @googleapis/python-samples-reviewers is the default owner for samples changes +/samples/ @googleapis/python-samples-reviewers diff --git a/.github/release-please.yml b/.github/release-please.yml index 4507ad0..466597e 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1 +1,2 @@ releaseType: python +handleGHRelease: true diff --git a/.github/release-trigger.yml b/.github/release-trigger.yml new file mode 100644 index 0000000..d4ca941 --- /dev/null +++ b/.github/release-trigger.yml @@ -0,0 +1 @@ +enabled: true diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..f7b8344 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,38 @@ +on: + pull_request: + branches: + - main +name: docs +jobs: + docs: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run docs + run: | + nox -s docs + docfx: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run docfx + run: | + nox -s docfx diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..1e8b05c --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,25 @@ +on: + pull_request: + branches: + - main +name: lint +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run lint + run: | + nox -s lint + - name: Run lint_setup_py + run: | + nox -s lint_setup_py diff --git a/.github/workflows/unittest.yml b/.github/workflows/unittest.yml new file mode 100644 index 0000000..074ee25 --- /dev/null +++ b/.github/workflows/unittest.yml @@ -0,0 +1,57 @@ +on: + pull_request: + branches: + - main +name: unittest +jobs: + unit: + runs-on: ubuntu-latest + strategy: + matrix: + python: ['3.6', '3.7', '3.8', '3.9', '3.10'] + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python }} + - name: Install nox + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install nox + - name: Run unit tests + env: + COVERAGE_FILE: .coverage-${{ matrix.python }} + run: | + nox -s unit-${{ matrix.python }} + - name: Upload coverage results + uses: actions/upload-artifact@v2 + with: + name: coverage-artifacts + path: .coverage-${{ matrix.python }} + + cover: + runs-on: ubuntu-latest + needs: + - unit + steps: + - name: Checkout + uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v2 + with: + python-version: "3.10" + - name: Install coverage + run: | + python -m pip install --upgrade setuptools pip wheel + python -m pip install coverage + - name: Download coverage results + uses: actions/download-artifact@v2 + with: + name: coverage-artifacts + path: .coverage-results/ + - name: Report coverage results + run: | + coverage combine .coverage-results/.coverage* + coverage report --show-missing --fail-under=100 diff --git a/.kokoro/release.sh b/.kokoro/release.sh index 627f8a7..55b1769 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_GFILE_DIR}/secret_manager/google-cloud-pypi-token") +TWINE_PASSWORD=$(cat "${KOKORO_KEYSTORE_DIR}/73713_google-cloud-pypi-token-keystore-1") cd github/python-channel python3 setup.py sdist bdist_wheel twine upload --username __token__ --password "${TWINE_PASSWORD}" dist/* diff --git a/.kokoro/release/common.cfg b/.kokoro/release/common.cfg index ad86c76..91c72cb 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -23,8 +23,18 @@ 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-token-keystore-1" + } + } +} + # 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,google-cloud-pypi-token" + value: "releasetool-publish-reporter-app,releasetool-publish-reporter-googleapis-installation,releasetool-publish-reporter-pem" } diff --git a/.repo-metadata.json b/.repo-metadata.json index bd565bd..c09455a 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -2,14 +2,15 @@ "name": "cloudchannel", "name_pretty": "Channel Services", "product_documentation": "https://cloud.google.com/channel/", - "client_documentation": "https://googleapis.dev/python/cloudchannel/latest", + "client_documentation": "https://cloud.google.com/python/docs/reference/cloudchannel/latest", "issue_tracker": "", - "release_level": "ga", + "release_level": "stable", "language": "python", "library_type": "GAPIC_AUTO", "repo": "googleapis/python-channel", "distribution_name": "google-cloud-channel", "api_id": "cloudchannel.googleapis.com", "default_version": "v1", - "codeowner_team": "" + "codeowner_team": "", + "api_shortname": "cloudchannel" } diff --git a/CHANGELOG.md b/CHANGELOG.md index 90e6259..19fe9f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # Changelog +## [1.7.0](https://github.com/googleapis/python-channel/compare/v1.6.3...v1.7.0) (2022-02-26) + + +### Features + +* add api key support ([#133](https://github.com/googleapis/python-channel/issues/133)) ([df6f6d7](https://github.com/googleapis/python-channel/commit/df6f6d723d507cb332b70c343c92468b90298327)) + + +### Bug Fixes + +* resolve DuplicateCredentialArgs error when using credentials_file ([f57605e](https://github.com/googleapis/python-channel/commit/f57605ec93277a32f88d33967b704c45e3fc060a)) + + +### Documentation + +* clarify language for provisioning_id ([#140](https://github.com/googleapis/python-channel/issues/140)) ([a925354](https://github.com/googleapis/python-channel/commit/a925354a36a6587219a6525da100afbd36f48a68)) +* Update description for ProvisionedService.provisioning_id ([#137](https://github.com/googleapis/python-channel/issues/137)) ([9b24071](https://github.com/googleapis/python-channel/commit/9b24071c8701355bf29916c0a35cc1d8f067d12e)) + ### [1.6.3](https://www.github.com/googleapis/python-channel/compare/v1.6.2...v1.6.3) (2021-11-13) diff --git a/README.rst b/README.rst index cd9ef9f..9b5a8a2 100644 --- a/README.rst +++ b/README.rst @@ -17,7 +17,7 @@ order management, billing management, policy and authorization management, and c .. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-channel.svg :target: https://pypi.org/project/google-cloud-channel/ .. _Cloud Channel API: https://cloud.google.com/channel/docs -.. _Client Library Documentation: https://googleapis.dev/python/cloudchannel/latest +.. _Client Library Documentation: https://cloud.google.com/python/docs/reference/cloudchannel/latest .. _Product Documentation: https://cloud.google.com/channel/docs Quick Start diff --git a/google/cloud/channel/__init__.py b/google/cloud/channel/__init__.py index 74333e9..12606ff 100644 --- a/google/cloud/channel/__init__.py +++ b/google/cloud/channel/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/channel_v1/__init__.py b/google/cloud/channel_v1/__init__.py index fec98e9..2503677 100644 --- a/google/cloud/channel_v1/__init__.py +++ b/google/cloud/channel_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/channel_v1/services/__init__.py b/google/cloud/channel_v1/services/__init__.py index 4de6597..e8e1c38 100644 --- a/google/cloud/channel_v1/services/__init__.py +++ b/google/cloud/channel_v1/services/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/channel_v1/services/cloud_channel_service/__init__.py b/google/cloud/channel_v1/services/cloud_channel_service/__init__.py index 9a6db7f..e8b88c8 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,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/channel_v1/services/cloud_channel_service/async_client.py b/google/cloud/channel_v1/services/cloud_channel_service/async_client.py index 6e35514..eaef140 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,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -16,7 +16,7 @@ from collections import OrderedDict import functools import re -from typing import Dict, Sequence, Tuple, Type, Union +from typing import Dict, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core.client_options import ClientOptions @@ -157,6 +157,42 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): from_service_account_json = from_service_account_file + @classmethod + def get_mtls_endpoint_and_cert_source( + cls, client_options: Optional[ClientOptions] = None + ): + """Return the API endpoint and client cert source for mutual TLS. + + The client cert source is determined in the following order: + (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the + client cert source is None. + (2) if `client_options.client_cert_source` is provided, use the provided one; if the + default client cert source exists, use the default one; otherwise the client cert + source is None. + + The API endpoint is determined in the following order: + (1) if `client_options.api_endpoint` if provided, use the provided one. + (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the + default mTLS endpoint; if the environment variabel is "never", use the default API + endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise + use the default API endpoint. + + More details can be found at https://google.aip.dev/auth/4114. + + Args: + client_options (google.api_core.client_options.ClientOptions): Custom options for the + client. Only the `api_endpoint` and `client_cert_source` properties may be used + in this method. + + Returns: + Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the + client cert source to use. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If any errors happen. + """ + return CloudChannelServiceClient.get_mtls_endpoint_and_cert_source(client_options) # type: ignore + @property def transport(self) -> CloudChannelServiceTransport: """Returns the transport used by the client instance. @@ -239,6 +275,27 @@ async def list_customers( [Customer][google.cloud.channel.v1.Customer]s, or an empty list if there are no customers. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_customers(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListCustomersRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_customers(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListCustomersRequest, dict]): The request object. Request message for @@ -311,6 +368,26 @@ async def get_customer( Return value: The [Customer][google.cloud.channel.v1.Customer] resource. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_get_customer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.GetCustomerRequest( + name="name_value", + ) + + # Make the request + response = client.get_customer(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.GetCustomerRequest, dict]): The request object. Request message for @@ -336,7 +413,7 @@ async def get_customer( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -401,6 +478,27 @@ async def check_cloud_identity_accounts_exist( [CloudIdentityCustomerAccount][google.cloud.channel.v1.CloudIdentityCustomerAccount] resources match the domain. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_check_cloud_identity_accounts_exist(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.CheckCloudIdentityAccountsExistRequest( + parent="parent_value", + domain="domain_value", + ) + + # Make the request + response = client.check_cloud_identity_accounts_exist(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.CheckCloudIdentityAccountsExistRequest, dict]): The request object. Request message for @@ -463,6 +561,31 @@ async def create_customer( Return value: The newly created [Customer][google.cloud.channel.v1.Customer] resource. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_create_customer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + customer = channel_v1.Customer() + customer.org_display_name = "org_display_name_value" + customer.domain = "domain_value" + + request = channel_v1.CreateCustomerRequest( + parent="parent_value", + customer=customer, + ) + + # Make the request + response = client.create_customer(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.CreateCustomerRequest, dict]): The request object. Request message for @@ -525,6 +648,30 @@ async def update_customer( Return value: The updated [Customer][google.cloud.channel.v1.Customer] resource. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_update_customer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + customer = channel_v1.Customer() + customer.org_display_name = "org_display_name_value" + customer.domain = "domain_value" + + request = channel_v1.UpdateCustomerRequest( + customer=customer, + ) + + # Make the request + response = client.update_customer(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.UpdateCustomerRequest, dict]): The request object. Request message for @@ -588,6 +735,23 @@ async def delete_customer( - NOT_FOUND: No [Customer][google.cloud.channel.v1.Customer] resource found for the name in the request. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_delete_customer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.DeleteCustomerRequest( + name="name_value", + ) + + # Make the request + client.delete_customer(request=request) + Args: request (Union[google.cloud.channel_v1.types.DeleteCustomerRequest, dict]): The request object. Request message for @@ -606,7 +770,7 @@ async def delete_customer( sent along with the request as metadata. """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -667,6 +831,28 @@ async def import_customer( Return value: The [Customer][google.cloud.channel.v1.Customer]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_import_customer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ImportCustomerRequest( + domain="domain_value", + parent="parent_value", + overwrite_if_exists=True, + ) + + # Make the request + response = client.import_customer(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.ImportCustomerRequest, dict]): The request object. Request message for @@ -738,6 +924,30 @@ async def provision_cloud_identity( contains an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_provision_cloud_identity(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ProvisionCloudIdentityRequest( + customer="customer_value", + ) + + # Make the request + operation = client.provision_cloud_identity(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.ProvisionCloudIdentityRequest, dict]): The request object. Request message for @@ -809,6 +1019,27 @@ async def list_entitlements( Return value: A list of the customer's [Entitlement][google.cloud.channel.v1.Entitlement]s. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_entitlements(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListEntitlementsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_entitlements(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListEntitlementsRequest, dict]): The request object. Request message for @@ -889,6 +1120,28 @@ async def list_transferable_skus( Return value: A list of the customer's [TransferableSku][google.cloud.channel.v1.TransferableSku]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_transferable_skus(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListTransferableSkusRequest( + cloud_identity_id="cloud_identity_id_value", + parent="parent_value", + ) + + # Make the request + page_result = client.list_transferable_skus(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListTransferableSkusRequest, dict]): The request object. Request message for @@ -971,6 +1224,29 @@ async def list_transferable_offers( [TransferableOffer][google.cloud.channel.v1.TransferableOffer] for the given customer and SKU. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_transferable_offers(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListTransferableOffersRequest( + cloud_identity_id="cloud_identity_id_value", + parent="parent_value", + sku="sku_value", + ) + + # Make the request + page_result = client.list_transferable_offers(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListTransferableOffersRequest, dict]): The request object. Request message for @@ -1041,6 +1317,26 @@ async def get_entitlement( Return value: The requested [Entitlement][google.cloud.channel.v1.Entitlement] resource. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_get_entitlement(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.GetEntitlementRequest( + name="name_value", + ) + + # Make the request + response = client.get_entitlement(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.GetEntitlementRequest, dict]): The request object. Request message for @@ -1134,6 +1430,34 @@ async def create_entitlement( will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_create_entitlement(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + entitlement = channel_v1.Entitlement() + entitlement.offer = "offer_value" + + request = channel_v1.CreateEntitlementRequest( + parent="parent_value", + entitlement=entitlement, + ) + + # Make the request + operation = client.create_entitlement(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.CreateEntitlementRequest, dict]): The request object. Request message for @@ -1219,6 +1543,30 @@ async def change_parameters( will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_change_parameters(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ChangeParametersRequest( + name="name_value", + ) + + # Make the request + operation = client.change_parameters(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.ChangeParametersRequest, dict]): The request object. Request message for @@ -1306,6 +1654,30 @@ async def change_renewal_settings( will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_change_renewal_settings(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ChangeRenewalSettingsRequest( + name="name_value", + ) + + # Make the request + operation = client.change_renewal_settings(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.ChangeRenewalSettingsRequest, dict]): The request object. Request message for @@ -1389,6 +1761,31 @@ async def change_offer( will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_change_offer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ChangeOfferRequest( + name="name_value", + offer="offer_value", + ) + + # Make the request + operation = client.change_offer(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.ChangeOfferRequest, dict]): The request object. Request message for @@ -1475,6 +1872,30 @@ async def start_paid_service( will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_start_paid_service(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.StartPaidServiceRequest( + name="name_value", + ) + + # Make the request + operation = client.start_paid_service(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.StartPaidServiceRequest, dict]): The request object. Request message for @@ -1558,6 +1979,30 @@ async def suspend_entitlement( will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_suspend_entitlement(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.SuspendEntitlementRequest( + name="name_value", + ) + + # Make the request + operation = client.suspend_entitlement(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.SuspendEntitlementRequest, dict]): The request object. Request message for @@ -1646,6 +2091,30 @@ async def cancel_entitlement( will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_cancel_entitlement(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.CancelEntitlementRequest( + name="name_value", + ) + + # Make the request + operation = client.cancel_entitlement(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.CancelEntitlementRequest, dict]): The request object. Request message for @@ -1745,6 +2214,30 @@ async def activate_entitlement( will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_activate_entitlement(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ActivateEntitlementRequest( + name="name_value", + ) + + # Make the request + operation = client.activate_entitlement(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.ActivateEntitlementRequest, dict]): The request object. Request message for @@ -1841,6 +2334,34 @@ async def transfer_entitlements( will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_transfer_entitlements(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + entitlements = channel_v1.Entitlement() + entitlements.offer = "offer_value" + + request = channel_v1.TransferEntitlementsRequest( + parent="parent_value", + entitlements=entitlements, + ) + + # Make the request + operation = client.transfer_entitlements(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.TransferEntitlementsRequest, dict]): The request object. Request message for @@ -1936,6 +2457,34 @@ async def transfer_entitlements_to_google( will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_transfer_entitlements_to_google(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + entitlements = channel_v1.Entitlement() + entitlements.offer = "offer_value" + + request = channel_v1.TransferEntitlementsToGoogleRequest( + parent="parent_value", + entitlements=entitlements, + ) + + # Make the request + operation = client.transfer_entitlements_to_google(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.TransferEntitlementsToGoogleRequest, dict]): The request object. Request message for @@ -2020,6 +2569,27 @@ async def list_channel_partner_links( [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resources. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_channel_partner_links(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListChannelPartnerLinksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_channel_partner_links(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListChannelPartnerLinksRequest, dict]): The request object. Request message for @@ -2093,6 +2663,26 @@ async def get_channel_partner_link( [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_get_channel_partner_link(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.GetChannelPartnerLinkRequest( + name="name_value", + ) + + # Make the request + response = client.get_channel_partner_link(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.GetChannelPartnerLinkRequest, dict]): The request object. Request message for @@ -2167,6 +2757,31 @@ async def create_channel_partner_link( [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_create_channel_partner_link(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + channel_partner_link = channel_v1.ChannelPartnerLink() + channel_partner_link.reseller_cloud_identity_id = "reseller_cloud_identity_id_value" + channel_partner_link.link_state = "SUSPENDED" + + request = channel_v1.CreateChannelPartnerLinkRequest( + parent="parent_value", + channel_partner_link=channel_partner_link, + ) + + # Make the request + response = client.create_channel_partner_link(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.CreateChannelPartnerLinkRequest, dict]): The request object. Request message for @@ -2241,6 +2856,31 @@ async def update_channel_partner_link( [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_update_channel_partner_link(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + channel_partner_link = channel_v1.ChannelPartnerLink() + channel_partner_link.reseller_cloud_identity_id = "reseller_cloud_identity_id_value" + channel_partner_link.link_state = "SUSPENDED" + + request = channel_v1.UpdateChannelPartnerLinkRequest( + name="name_value", + channel_partner_link=channel_partner_link, + ) + + # Make the request + response = client.update_channel_partner_link(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.UpdateChannelPartnerLinkRequest, dict]): The request object. Request message for @@ -2303,6 +2943,26 @@ async def lookup_offer( Return value: The [Offer][google.cloud.channel.v1.Offer] resource. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_lookup_offer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.LookupOfferRequest( + entitlement="entitlement_value", + ) + + # Make the request + response = client.lookup_offer(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.LookupOfferRequest, dict]): The request object. Request message for LookupOffer. @@ -2361,6 +3021,27 @@ async def list_products( - INVALID_ARGUMENT: Required request parameters are missing or invalid. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_products(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListProductsRequest( + account="account_value", + ) + + # Make the request + page_result = client.list_products(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListProductsRequest, dict]): The request object. Request message for ListProducts. @@ -2416,6 +3097,28 @@ async def list_skus( - INVALID_ARGUMENT: Required request parameters are missing or invalid. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_skus(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListSkusRequest( + parent="parent_value", + account="account_value", + ) + + # Make the request + page_result = client.list_skus(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListSkusRequest, dict]): The request object. Request message for ListSkus. @@ -2477,6 +3180,27 @@ async def list_offers( - INVALID_ARGUMENT: Required request parameters are missing or invalid. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_offers(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListOffersRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_offers(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListOffersRequest, dict]): The request object. Request message for ListOffers. @@ -2543,6 +3267,31 @@ async def list_purchasable_skus( - INVALID_ARGUMENT: Required request parameters are missing or invalid. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_purchasable_skus(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + create_entitlement_purchase = channel_v1.CreateEntitlementPurchase() + create_entitlement_purchase.product = "product_value" + + request = channel_v1.ListPurchasableSkusRequest( + create_entitlement_purchase=create_entitlement_purchase, + customer="customer_value", + ) + + # Make the request + page_result = client.list_purchasable_skus(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListPurchasableSkusRequest, dict]): The request object. Request message for @@ -2611,6 +3360,31 @@ async def list_purchasable_offers( - INVALID_ARGUMENT: Required request parameters are missing or invalid. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_purchasable_offers(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + create_entitlement_purchase = channel_v1.CreateEntitlementPurchase() + create_entitlement_purchase.sku = "sku_value" + + request = channel_v1.ListPurchasableOffersRequest( + create_entitlement_purchase=create_entitlement_purchase, + customer="customer_value", + ) + + # Make the request + page_result = client.list_purchasable_offers(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListPurchasableOffersRequest, dict]): The request object. Request message for @@ -2687,6 +3461,27 @@ async def register_subscriber( Return value: The topic name with the registered service email address. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_register_subscriber(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.RegisterSubscriberRequest( + account="account_value", + service_account="service_account_value", + ) + + # Make the request + response = client.register_subscriber(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.RegisterSubscriberRequest, dict]): The request object. Request Message for @@ -2757,6 +3552,27 @@ async def unregister_subscriber( address. Returns a success response if the service email address wasn't registered with the topic. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_unregister_subscriber(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.UnregisterSubscriberRequest( + account="account_value", + service_account="service_account_value", + ) + + # Make the request + response = client.unregister_subscriber(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.UnregisterSubscriberRequest, dict]): The request object. Request Message for @@ -2822,6 +3638,27 @@ async def list_subscribers( Return value: A list of service email addresses. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_subscribers(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListSubscribersRequest( + account="account_value", + ) + + # Make the request + page_result = client.list_subscribers(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListSubscribersRequest, dict]): The request object. Request Message for ListSubscribers. 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 f1b0c16..9f36957 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,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -333,6 +333,73 @@ def parse_common_location_path(path: str) -> Dict[str, str]: m = re.match(r"^projects/(?P.+?)/locations/(?P.+?)$", path) return m.groupdict() if m else {} + @classmethod + def get_mtls_endpoint_and_cert_source( + cls, client_options: Optional[client_options_lib.ClientOptions] = None + ): + """Return the API endpoint and client cert source for mutual TLS. + + The client cert source is determined in the following order: + (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the + client cert source is None. + (2) if `client_options.client_cert_source` is provided, use the provided one; if the + default client cert source exists, use the default one; otherwise the client cert + source is None. + + The API endpoint is determined in the following order: + (1) if `client_options.api_endpoint` if provided, use the provided one. + (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the + default mTLS endpoint; if the environment variabel is "never", use the default API + endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise + use the default API endpoint. + + More details can be found at https://google.aip.dev/auth/4114. + + Args: + client_options (google.api_core.client_options.ClientOptions): Custom options for the + client. Only the `api_endpoint` and `client_cert_source` properties may be used + in this method. + + Returns: + Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the + client cert source to use. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If any errors happen. + """ + if client_options is None: + client_options = client_options_lib.ClientOptions() + use_client_cert = os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") + use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto") + if use_client_cert not in ("true", "false"): + raise ValueError( + "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" + ) + if use_mtls_endpoint not in ("auto", "never", "always"): + raise MutualTLSChannelError( + "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" + ) + + # Figure out the client cert source to use. + client_cert_source = None + if use_client_cert == "true": + if client_options.client_cert_source: + client_cert_source = client_options.client_cert_source + elif mtls.has_default_client_cert_source(): + client_cert_source = mtls.default_client_cert_source() + + # Figure out which api endpoint to use. + if client_options.api_endpoint is not None: + api_endpoint = client_options.api_endpoint + elif use_mtls_endpoint == "always" or ( + use_mtls_endpoint == "auto" and client_cert_source + ): + api_endpoint = cls.DEFAULT_MTLS_ENDPOINT + else: + api_endpoint = cls.DEFAULT_ENDPOINT + + return api_endpoint, client_cert_source + def __init__( self, *, @@ -383,57 +450,22 @@ def __init__( if client_options is None: client_options = client_options_lib.ClientOptions() - # Create SSL credentials for mutual TLS if needed. - if os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") not in ( - "true", - "false", - ): - raise ValueError( - "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" - ) - use_client_cert = ( - os.getenv("GOOGLE_API_USE_CLIENT_CERTIFICATE", "false") == "true" + api_endpoint, client_cert_source_func = self.get_mtls_endpoint_and_cert_source( + client_options ) - client_cert_source_func = None - is_mtls = False - if use_client_cert: - if client_options.client_cert_source: - is_mtls = True - client_cert_source_func = client_options.client_cert_source - else: - is_mtls = mtls.has_default_client_cert_source() - 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: - api_endpoint = client_options.api_endpoint - else: - use_mtls_env = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto") - if use_mtls_env == "never": - api_endpoint = self.DEFAULT_ENDPOINT - elif use_mtls_env == "always": - api_endpoint = self.DEFAULT_MTLS_ENDPOINT - elif use_mtls_env == "auto": - 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" - ) + api_key_value = getattr(client_options, "api_key", None) + if api_key_value and credentials: + raise ValueError( + "client_options.api_key and credentials are mutually exclusive" + ) # Save or instantiate the transport. # Ordinarily, we provide the transport, but allowing a custom transport # instance provides an extensibility point for unusual situations. if isinstance(transport, CloudChannelServiceTransport): # transport is a CloudChannelServiceTransport instance. - if credentials or client_options.credentials_file: + if credentials or client_options.credentials_file or api_key_value: raise ValueError( "When providing a transport instance, " "provide its credentials directly." @@ -445,6 +477,15 @@ def __init__( ) self._transport = transport else: + import google.auth._default # type: ignore + + if api_key_value and hasattr( + google.auth._default, "get_api_key_credentials" + ): + credentials = google.auth._default.get_api_key_credentials( + api_key_value + ) + Transport = type(self).get_transport_class(transport) self._transport = Transport( credentials=credentials, @@ -478,6 +519,27 @@ def list_customers( [Customer][google.cloud.channel.v1.Customer]s, or an empty list if there are no customers. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_customers(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListCustomersRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_customers(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListCustomersRequest, dict]): The request object. Request message for @@ -551,6 +613,26 @@ def get_customer( Return value: The [Customer][google.cloud.channel.v1.Customer] resource. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_get_customer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.GetCustomerRequest( + name="name_value", + ) + + # Make the request + response = client.get_customer(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.GetCustomerRequest, dict]): The request object. Request message for @@ -576,7 +658,7 @@ def get_customer( """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -641,6 +723,27 @@ def check_cloud_identity_accounts_exist( [CloudIdentityCustomerAccount][google.cloud.channel.v1.CloudIdentityCustomerAccount] resources match the domain. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_check_cloud_identity_accounts_exist(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.CheckCloudIdentityAccountsExistRequest( + parent="parent_value", + domain="domain_value", + ) + + # Make the request + response = client.check_cloud_identity_accounts_exist(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.CheckCloudIdentityAccountsExistRequest, dict]): The request object. Request message for @@ -706,6 +809,31 @@ def create_customer( Return value: The newly created [Customer][google.cloud.channel.v1.Customer] resource. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_create_customer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + customer = channel_v1.Customer() + customer.org_display_name = "org_display_name_value" + customer.domain = "domain_value" + + request = channel_v1.CreateCustomerRequest( + parent="parent_value", + customer=customer, + ) + + # Make the request + response = client.create_customer(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.CreateCustomerRequest, dict]): The request object. Request message for @@ -769,6 +897,30 @@ def update_customer( Return value: The updated [Customer][google.cloud.channel.v1.Customer] resource. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_update_customer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + customer = channel_v1.Customer() + customer.org_display_name = "org_display_name_value" + customer.domain = "domain_value" + + request = channel_v1.UpdateCustomerRequest( + customer=customer, + ) + + # Make the request + response = client.update_customer(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.UpdateCustomerRequest, dict]): The request object. Request message for @@ -833,6 +985,23 @@ def delete_customer( - NOT_FOUND: No [Customer][google.cloud.channel.v1.Customer] resource found for the name in the request. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_delete_customer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.DeleteCustomerRequest( + name="name_value", + ) + + # Make the request + client.delete_customer(request=request) + Args: request (Union[google.cloud.channel_v1.types.DeleteCustomerRequest, dict]): The request object. Request message for @@ -851,7 +1020,7 @@ def delete_customer( sent along with the request as metadata. """ # Create or coerce a protobuf request object. - # Sanity check: If we got a request object, we should *not* have + # Quick check: If we got a request object, we should *not* have # gotten any keyword arguments that map to the request. has_flattened_params = any([name]) if request is not None and has_flattened_params: @@ -912,6 +1081,28 @@ def import_customer( Return value: The [Customer][google.cloud.channel.v1.Customer]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_import_customer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ImportCustomerRequest( + domain="domain_value", + parent="parent_value", + overwrite_if_exists=True, + ) + + # Make the request + response = client.import_customer(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.ImportCustomerRequest, dict]): The request object. Request message for @@ -984,6 +1175,30 @@ def provision_cloud_identity( contains an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_provision_cloud_identity(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ProvisionCloudIdentityRequest( + customer="customer_value", + ) + + # Make the request + operation = client.provision_cloud_identity(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.ProvisionCloudIdentityRequest, dict]): The request object. Request message for @@ -1056,6 +1271,27 @@ def list_entitlements( Return value: A list of the customer's [Entitlement][google.cloud.channel.v1.Entitlement]s. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_entitlements(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListEntitlementsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_entitlements(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListEntitlementsRequest, dict]): The request object. Request message for @@ -1137,6 +1373,28 @@ def list_transferable_skus( Return value: A list of the customer's [TransferableSku][google.cloud.channel.v1.TransferableSku]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_transferable_skus(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListTransferableSkusRequest( + cloud_identity_id="cloud_identity_id_value", + parent="parent_value", + ) + + # Make the request + page_result = client.list_transferable_skus(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListTransferableSkusRequest, dict]): The request object. Request message for @@ -1220,6 +1478,29 @@ def list_transferable_offers( [TransferableOffer][google.cloud.channel.v1.TransferableOffer] for the given customer and SKU. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_transferable_offers(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListTransferableOffersRequest( + cloud_identity_id="cloud_identity_id_value", + parent="parent_value", + sku="sku_value", + ) + + # Make the request + page_result = client.list_transferable_offers(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListTransferableOffersRequest, dict]): The request object. Request message for @@ -1291,6 +1572,26 @@ def get_entitlement( Return value: The requested [Entitlement][google.cloud.channel.v1.Entitlement] resource. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_get_entitlement(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.GetEntitlementRequest( + name="name_value", + ) + + # Make the request + response = client.get_entitlement(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.GetEntitlementRequest, dict]): The request object. Request message for @@ -1385,6 +1686,34 @@ def create_entitlement( will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_create_entitlement(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + entitlement = channel_v1.Entitlement() + entitlement.offer = "offer_value" + + request = channel_v1.CreateEntitlementRequest( + parent="parent_value", + entitlement=entitlement, + ) + + # Make the request + operation = client.create_entitlement(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.CreateEntitlementRequest, dict]): The request object. Request message for @@ -1471,6 +1800,30 @@ def change_parameters( will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_change_parameters(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ChangeParametersRequest( + name="name_value", + ) + + # Make the request + operation = client.change_parameters(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.ChangeParametersRequest, dict]): The request object. Request message for @@ -1559,6 +1912,30 @@ def change_renewal_settings( will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_change_renewal_settings(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ChangeRenewalSettingsRequest( + name="name_value", + ) + + # Make the request + operation = client.change_renewal_settings(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.ChangeRenewalSettingsRequest, dict]): The request object. Request message for @@ -1643,6 +2020,31 @@ def change_offer( will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_change_offer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ChangeOfferRequest( + name="name_value", + offer="offer_value", + ) + + # Make the request + operation = client.change_offer(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.ChangeOfferRequest, dict]): The request object. Request message for @@ -1730,6 +2132,30 @@ def start_paid_service( will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_start_paid_service(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.StartPaidServiceRequest( + name="name_value", + ) + + # Make the request + operation = client.start_paid_service(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.StartPaidServiceRequest, dict]): The request object. Request message for @@ -1814,6 +2240,30 @@ def suspend_entitlement( will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_suspend_entitlement(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.SuspendEntitlementRequest( + name="name_value", + ) + + # Make the request + operation = client.suspend_entitlement(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.SuspendEntitlementRequest, dict]): The request object. Request message for @@ -1903,6 +2353,30 @@ def cancel_entitlement( will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_cancel_entitlement(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.CancelEntitlementRequest( + name="name_value", + ) + + # Make the request + operation = client.cancel_entitlement(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.CancelEntitlementRequest, dict]): The request object. Request message for @@ -2003,6 +2477,30 @@ def activate_entitlement( will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_activate_entitlement(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ActivateEntitlementRequest( + name="name_value", + ) + + # Make the request + operation = client.activate_entitlement(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.ActivateEntitlementRequest, dict]): The request object. Request message for @@ -2100,6 +2598,34 @@ def transfer_entitlements( will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_transfer_entitlements(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + entitlements = channel_v1.Entitlement() + entitlements.offer = "offer_value" + + request = channel_v1.TransferEntitlementsRequest( + parent="parent_value", + entitlements=entitlements, + ) + + # Make the request + operation = client.transfer_entitlements(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.TransferEntitlementsRequest, dict]): The request object. Request message for @@ -2196,6 +2722,34 @@ def transfer_entitlements_to_google( will contain an instance of [OperationMetadata][google.cloud.channel.v1.OperationMetadata]. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_transfer_entitlements_to_google(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + entitlements = channel_v1.Entitlement() + entitlements.offer = "offer_value" + + request = channel_v1.TransferEntitlementsToGoogleRequest( + parent="parent_value", + entitlements=entitlements, + ) + + # Make the request + operation = client.transfer_entitlements_to_google(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.TransferEntitlementsToGoogleRequest, dict]): The request object. Request message for @@ -2283,6 +2837,27 @@ def list_channel_partner_links( [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resources. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_channel_partner_links(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListChannelPartnerLinksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_channel_partner_links(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListChannelPartnerLinksRequest, dict]): The request object. Request message for @@ -2359,6 +2934,26 @@ def get_channel_partner_link( [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_get_channel_partner_link(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.GetChannelPartnerLinkRequest( + name="name_value", + ) + + # Make the request + response = client.get_channel_partner_link(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.GetChannelPartnerLinkRequest, dict]): The request object. Request message for @@ -2434,6 +3029,31 @@ def create_channel_partner_link( [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_create_channel_partner_link(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + channel_partner_link = channel_v1.ChannelPartnerLink() + channel_partner_link.reseller_cloud_identity_id = "reseller_cloud_identity_id_value" + channel_partner_link.link_state = "SUSPENDED" + + request = channel_v1.CreateChannelPartnerLinkRequest( + parent="parent_value", + channel_partner_link=channel_partner_link, + ) + + # Make the request + response = client.create_channel_partner_link(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.CreateChannelPartnerLinkRequest, dict]): The request object. Request message for @@ -2511,6 +3131,31 @@ def update_channel_partner_link( [ChannelPartnerLink][google.cloud.channel.v1.ChannelPartnerLink] resource. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_update_channel_partner_link(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + channel_partner_link = channel_v1.ChannelPartnerLink() + channel_partner_link.reseller_cloud_identity_id = "reseller_cloud_identity_id_value" + channel_partner_link.link_state = "SUSPENDED" + + request = channel_v1.UpdateChannelPartnerLinkRequest( + name="name_value", + channel_partner_link=channel_partner_link, + ) + + # Make the request + response = client.update_channel_partner_link(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.UpdateChannelPartnerLinkRequest, dict]): The request object. Request message for @@ -2576,6 +3221,26 @@ def lookup_offer( Return value: The [Offer][google.cloud.channel.v1.Offer] resource. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_lookup_offer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.LookupOfferRequest( + entitlement="entitlement_value", + ) + + # Make the request + response = client.lookup_offer(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.LookupOfferRequest, dict]): The request object. Request message for LookupOffer. @@ -2635,6 +3300,27 @@ def list_products( - INVALID_ARGUMENT: Required request parameters are missing or invalid. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_products(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListProductsRequest( + account="account_value", + ) + + # Make the request + page_result = client.list_products(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListProductsRequest, dict]): The request object. Request message for ListProducts. @@ -2691,6 +3377,28 @@ def list_skus( - INVALID_ARGUMENT: Required request parameters are missing or invalid. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_skus(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListSkusRequest( + parent="parent_value", + account="account_value", + ) + + # Make the request + page_result = client.list_skus(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListSkusRequest, dict]): The request object. Request message for ListSkus. @@ -2753,6 +3461,27 @@ def list_offers( - INVALID_ARGUMENT: Required request parameters are missing or invalid. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_offers(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListOffersRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_offers(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListOffersRequest, dict]): The request object. Request message for ListOffers. @@ -2820,6 +3549,31 @@ def list_purchasable_skus( - INVALID_ARGUMENT: Required request parameters are missing or invalid. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_purchasable_skus(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + create_entitlement_purchase = channel_v1.CreateEntitlementPurchase() + create_entitlement_purchase.product = "product_value" + + request = channel_v1.ListPurchasableSkusRequest( + create_entitlement_purchase=create_entitlement_purchase, + customer="customer_value", + ) + + # Make the request + page_result = client.list_purchasable_skus(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListPurchasableSkusRequest, dict]): The request object. Request message for @@ -2889,6 +3643,31 @@ def list_purchasable_offers( - INVALID_ARGUMENT: Required request parameters are missing or invalid. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_purchasable_offers(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + create_entitlement_purchase = channel_v1.CreateEntitlementPurchase() + create_entitlement_purchase.sku = "sku_value" + + request = channel_v1.ListPurchasableOffersRequest( + create_entitlement_purchase=create_entitlement_purchase, + customer="customer_value", + ) + + # Make the request + page_result = client.list_purchasable_offers(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListPurchasableOffersRequest, dict]): The request object. Request message for @@ -2966,6 +3745,27 @@ def register_subscriber( Return value: The topic name with the registered service email address. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_register_subscriber(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.RegisterSubscriberRequest( + account="account_value", + service_account="service_account_value", + ) + + # Make the request + response = client.register_subscriber(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.RegisterSubscriberRequest, dict]): The request object. Request Message for @@ -3037,6 +3837,27 @@ def unregister_subscriber( address. Returns a success response if the service email address wasn't registered with the topic. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_unregister_subscriber(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.UnregisterSubscriberRequest( + account="account_value", + service_account="service_account_value", + ) + + # Make the request + response = client.unregister_subscriber(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.channel_v1.types.UnregisterSubscriberRequest, dict]): The request object. Request Message for @@ -3103,6 +3924,27 @@ def list_subscribers( Return value: A list of service email addresses. + + .. code-block:: python + + from google.cloud import channel_v1 + + def sample_list_subscribers(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListSubscribersRequest( + account="account_value", + ) + + # Make the request + page_result = client.list_subscribers(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.channel_v1.types.ListSubscribersRequest, dict]): The request object. Request Message for ListSubscribers. 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 762db5e..36f19cf 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,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/channel_v1/services/cloud_channel_service/transports/__init__.py b/google/cloud/channel_v1/services/cloud_channel_service/transports/__init__.py index b1dbce1..8f3c57f 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,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/channel_v1/services/cloud_channel_service/transports/base.py b/google/cloud/channel_v1/services/cloud_channel_service/transports/base.py index 98364b5..783caf5 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,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -106,7 +106,6 @@ def __init__( credentials, _ = google.auth.load_credentials_from_file( credentials_file, **scopes_kwargs, quota_project_id=quota_project_id ) - elif credentials is None: credentials, _ = google.auth.default( **scopes_kwargs, quota_project_id=quota_project_id 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 27eb3fb..b1f1d0f 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,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -188,8 +188,11 @@ def __init__( if not self._grpc_channel: self._grpc_channel = type(self).create_channel( self._host, + # use the credentials which are saved credentials=self._credentials, - credentials_file=credentials_file, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, scopes=self._scopes, ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, @@ -262,7 +265,7 @@ def operations_client(self) -> operations_v1.OperationsClient: This property caches on the instance; repeated calls return the same client. """ - # Sanity check: Only create a new client if we do not already have one. + # Quick check: Only create a new client if we do not already have one. if self._operations_client is None: self._operations_client = operations_v1.OperationsClient(self.grpc_channel) 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 be543e8..1530afa 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,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -233,8 +233,11 @@ def __init__( if not self._grpc_channel: self._grpc_channel = type(self).create_channel( self._host, + # use the credentials which are saved credentials=self._credentials, - credentials_file=credentials_file, + # Set ``credentials_file`` to ``None`` here as + # the credentials that we saved earlier should be used. + credentials_file=None, scopes=self._scopes, ssl_credentials=self._ssl_channel_credentials, quota_project_id=quota_project_id, @@ -264,7 +267,7 @@ def operations_client(self) -> operations_v1.OperationsAsyncClient: This property caches on the instance; repeated calls return the same client. """ - # Sanity check: Only create a new client if we do not already have one. + # Quick check: Only create a new client if we do not already have one. if self._operations_client is None: self._operations_client = operations_v1.OperationsAsyncClient( self.grpc_channel diff --git a/google/cloud/channel_v1/types/__init__.py b/google/cloud/channel_v1/types/__init__.py index 368114c..c54feea 100644 --- a/google/cloud/channel_v1/types/__init__.py +++ b/google/cloud/channel_v1/types/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/channel_v1/types/channel_partner_links.py b/google/cloud/channel_v1/types/channel_partner_links.py index 0cf82c4..e35872c 100644 --- a/google/cloud/channel_v1/types/channel_partner_links.py +++ b/google/cloud/channel_v1/types/channel_partner_links.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/channel_v1/types/common.py b/google/cloud/channel_v1/types/common.py index 3676587..e5f6282 100644 --- a/google/cloud/channel_v1/types/common.py +++ b/google/cloud/channel_v1/types/common.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/channel_v1/types/customers.py b/google/cloud/channel_v1/types/customers.py index 10c24d0..7a093d7 100644 --- a/google/cloud/channel_v1/types/customers.py +++ b/google/cloud/channel_v1/types/customers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/channel_v1/types/entitlements.py b/google/cloud/channel_v1/types/entitlements.py index e43fc43..7abc45f 100644 --- a/google/cloud/channel_v1/types/entitlements.py +++ b/google/cloud/channel_v1/types/entitlements.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -174,8 +174,10 @@ class ProvisionedService(proto.Message): Attributes: provisioning_id (str): Output only. Provisioning ID of the - entitlement. For Google Workspace, this would be - the underlying Subscription ID. + entitlement. For Google Workspace, this is the + underlying Subscription ID. For Google Cloud + Platform, this is the Billing Account ID of the + billing subaccount.". product_id (str): Output only. The product pertaining to the provisioning resource as specified in the Offer. diff --git a/google/cloud/channel_v1/types/offers.py b/google/cloud/channel_v1/types/offers.py index 876ea73..38a314d 100644 --- a/google/cloud/channel_v1/types/offers.py +++ b/google/cloud/channel_v1/types/offers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/channel_v1/types/operations.py b/google/cloud/channel_v1/types/operations.py index daad07d..2dd8fcb 100644 --- a/google/cloud/channel_v1/types/operations.py +++ b/google/cloud/channel_v1/types/operations.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/channel_v1/types/products.py b/google/cloud/channel_v1/types/products.py index 5bda6a3..c5ba2f3 100644 --- a/google/cloud/channel_v1/types/products.py +++ b/google/cloud/channel_v1/types/products.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/channel_v1/types/service.py b/google/cloud/channel_v1/types/service.py index 50c4910..384c32a 100644 --- a/google/cloud/channel_v1/types/service.py +++ b/google/cloud/channel_v1/types/service.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -443,8 +443,8 @@ class ListTransferableSkusRequest(proto.Message): https://support.google.com/a/answer/7643790 for more details. language_code (str): - The BCP-47 language code. For example, "en- - S". The response will localize in the + The BCP-47 language code. For example, + "en-US". The response will localize in the corresponding language code, if specified. The default value is "en-US". Optional. @@ -526,8 +526,8 @@ class ListTransferableOffersRequest(proto.Message): sku (str): Required. The SKU to look up Offers for. language_code (str): - The BCP-47 language code. For example, "en- - S". The response will localize in the + 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". """ diff --git a/google/cloud/channel_v1/types/subscriber_event.py b/google/cloud/channel_v1/types/subscriber_event.py index a5a1bf5..f7bc567 100644 --- a/google/cloud/channel_v1/types/subscriber_event.py +++ b/google/cloud/channel_v1/types/subscriber_event.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_activate_entitlement_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_activate_entitlement_async.py new file mode 100644 index 0000000..1533a9a --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_activate_entitlement_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ActivateEntitlement +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ActivateEntitlement_async] +from google.cloud import channel_v1 + + +async def sample_activate_entitlement(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.ActivateEntitlementRequest( + name="name_value", + ) + + # Make the request + operation = client.activate_entitlement(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ActivateEntitlement_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_activate_entitlement_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_activate_entitlement_sync.py new file mode 100644 index 0000000..0b2ca25 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_activate_entitlement_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ActivateEntitlement +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ActivateEntitlement_sync] +from google.cloud import channel_v1 + + +def sample_activate_entitlement(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ActivateEntitlementRequest( + name="name_value", + ) + + # Make the request + operation = client.activate_entitlement(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ActivateEntitlement_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_cancel_entitlement_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_cancel_entitlement_async.py new file mode 100644 index 0000000..66c8ac6 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_cancel_entitlement_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CancelEntitlement +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_CancelEntitlement_async] +from google.cloud import channel_v1 + + +async def sample_cancel_entitlement(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.CancelEntitlementRequest( + name="name_value", + ) + + # Make the request + operation = client.cancel_entitlement(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_CancelEntitlement_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_cancel_entitlement_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_cancel_entitlement_sync.py new file mode 100644 index 0000000..81aaa68 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_cancel_entitlement_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CancelEntitlement +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_CancelEntitlement_sync] +from google.cloud import channel_v1 + + +def sample_cancel_entitlement(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.CancelEntitlementRequest( + name="name_value", + ) + + # Make the request + operation = client.cancel_entitlement(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_CancelEntitlement_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_change_offer_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_change_offer_async.py new file mode 100644 index 0000000..9375955 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_change_offer_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ChangeOffer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ChangeOffer_async] +from google.cloud import channel_v1 + + +async def sample_change_offer(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.ChangeOfferRequest( + name="name_value", + offer="offer_value", + ) + + # Make the request + operation = client.change_offer(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ChangeOffer_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_change_offer_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_change_offer_sync.py new file mode 100644 index 0000000..c42df13 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_change_offer_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ChangeOffer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ChangeOffer_sync] +from google.cloud import channel_v1 + + +def sample_change_offer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ChangeOfferRequest( + name="name_value", + offer="offer_value", + ) + + # Make the request + operation = client.change_offer(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ChangeOffer_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_change_parameters_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_change_parameters_async.py new file mode 100644 index 0000000..26c5efa --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_change_parameters_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ChangeParameters +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ChangeParameters_async] +from google.cloud import channel_v1 + + +async def sample_change_parameters(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.ChangeParametersRequest( + name="name_value", + ) + + # Make the request + operation = client.change_parameters(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ChangeParameters_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_change_parameters_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_change_parameters_sync.py new file mode 100644 index 0000000..a511c4f --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_change_parameters_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ChangeParameters +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ChangeParameters_sync] +from google.cloud import channel_v1 + + +def sample_change_parameters(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ChangeParametersRequest( + name="name_value", + ) + + # Make the request + operation = client.change_parameters(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ChangeParameters_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_change_renewal_settings_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_change_renewal_settings_async.py new file mode 100644 index 0000000..48a686c --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_change_renewal_settings_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ChangeRenewalSettings +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ChangeRenewalSettings_async] +from google.cloud import channel_v1 + + +async def sample_change_renewal_settings(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.ChangeRenewalSettingsRequest( + name="name_value", + ) + + # Make the request + operation = client.change_renewal_settings(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ChangeRenewalSettings_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_change_renewal_settings_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_change_renewal_settings_sync.py new file mode 100644 index 0000000..56f33c5 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_change_renewal_settings_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ChangeRenewalSettings +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ChangeRenewalSettings_sync] +from google.cloud import channel_v1 + + +def sample_change_renewal_settings(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ChangeRenewalSettingsRequest( + name="name_value", + ) + + # Make the request + operation = client.change_renewal_settings(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ChangeRenewalSettings_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_check_cloud_identity_accounts_exist_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_check_cloud_identity_accounts_exist_async.py new file mode 100644 index 0000000..5821c64 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_check_cloud_identity_accounts_exist_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CheckCloudIdentityAccountsExist +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_CheckCloudIdentityAccountsExist_async] +from google.cloud import channel_v1 + + +async def sample_check_cloud_identity_accounts_exist(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.CheckCloudIdentityAccountsExistRequest( + parent="parent_value", + domain="domain_value", + ) + + # Make the request + response = await client.check_cloud_identity_accounts_exist(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_CheckCloudIdentityAccountsExist_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_check_cloud_identity_accounts_exist_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_check_cloud_identity_accounts_exist_sync.py new file mode 100644 index 0000000..266dc2b --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_check_cloud_identity_accounts_exist_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CheckCloudIdentityAccountsExist +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_CheckCloudIdentityAccountsExist_sync] +from google.cloud import channel_v1 + + +def sample_check_cloud_identity_accounts_exist(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.CheckCloudIdentityAccountsExistRequest( + parent="parent_value", + domain="domain_value", + ) + + # Make the request + response = client.check_cloud_identity_accounts_exist(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_CheckCloudIdentityAccountsExist_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_create_channel_partner_link_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_create_channel_partner_link_async.py new file mode 100644 index 0000000..ca9f669 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_create_channel_partner_link_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateChannelPartnerLink +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_CreateChannelPartnerLink_async] +from google.cloud import channel_v1 + + +async def sample_create_channel_partner_link(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + channel_partner_link = channel_v1.ChannelPartnerLink() + channel_partner_link.reseller_cloud_identity_id = "reseller_cloud_identity_id_value" + channel_partner_link.link_state = "SUSPENDED" + + request = channel_v1.CreateChannelPartnerLinkRequest( + parent="parent_value", + channel_partner_link=channel_partner_link, + ) + + # Make the request + response = await client.create_channel_partner_link(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_CreateChannelPartnerLink_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_create_channel_partner_link_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_create_channel_partner_link_sync.py new file mode 100644 index 0000000..770cc1a --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_create_channel_partner_link_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateChannelPartnerLink +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_CreateChannelPartnerLink_sync] +from google.cloud import channel_v1 + + +def sample_create_channel_partner_link(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + channel_partner_link = channel_v1.ChannelPartnerLink() + channel_partner_link.reseller_cloud_identity_id = "reseller_cloud_identity_id_value" + channel_partner_link.link_state = "SUSPENDED" + + request = channel_v1.CreateChannelPartnerLinkRequest( + parent="parent_value", + channel_partner_link=channel_partner_link, + ) + + # Make the request + response = client.create_channel_partner_link(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_CreateChannelPartnerLink_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_create_customer_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_create_customer_async.py new file mode 100644 index 0000000..3df5f84 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_create_customer_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateCustomer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_CreateCustomer_async] +from google.cloud import channel_v1 + + +async def sample_create_customer(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + customer = channel_v1.Customer() + customer.org_display_name = "org_display_name_value" + customer.domain = "domain_value" + + request = channel_v1.CreateCustomerRequest( + parent="parent_value", + customer=customer, + ) + + # Make the request + response = await client.create_customer(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_CreateCustomer_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_create_customer_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_create_customer_sync.py new file mode 100644 index 0000000..63fa132 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_create_customer_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateCustomer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_CreateCustomer_sync] +from google.cloud import channel_v1 + + +def sample_create_customer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + customer = channel_v1.Customer() + customer.org_display_name = "org_display_name_value" + customer.domain = "domain_value" + + request = channel_v1.CreateCustomerRequest( + parent="parent_value", + customer=customer, + ) + + # Make the request + response = client.create_customer(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_CreateCustomer_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_create_entitlement_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_create_entitlement_async.py new file mode 100644 index 0000000..783d024 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_create_entitlement_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateEntitlement +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_CreateEntitlement_async] +from google.cloud import channel_v1 + + +async def sample_create_entitlement(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + entitlement = channel_v1.Entitlement() + entitlement.offer = "offer_value" + + request = channel_v1.CreateEntitlementRequest( + parent="parent_value", + entitlement=entitlement, + ) + + # Make the request + operation = client.create_entitlement(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_CreateEntitlement_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_create_entitlement_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_create_entitlement_sync.py new file mode 100644 index 0000000..bd7e764 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_create_entitlement_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateEntitlement +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_CreateEntitlement_sync] +from google.cloud import channel_v1 + + +def sample_create_entitlement(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + entitlement = channel_v1.Entitlement() + entitlement.offer = "offer_value" + + request = channel_v1.CreateEntitlementRequest( + parent="parent_value", + entitlement=entitlement, + ) + + # Make the request + operation = client.create_entitlement(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_CreateEntitlement_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_delete_customer_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_delete_customer_async.py new file mode 100644 index 0000000..76e1866 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_delete_customer_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteCustomer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_DeleteCustomer_async] +from google.cloud import channel_v1 + + +async def sample_delete_customer(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.DeleteCustomerRequest( + name="name_value", + ) + + # Make the request + await client.delete_customer(request=request) + + +# [END cloudchannel_v1_generated_CloudChannelService_DeleteCustomer_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_delete_customer_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_delete_customer_sync.py new file mode 100644 index 0000000..0d34f05 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_delete_customer_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteCustomer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_DeleteCustomer_sync] +from google.cloud import channel_v1 + + +def sample_delete_customer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.DeleteCustomerRequest( + name="name_value", + ) + + # Make the request + client.delete_customer(request=request) + + +# [END cloudchannel_v1_generated_CloudChannelService_DeleteCustomer_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_get_channel_partner_link_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_get_channel_partner_link_async.py new file mode 100644 index 0000000..2471588 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_get_channel_partner_link_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetChannelPartnerLink +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_GetChannelPartnerLink_async] +from google.cloud import channel_v1 + + +async def sample_get_channel_partner_link(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.GetChannelPartnerLinkRequest( + name="name_value", + ) + + # Make the request + response = await client.get_channel_partner_link(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_GetChannelPartnerLink_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_get_channel_partner_link_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_get_channel_partner_link_sync.py new file mode 100644 index 0000000..a565d0e --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_get_channel_partner_link_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetChannelPartnerLink +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_GetChannelPartnerLink_sync] +from google.cloud import channel_v1 + + +def sample_get_channel_partner_link(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.GetChannelPartnerLinkRequest( + name="name_value", + ) + + # Make the request + response = client.get_channel_partner_link(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_GetChannelPartnerLink_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_get_customer_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_get_customer_async.py new file mode 100644 index 0000000..fc85027 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_get_customer_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetCustomer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_GetCustomer_async] +from google.cloud import channel_v1 + + +async def sample_get_customer(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.GetCustomerRequest( + name="name_value", + ) + + # Make the request + response = await client.get_customer(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_GetCustomer_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_get_customer_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_get_customer_sync.py new file mode 100644 index 0000000..3d5a3e7 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_get_customer_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetCustomer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_GetCustomer_sync] +from google.cloud import channel_v1 + + +def sample_get_customer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.GetCustomerRequest( + name="name_value", + ) + + # Make the request + response = client.get_customer(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_GetCustomer_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_get_entitlement_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_get_entitlement_async.py new file mode 100644 index 0000000..fcf649d --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_get_entitlement_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetEntitlement +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_GetEntitlement_async] +from google.cloud import channel_v1 + + +async def sample_get_entitlement(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.GetEntitlementRequest( + name="name_value", + ) + + # Make the request + response = await client.get_entitlement(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_GetEntitlement_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_get_entitlement_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_get_entitlement_sync.py new file mode 100644 index 0000000..0891efa --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_get_entitlement_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetEntitlement +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_GetEntitlement_sync] +from google.cloud import channel_v1 + + +def sample_get_entitlement(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.GetEntitlementRequest( + name="name_value", + ) + + # Make the request + response = client.get_entitlement(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_GetEntitlement_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_import_customer_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_import_customer_async.py new file mode 100644 index 0000000..4a7b6af --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_import_customer_async.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ImportCustomer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ImportCustomer_async] +from google.cloud import channel_v1 + + +async def sample_import_customer(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.ImportCustomerRequest( + domain="domain_value", + parent="parent_value", + overwrite_if_exists=True, + ) + + # Make the request + response = await client.import_customer(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ImportCustomer_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_import_customer_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_import_customer_sync.py new file mode 100644 index 0000000..e73cc63 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_import_customer_sync.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ImportCustomer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ImportCustomer_sync] +from google.cloud import channel_v1 + + +def sample_import_customer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ImportCustomerRequest( + domain="domain_value", + parent="parent_value", + overwrite_if_exists=True, + ) + + # Make the request + response = client.import_customer(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ImportCustomer_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_channel_partner_links_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_channel_partner_links_async.py new file mode 100644 index 0000000..53248a0 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_channel_partner_links_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListChannelPartnerLinks +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListChannelPartnerLinks_async] +from google.cloud import channel_v1 + + +async def sample_list_channel_partner_links(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.ListChannelPartnerLinksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_channel_partner_links(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListChannelPartnerLinks_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_channel_partner_links_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_channel_partner_links_sync.py new file mode 100644 index 0000000..c2a69f8 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_channel_partner_links_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListChannelPartnerLinks +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListChannelPartnerLinks_sync] +from google.cloud import channel_v1 + + +def sample_list_channel_partner_links(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListChannelPartnerLinksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_channel_partner_links(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListChannelPartnerLinks_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_customers_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_customers_async.py new file mode 100644 index 0000000..c067c03 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_customers_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListCustomers +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListCustomers_async] +from google.cloud import channel_v1 + + +async def sample_list_customers(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.ListCustomersRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_customers(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListCustomers_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_customers_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_customers_sync.py new file mode 100644 index 0000000..a6c0c8e --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_customers_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListCustomers +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListCustomers_sync] +from google.cloud import channel_v1 + + +def sample_list_customers(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListCustomersRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_customers(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListCustomers_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_entitlements_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_entitlements_async.py new file mode 100644 index 0000000..7fad3bd --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_entitlements_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListEntitlements +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListEntitlements_async] +from google.cloud import channel_v1 + + +async def sample_list_entitlements(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.ListEntitlementsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_entitlements(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListEntitlements_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_entitlements_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_entitlements_sync.py new file mode 100644 index 0000000..52fb074 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_entitlements_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListEntitlements +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListEntitlements_sync] +from google.cloud import channel_v1 + + +def sample_list_entitlements(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListEntitlementsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_entitlements(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListEntitlements_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_offers_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_offers_async.py new file mode 100644 index 0000000..1c79950 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_offers_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListOffers +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListOffers_async] +from google.cloud import channel_v1 + + +async def sample_list_offers(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.ListOffersRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_offers(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListOffers_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_offers_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_offers_sync.py new file mode 100644 index 0000000..b034fb1 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_offers_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListOffers +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListOffers_sync] +from google.cloud import channel_v1 + + +def sample_list_offers(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListOffersRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_offers(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListOffers_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_products_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_products_async.py new file mode 100644 index 0000000..68fcdc1 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_products_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListProducts +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListProducts_async] +from google.cloud import channel_v1 + + +async def sample_list_products(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.ListProductsRequest( + account="account_value", + ) + + # Make the request + page_result = client.list_products(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListProducts_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_products_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_products_sync.py new file mode 100644 index 0000000..5dbbd0a --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_products_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListProducts +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListProducts_sync] +from google.cloud import channel_v1 + + +def sample_list_products(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListProductsRequest( + account="account_value", + ) + + # Make the request + page_result = client.list_products(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListProducts_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_purchasable_offers_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_purchasable_offers_async.py new file mode 100644 index 0000000..a42e668 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_purchasable_offers_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListPurchasableOffers +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListPurchasableOffers_async] +from google.cloud import channel_v1 + + +async def sample_list_purchasable_offers(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + create_entitlement_purchase = channel_v1.CreateEntitlementPurchase() + create_entitlement_purchase.sku = "sku_value" + + request = channel_v1.ListPurchasableOffersRequest( + create_entitlement_purchase=create_entitlement_purchase, + customer="customer_value", + ) + + # Make the request + page_result = client.list_purchasable_offers(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListPurchasableOffers_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_purchasable_offers_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_purchasable_offers_sync.py new file mode 100644 index 0000000..c2a90f0 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_purchasable_offers_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListPurchasableOffers +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListPurchasableOffers_sync] +from google.cloud import channel_v1 + + +def sample_list_purchasable_offers(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + create_entitlement_purchase = channel_v1.CreateEntitlementPurchase() + create_entitlement_purchase.sku = "sku_value" + + request = channel_v1.ListPurchasableOffersRequest( + create_entitlement_purchase=create_entitlement_purchase, + customer="customer_value", + ) + + # Make the request + page_result = client.list_purchasable_offers(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListPurchasableOffers_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_purchasable_skus_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_purchasable_skus_async.py new file mode 100644 index 0000000..a5db2bc --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_purchasable_skus_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListPurchasableSkus +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListPurchasableSkus_async] +from google.cloud import channel_v1 + + +async def sample_list_purchasable_skus(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + create_entitlement_purchase = channel_v1.CreateEntitlementPurchase() + create_entitlement_purchase.product = "product_value" + + request = channel_v1.ListPurchasableSkusRequest( + create_entitlement_purchase=create_entitlement_purchase, + customer="customer_value", + ) + + # Make the request + page_result = client.list_purchasable_skus(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListPurchasableSkus_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_purchasable_skus_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_purchasable_skus_sync.py new file mode 100644 index 0000000..74a3bc0 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_purchasable_skus_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListPurchasableSkus +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListPurchasableSkus_sync] +from google.cloud import channel_v1 + + +def sample_list_purchasable_skus(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + create_entitlement_purchase = channel_v1.CreateEntitlementPurchase() + create_entitlement_purchase.product = "product_value" + + request = channel_v1.ListPurchasableSkusRequest( + create_entitlement_purchase=create_entitlement_purchase, + customer="customer_value", + ) + + # Make the request + page_result = client.list_purchasable_skus(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListPurchasableSkus_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_skus_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_skus_async.py new file mode 100644 index 0000000..165f132 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_skus_async.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListSkus +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListSkus_async] +from google.cloud import channel_v1 + + +async def sample_list_skus(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.ListSkusRequest( + parent="parent_value", + account="account_value", + ) + + # Make the request + page_result = client.list_skus(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListSkus_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_skus_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_skus_sync.py new file mode 100644 index 0000000..31647f9 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_skus_sync.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListSkus +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListSkus_sync] +from google.cloud import channel_v1 + + +def sample_list_skus(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListSkusRequest( + parent="parent_value", + account="account_value", + ) + + # Make the request + page_result = client.list_skus(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListSkus_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_subscribers_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_subscribers_async.py new file mode 100644 index 0000000..31c07fb --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_subscribers_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListSubscribers +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListSubscribers_async] +from google.cloud import channel_v1 + + +async def sample_list_subscribers(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.ListSubscribersRequest( + account="account_value", + ) + + # Make the request + page_result = client.list_subscribers(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListSubscribers_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_subscribers_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_subscribers_sync.py new file mode 100644 index 0000000..295aa24 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_subscribers_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListSubscribers +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListSubscribers_sync] +from google.cloud import channel_v1 + + +def sample_list_subscribers(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListSubscribersRequest( + account="account_value", + ) + + # Make the request + page_result = client.list_subscribers(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListSubscribers_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_transferable_offers_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_transferable_offers_async.py new file mode 100644 index 0000000..1a61a17 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_transferable_offers_async.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTransferableOffers +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListTransferableOffers_async] +from google.cloud import channel_v1 + + +async def sample_list_transferable_offers(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.ListTransferableOffersRequest( + cloud_identity_id="cloud_identity_id_value", + parent="parent_value", + sku="sku_value", + ) + + # Make the request + page_result = client.list_transferable_offers(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListTransferableOffers_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_transferable_offers_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_transferable_offers_sync.py new file mode 100644 index 0000000..aaf44d6 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_transferable_offers_sync.py @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTransferableOffers +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListTransferableOffers_sync] +from google.cloud import channel_v1 + + +def sample_list_transferable_offers(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListTransferableOffersRequest( + cloud_identity_id="cloud_identity_id_value", + parent="parent_value", + sku="sku_value", + ) + + # Make the request + page_result = client.list_transferable_offers(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListTransferableOffers_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_transferable_skus_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_transferable_skus_async.py new file mode 100644 index 0000000..dcb527d --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_transferable_skus_async.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTransferableSkus +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListTransferableSkus_async] +from google.cloud import channel_v1 + + +async def sample_list_transferable_skus(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.ListTransferableSkusRequest( + cloud_identity_id="cloud_identity_id_value", + parent="parent_value", + ) + + # Make the request + page_result = client.list_transferable_skus(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListTransferableSkus_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_transferable_skus_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_transferable_skus_sync.py new file mode 100644 index 0000000..0511efe --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_list_transferable_skus_sync.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTransferableSkus +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ListTransferableSkus_sync] +from google.cloud import channel_v1 + + +def sample_list_transferable_skus(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ListTransferableSkusRequest( + cloud_identity_id="cloud_identity_id_value", + parent="parent_value", + ) + + # Make the request + page_result = client.list_transferable_skus(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ListTransferableSkus_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_lookup_offer_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_lookup_offer_async.py new file mode 100644 index 0000000..a3604ac --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_lookup_offer_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for LookupOffer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_LookupOffer_async] +from google.cloud import channel_v1 + + +async def sample_lookup_offer(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.LookupOfferRequest( + entitlement="entitlement_value", + ) + + # Make the request + response = await client.lookup_offer(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_LookupOffer_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_lookup_offer_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_lookup_offer_sync.py new file mode 100644 index 0000000..84f198a --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_lookup_offer_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for LookupOffer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_LookupOffer_sync] +from google.cloud import channel_v1 + + +def sample_lookup_offer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.LookupOfferRequest( + entitlement="entitlement_value", + ) + + # Make the request + response = client.lookup_offer(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_LookupOffer_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_provision_cloud_identity_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_provision_cloud_identity_async.py new file mode 100644 index 0000000..afc55fc --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_provision_cloud_identity_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ProvisionCloudIdentity +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ProvisionCloudIdentity_async] +from google.cloud import channel_v1 + + +async def sample_provision_cloud_identity(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.ProvisionCloudIdentityRequest( + customer="customer_value", + ) + + # Make the request + operation = client.provision_cloud_identity(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ProvisionCloudIdentity_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_provision_cloud_identity_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_provision_cloud_identity_sync.py new file mode 100644 index 0000000..ada81ab --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_provision_cloud_identity_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ProvisionCloudIdentity +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_ProvisionCloudIdentity_sync] +from google.cloud import channel_v1 + + +def sample_provision_cloud_identity(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.ProvisionCloudIdentityRequest( + customer="customer_value", + ) + + # Make the request + operation = client.provision_cloud_identity(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_ProvisionCloudIdentity_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_register_subscriber_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_register_subscriber_async.py new file mode 100644 index 0000000..26a7b92 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_register_subscriber_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RegisterSubscriber +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_RegisterSubscriber_async] +from google.cloud import channel_v1 + + +async def sample_register_subscriber(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.RegisterSubscriberRequest( + account="account_value", + service_account="service_account_value", + ) + + # Make the request + response = await client.register_subscriber(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_RegisterSubscriber_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_register_subscriber_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_register_subscriber_sync.py new file mode 100644 index 0000000..30aedf5 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_register_subscriber_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RegisterSubscriber +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_RegisterSubscriber_sync] +from google.cloud import channel_v1 + + +def sample_register_subscriber(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.RegisterSubscriberRequest( + account="account_value", + service_account="service_account_value", + ) + + # Make the request + response = client.register_subscriber(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_RegisterSubscriber_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_start_paid_service_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_start_paid_service_async.py new file mode 100644 index 0000000..923bf7c --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_start_paid_service_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for StartPaidService +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_StartPaidService_async] +from google.cloud import channel_v1 + + +async def sample_start_paid_service(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.StartPaidServiceRequest( + name="name_value", + ) + + # Make the request + operation = client.start_paid_service(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_StartPaidService_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_start_paid_service_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_start_paid_service_sync.py new file mode 100644 index 0000000..c220209 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_start_paid_service_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for StartPaidService +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_StartPaidService_sync] +from google.cloud import channel_v1 + + +def sample_start_paid_service(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.StartPaidServiceRequest( + name="name_value", + ) + + # Make the request + operation = client.start_paid_service(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_StartPaidService_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_suspend_entitlement_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_suspend_entitlement_async.py new file mode 100644 index 0000000..00b3203 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_suspend_entitlement_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SuspendEntitlement +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_SuspendEntitlement_async] +from google.cloud import channel_v1 + + +async def sample_suspend_entitlement(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.SuspendEntitlementRequest( + name="name_value", + ) + + # Make the request + operation = client.suspend_entitlement(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_SuspendEntitlement_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_suspend_entitlement_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_suspend_entitlement_sync.py new file mode 100644 index 0000000..dcbfb0a --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_suspend_entitlement_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SuspendEntitlement +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_SuspendEntitlement_sync] +from google.cloud import channel_v1 + + +def sample_suspend_entitlement(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.SuspendEntitlementRequest( + name="name_value", + ) + + # Make the request + operation = client.suspend_entitlement(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_SuspendEntitlement_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_transfer_entitlements_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_transfer_entitlements_async.py new file mode 100644 index 0000000..cb7ec63 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_transfer_entitlements_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TransferEntitlements +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_TransferEntitlements_async] +from google.cloud import channel_v1 + + +async def sample_transfer_entitlements(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + entitlements = channel_v1.Entitlement() + entitlements.offer = "offer_value" + + request = channel_v1.TransferEntitlementsRequest( + parent="parent_value", + entitlements=entitlements, + ) + + # Make the request + operation = client.transfer_entitlements(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_TransferEntitlements_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_transfer_entitlements_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_transfer_entitlements_sync.py new file mode 100644 index 0000000..7c4a8c8 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_transfer_entitlements_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TransferEntitlements +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_TransferEntitlements_sync] +from google.cloud import channel_v1 + + +def sample_transfer_entitlements(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + entitlements = channel_v1.Entitlement() + entitlements.offer = "offer_value" + + request = channel_v1.TransferEntitlementsRequest( + parent="parent_value", + entitlements=entitlements, + ) + + # Make the request + operation = client.transfer_entitlements(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_TransferEntitlements_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_transfer_entitlements_to_google_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_transfer_entitlements_to_google_async.py new file mode 100644 index 0000000..9e9512e --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_transfer_entitlements_to_google_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TransferEntitlementsToGoogle +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_TransferEntitlementsToGoogle_async] +from google.cloud import channel_v1 + + +async def sample_transfer_entitlements_to_google(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + entitlements = channel_v1.Entitlement() + entitlements.offer = "offer_value" + + request = channel_v1.TransferEntitlementsToGoogleRequest( + parent="parent_value", + entitlements=entitlements, + ) + + # Make the request + operation = client.transfer_entitlements_to_google(request=request) + + print("Waiting for operation to complete...") + + response = await operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_TransferEntitlementsToGoogle_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_transfer_entitlements_to_google_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_transfer_entitlements_to_google_sync.py new file mode 100644 index 0000000..db72967 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_transfer_entitlements_to_google_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TransferEntitlementsToGoogle +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_TransferEntitlementsToGoogle_sync] +from google.cloud import channel_v1 + + +def sample_transfer_entitlements_to_google(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + entitlements = channel_v1.Entitlement() + entitlements.offer = "offer_value" + + request = channel_v1.TransferEntitlementsToGoogleRequest( + parent="parent_value", + entitlements=entitlements, + ) + + # Make the request + operation = client.transfer_entitlements_to_google(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_TransferEntitlementsToGoogle_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_unregister_subscriber_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_unregister_subscriber_async.py new file mode 100644 index 0000000..7ad6283 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_unregister_subscriber_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UnregisterSubscriber +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_UnregisterSubscriber_async] +from google.cloud import channel_v1 + + +async def sample_unregister_subscriber(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + request = channel_v1.UnregisterSubscriberRequest( + account="account_value", + service_account="service_account_value", + ) + + # Make the request + response = await client.unregister_subscriber(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_UnregisterSubscriber_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_unregister_subscriber_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_unregister_subscriber_sync.py new file mode 100644 index 0000000..2e7298f --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_unregister_subscriber_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UnregisterSubscriber +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_UnregisterSubscriber_sync] +from google.cloud import channel_v1 + + +def sample_unregister_subscriber(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + request = channel_v1.UnregisterSubscriberRequest( + account="account_value", + service_account="service_account_value", + ) + + # Make the request + response = client.unregister_subscriber(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_UnregisterSubscriber_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_update_channel_partner_link_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_update_channel_partner_link_async.py new file mode 100644 index 0000000..b1ed6ab --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_update_channel_partner_link_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateChannelPartnerLink +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_UpdateChannelPartnerLink_async] +from google.cloud import channel_v1 + + +async def sample_update_channel_partner_link(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + channel_partner_link = channel_v1.ChannelPartnerLink() + channel_partner_link.reseller_cloud_identity_id = "reseller_cloud_identity_id_value" + channel_partner_link.link_state = "SUSPENDED" + + request = channel_v1.UpdateChannelPartnerLinkRequest( + name="name_value", + channel_partner_link=channel_partner_link, + ) + + # Make the request + response = await client.update_channel_partner_link(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_UpdateChannelPartnerLink_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_update_channel_partner_link_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_update_channel_partner_link_sync.py new file mode 100644 index 0000000..2bda7e0 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_update_channel_partner_link_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateChannelPartnerLink +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_UpdateChannelPartnerLink_sync] +from google.cloud import channel_v1 + + +def sample_update_channel_partner_link(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + channel_partner_link = channel_v1.ChannelPartnerLink() + channel_partner_link.reseller_cloud_identity_id = "reseller_cloud_identity_id_value" + channel_partner_link.link_state = "SUSPENDED" + + request = channel_v1.UpdateChannelPartnerLinkRequest( + name="name_value", + channel_partner_link=channel_partner_link, + ) + + # Make the request + response = client.update_channel_partner_link(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_UpdateChannelPartnerLink_sync] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_update_customer_async.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_update_customer_async.py new file mode 100644 index 0000000..7d7b3e8 --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_update_customer_async.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateCustomer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_UpdateCustomer_async] +from google.cloud import channel_v1 + + +async def sample_update_customer(): + # Create a client + client = channel_v1.CloudChannelServiceAsyncClient() + + # Initialize request argument(s) + customer = channel_v1.Customer() + customer.org_display_name = "org_display_name_value" + customer.domain = "domain_value" + + request = channel_v1.UpdateCustomerRequest( + customer=customer, + ) + + # Make the request + response = await client.update_customer(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_UpdateCustomer_async] diff --git a/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_update_customer_sync.py b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_update_customer_sync.py new file mode 100644 index 0000000..299f11a --- /dev/null +++ b/samples/generated_samples/cloudchannel_v1_generated_cloud_channel_service_update_customer_sync.py @@ -0,0 +1,49 @@ +# -*- coding: utf-8 -*- +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateCustomer +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-channel + + +# [START cloudchannel_v1_generated_CloudChannelService_UpdateCustomer_sync] +from google.cloud import channel_v1 + + +def sample_update_customer(): + # Create a client + client = channel_v1.CloudChannelServiceClient() + + # Initialize request argument(s) + customer = channel_v1.Customer() + customer.org_display_name = "org_display_name_value" + customer.domain = "domain_value" + + request = channel_v1.UpdateCustomerRequest( + customer=customer, + ) + + # Make the request + response = client.update_customer(request=request) + + # Handle the response + print(response) + +# [END cloudchannel_v1_generated_CloudChannelService_UpdateCustomer_sync] diff --git a/samples/generated_samples/snippet_metadata_channel_v1.json b/samples/generated_samples/snippet_metadata_channel_v1.json new file mode 100644 index 0000000..65a6fcb --- /dev/null +++ b/samples/generated_samples/snippet_metadata_channel_v1.json @@ -0,0 +1,3115 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ActivateEntitlement" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_activate_entitlement_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ActivateEntitlement_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ActivateEntitlement" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_activate_entitlement_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ActivateEntitlement_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "CancelEntitlement" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_cancel_entitlement_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_CancelEntitlement_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "CancelEntitlement" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_cancel_entitlement_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_CancelEntitlement_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ChangeOffer" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_change_offer_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ChangeOffer_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ChangeOffer" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_change_offer_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ChangeOffer_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ChangeParameters" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_change_parameters_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ChangeParameters_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ChangeParameters" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_change_parameters_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ChangeParameters_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ChangeRenewalSettings" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_change_renewal_settings_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ChangeRenewalSettings_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ChangeRenewalSettings" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_change_renewal_settings_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ChangeRenewalSettings_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "CheckCloudIdentityAccountsExist" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_check_cloud_identity_accounts_exist_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_CheckCloudIdentityAccountsExist_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "CheckCloudIdentityAccountsExist" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_check_cloud_identity_accounts_exist_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_CheckCloudIdentityAccountsExist_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "CreateChannelPartnerLink" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_create_channel_partner_link_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_CreateChannelPartnerLink_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 43, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 44, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "CreateChannelPartnerLink" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_create_channel_partner_link_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_CreateChannelPartnerLink_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 43, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 44, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "CreateCustomer" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_create_customer_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_CreateCustomer_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 43, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 44, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "CreateCustomer" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_create_customer_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_CreateCustomer_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 43, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 44, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "CreateEntitlement" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_create_entitlement_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_CreateEntitlement_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "CreateEntitlement" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_create_entitlement_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_CreateEntitlement_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "DeleteCustomer" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_delete_customer_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_DeleteCustomer_async", + "segments": [ + { + "end": 42, + "start": 27, + "type": "FULL" + }, + { + "end": 42, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "DeleteCustomer" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_delete_customer_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_DeleteCustomer_sync", + "segments": [ + { + "end": 42, + "start": 27, + "type": "FULL" + }, + { + "end": 42, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "GetChannelPartnerLink" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_get_channel_partner_link_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_GetChannelPartnerLink_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "GetChannelPartnerLink" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_get_channel_partner_link_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_GetChannelPartnerLink_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "GetCustomer" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_get_customer_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_GetCustomer_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "GetCustomer" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_get_customer_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_GetCustomer_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "GetEntitlement" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_get_entitlement_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_GetEntitlement_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "GetEntitlement" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_get_entitlement_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_GetEntitlement_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ImportCustomer" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_import_customer_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ImportCustomer_async", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 40, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 43, + "start": 41, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ImportCustomer" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_import_customer_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ImportCustomer_sync", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 40, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 43, + "start": 41, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListChannelPartnerLinks" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_channel_partner_links_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListChannelPartnerLinks_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListChannelPartnerLinks" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_channel_partner_links_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListChannelPartnerLinks_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListCustomers" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_customers_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListCustomers_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListCustomers" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_customers_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListCustomers_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListEntitlements" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_entitlements_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListEntitlements_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListEntitlements" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_entitlements_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListEntitlements_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListOffers" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_offers_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListOffers_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListOffers" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_offers_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListOffers_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListProducts" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_products_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListProducts_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListProducts" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_products_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListProducts_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListPurchasableOffers" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_purchasable_offers_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListPurchasableOffers_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListPurchasableOffers" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_purchasable_offers_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListPurchasableOffers_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListPurchasableSkus" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_purchasable_skus_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListPurchasableSkus_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListPurchasableSkus" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_purchasable_skus_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListPurchasableSkus_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListSkus" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_skus_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListSkus_async", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListSkus" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_skus_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListSkus_sync", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListSubscribers" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_subscribers_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListSubscribers_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListSubscribers" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_subscribers_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListSubscribers_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListTransferableOffers" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_transferable_offers_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListTransferableOffers_async", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 40, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 43, + "start": 41, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListTransferableOffers" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_transferable_offers_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListTransferableOffers_sync", + "segments": [ + { + "end": 47, + "start": 27, + "type": "FULL" + }, + { + "end": 47, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 40, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 43, + "start": 41, + "type": "REQUEST_EXECUTION" + }, + { + "end": 48, + "start": 44, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListTransferableSkus" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_transferable_skus_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListTransferableSkus_async", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ListTransferableSkus" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_list_transferable_skus_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ListTransferableSkus_sync", + "segments": [ + { + "end": 46, + "start": 27, + "type": "FULL" + }, + { + "end": 46, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 47, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "LookupOffer" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_lookup_offer_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_LookupOffer_async", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "LookupOffer" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_lookup_offer_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_LookupOffer_sync", + "segments": [ + { + "end": 44, + "start": 27, + "type": "FULL" + }, + { + "end": 44, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 41, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 45, + "start": 42, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ProvisionCloudIdentity" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_provision_cloud_identity_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ProvisionCloudIdentity_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "ProvisionCloudIdentity" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_provision_cloud_identity_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_ProvisionCloudIdentity_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "RegisterSubscriber" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_register_subscriber_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_RegisterSubscriber_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "RegisterSubscriber" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_register_subscriber_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_RegisterSubscriber_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "StartPaidService" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_start_paid_service_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_StartPaidService_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "StartPaidService" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_start_paid_service_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_StartPaidService_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "SuspendEntitlement" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_suspend_entitlement_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_SuspendEntitlement_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "SuspendEntitlement" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_suspend_entitlement_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_SuspendEntitlement_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 38, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 39, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "TransferEntitlementsToGoogle" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_transfer_entitlements_to_google_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_TransferEntitlementsToGoogle_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "TransferEntitlementsToGoogle" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_transfer_entitlements_to_google_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_TransferEntitlementsToGoogle_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "TransferEntitlements" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_transfer_entitlements_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_TransferEntitlements_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "TransferEntitlements" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_transfer_entitlements_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_TransferEntitlements_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "UnregisterSubscriber" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_unregister_subscriber_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_UnregisterSubscriber_async", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "UnregisterSubscriber" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_unregister_subscriber_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_UnregisterSubscriber_sync", + "segments": [ + { + "end": 45, + "start": 27, + "type": "FULL" + }, + { + "end": 45, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 39, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 42, + "start": 40, + "type": "REQUEST_EXECUTION" + }, + { + "end": 46, + "start": 43, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "UpdateChannelPartnerLink" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_update_channel_partner_link_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_UpdateChannelPartnerLink_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 43, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 44, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "UpdateChannelPartnerLink" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_update_channel_partner_link_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_UpdateChannelPartnerLink_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 43, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 46, + "start": 44, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "start": 47, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "UpdateCustomer" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_update_customer_async.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_UpdateCustomer_async", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudChannelService" + }, + "shortName": "UpdateCustomer" + } + }, + "file": "cloudchannel_v1_generated_cloud_channel_service_update_customer_sync.py", + "regionTag": "cloudchannel_v1_generated_CloudChannelService_UpdateCustomer_sync", + "segments": [ + { + "end": 48, + "start": 27, + "type": "FULL" + }, + { + "end": 48, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 42, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 45, + "start": 43, + "type": "REQUEST_EXECUTION" + }, + { + "end": 49, + "start": 46, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} diff --git a/scripts/fixup_channel_v1_keywords.py b/scripts/fixup_channel_v1_keywords.py index 210090c..326fdf4 100644 --- a/scripts/fixup_channel_v1_keywords.py +++ b/scripts/fixup_channel_v1_keywords.py @@ -1,6 +1,6 @@ #! /usr/bin/env python3 # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/setup.py b/setup.py index 811538f..ea375ad 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ import os import setuptools # type: ignore -version = "1.6.3" +version = "1.7.0" package_root = os.path.abspath(os.path.dirname(__file__)) diff --git a/tests/__init__.py b/tests/__init__.py index 4de6597..e8e1c38 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py index 4de6597..e8e1c38 100644 --- a/tests/unit/__init__.py +++ b/tests/unit/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/unit/gapic/__init__.py b/tests/unit/gapic/__init__.py index 4de6597..e8e1c38 100644 --- a/tests/unit/gapic/__init__.py +++ b/tests/unit/gapic/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/unit/gapic/channel_v1/__init__.py b/tests/unit/gapic/channel_v1/__init__.py index 4de6597..e8e1c38 100644 --- a/tests/unit/gapic/channel_v1/__init__.py +++ b/tests/unit/gapic/channel_v1/__init__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/tests/unit/gapic/channel_v1/test_cloud_channel_service.py b/tests/unit/gapic/channel_v1/test_cloud_channel_service.py index 2239552..06f8197 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,5 @@ # -*- coding: utf-8 -*- -# Copyright 2020 Google LLC +# Copyright 2022 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ 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 from google.api_core import operation_async # type: ignore from google.api_core import operations_v1 from google.api_core import path_template @@ -270,20 +271,20 @@ def test_cloud_channel_service_client_client_options( # unsupported value. with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): with pytest.raises(MutualTLSChannelError): - client = client_class() + client = client_class(transport=transport_name) # Check the case GOOGLE_API_USE_CLIENT_CERTIFICATE has unsupported value. with mock.patch.dict( os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"} ): with pytest.raises(ValueError): - client = client_class() + client = client_class(transport=transport_name) # Check the case quota_project_id is provided options = client_options.ClientOptions(quota_project_id="octopus") with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(transport=transport_name, client_options=options) + client = client_class(client_options=options, transport=transport_name) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -352,7 +353,7 @@ def test_cloud_channel_service_client_mtls_env_auto( ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(transport=transport_name, client_options=options) + client = client_class(client_options=options, transport=transport_name) if use_client_cert_env == "false": expected_client_cert_source = None @@ -429,6 +430,87 @@ def test_cloud_channel_service_client_mtls_env_auto( ) +@pytest.mark.parametrize( + "client_class", [CloudChannelServiceClient, CloudChannelServiceAsyncClient] +) +@mock.patch.object( + CloudChannelServiceClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(CloudChannelServiceClient), +) +@mock.patch.object( + CloudChannelServiceAsyncClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(CloudChannelServiceAsyncClient), +) +def test_cloud_channel_service_client_get_mtls_endpoint_and_cert_source(client_class): + mock_client_cert_source = mock.Mock() + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "true". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint + ) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source( + options + ) + assert api_endpoint == mock_api_endpoint + assert cert_source == mock_client_cert_source + + # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "false". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}): + mock_client_cert_source = mock.Mock() + mock_api_endpoint = "foo" + options = client_options.ClientOptions( + client_cert_source=mock_client_cert_source, api_endpoint=mock_api_endpoint + ) + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source( + options + ) + assert api_endpoint == mock_api_endpoint + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "never". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "always". + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert doesn't exist. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=False, + ): + api_endpoint, cert_source = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_ENDPOINT + assert cert_source is None + + # Test the case GOOGLE_API_USE_MTLS_ENDPOINT is "auto" and default cert exists. + with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): + with mock.patch( + "google.auth.transport.mtls.has_default_client_cert_source", + return_value=True, + ): + with mock.patch( + "google.auth.transport.mtls.default_client_cert_source", + return_value=mock_client_cert_source, + ): + ( + api_endpoint, + cert_source, + ) = client_class.get_mtls_endpoint_and_cert_source() + assert api_endpoint == client_class.DEFAULT_MTLS_ENDPOINT + assert cert_source == mock_client_cert_source + + @pytest.mark.parametrize( "client_class,transport_class,transport_name", [ @@ -451,7 +533,7 @@ def test_cloud_channel_service_client_client_options_scopes( options = client_options.ClientOptions(scopes=["1", "2"],) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(transport=transport_name, client_options=options) + client = client_class(client_options=options, transport=transport_name) patched.assert_called_once_with( credentials=None, credentials_file=None, @@ -465,28 +547,31 @@ def test_cloud_channel_service_client_client_options_scopes( @pytest.mark.parametrize( - "client_class,transport_class,transport_name", + "client_class,transport_class,transport_name,grpc_helpers", [ ( CloudChannelServiceClient, transports.CloudChannelServiceGrpcTransport, "grpc", + grpc_helpers, ), ( CloudChannelServiceAsyncClient, transports.CloudChannelServiceGrpcAsyncIOTransport, "grpc_asyncio", + grpc_helpers_async, ), ], ) def test_cloud_channel_service_client_client_options_credentials_file( - client_class, transport_class, transport_name + client_class, transport_class, transport_name, grpc_helpers ): # Check the case credentials file is provided. options = client_options.ClientOptions(credentials_file="credentials.json") + with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None - client = client_class(transport=transport_name, client_options=options) + client = client_class(client_options=options, transport=transport_name) patched.assert_called_once_with( credentials=None, credentials_file="credentials.json", @@ -519,9 +604,74 @@ def test_cloud_channel_service_client_client_options_from_dict(): ) -def test_list_customers( - transport: str = "grpc", request_type=service.ListCustomersRequest +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + ( + CloudChannelServiceClient, + transports.CloudChannelServiceGrpcTransport, + "grpc", + grpc_helpers, + ), + ( + CloudChannelServiceAsyncClient, + transports.CloudChannelServiceGrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ], +) +def test_cloud_channel_service_client_create_channel_credentials_file( + client_class, transport_class, transport_name, grpc_helpers ): + # Check the case credentials file is provided. + options = client_options.ClientOptions(credentials_file="credentials.json") + + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options, transport=transport_name) + patched.assert_called_once_with( + credentials=None, + credentials_file="credentials.json", + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + ) + + # test that the credentials from file are saved and used as the credentials. + with mock.patch.object( + google.auth, "load_credentials_from_file", autospec=True + ) as load_creds, mock.patch.object( + google.auth, "default", autospec=True + ) as adc, mock.patch.object( + grpc_helpers, "create_channel" + ) as create_channel: + creds = ga_credentials.AnonymousCredentials() + file_creds = ga_credentials.AnonymousCredentials() + load_creds.return_value = (file_creds, None) + adc.return_value = (creds, None) + client = client_class(client_options=options, transport=transport_name) + create_channel.assert_called_with( + "cloudchannel.googleapis.com:443", + credentials=file_creds, + credentials_file=None, + quota_project_id=None, + default_scopes=("https://www.googleapis.com/auth/apps.order",), + scopes=None, + default_host="cloudchannel.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + +@pytest.mark.parametrize("request_type", [service.ListCustomersRequest, dict,]) +def test_list_customers(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -548,10 +698,6 @@ def test_list_customers( assert response.next_page_token == "next_page_token_value" -def test_list_customers_from_dict(): - test_list_customers(request_type=dict) - - 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. @@ -657,8 +803,10 @@ async def test_list_customers_field_headers_async(): assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] -def test_list_customers_pager(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_customers_pager(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_customers), "__call__") as call: @@ -695,8 +843,10 @@ def test_list_customers_pager(): assert all(isinstance(i, customers.Customer) for i in results) -def test_list_customers_pages(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_customers_pages(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_customers), "__call__") as call: @@ -799,7 +949,8 @@ async def test_list_customers_async_pages(): assert page_.raw_page.next_page_token == token -def test_get_customer(transport: str = "grpc", request_type=service.GetCustomerRequest): +@pytest.mark.parametrize("request_type", [service.GetCustomerRequest, dict,]) +def test_get_customer(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -838,10 +989,6 @@ def test_get_customer(transport: str = "grpc", request_type=service.GetCustomerR assert response.channel_partner_id == "channel_partner_id_value" -def test_get_customer_from_dict(): - test_get_customer(request_type=dict) - - 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. @@ -1033,9 +1180,10 @@ async def test_get_customer_flattened_error_async(): ) -def test_check_cloud_identity_accounts_exist( - transport: str = "grpc", request_type=service.CheckCloudIdentityAccountsExistRequest -): +@pytest.mark.parametrize( + "request_type", [service.CheckCloudIdentityAccountsExistRequest, dict,] +) +def test_check_cloud_identity_accounts_exist(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1061,10 +1209,6 @@ def test_check_cloud_identity_accounts_exist( assert isinstance(response, service.CheckCloudIdentityAccountsExistResponse) -def test_check_cloud_identity_accounts_exist_from_dict(): - test_check_cloud_identity_accounts_exist(request_type=dict) - - 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. @@ -1178,9 +1322,8 @@ async def test_check_cloud_identity_accounts_exist_field_headers_async(): assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] -def test_create_customer( - transport: str = "grpc", request_type=service.CreateCustomerRequest -): +@pytest.mark.parametrize("request_type", [service.CreateCustomerRequest, dict,]) +def test_create_customer(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1219,10 +1362,6 @@ def test_create_customer( assert response.channel_partner_id == "channel_partner_id_value" -def test_create_customer_from_dict(): - test_create_customer(request_type=dict) - - 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. @@ -1340,9 +1479,8 @@ async def test_create_customer_field_headers_async(): assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] -def test_update_customer( - transport: str = "grpc", request_type=service.UpdateCustomerRequest -): +@pytest.mark.parametrize("request_type", [service.UpdateCustomerRequest, dict,]) +def test_update_customer(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1381,10 +1519,6 @@ def test_update_customer( assert response.channel_partner_id == "channel_partner_id_value" -def test_update_customer_from_dict(): - test_update_customer(request_type=dict) - - 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. @@ -1506,9 +1640,8 @@ async def test_update_customer_field_headers_async(): ] -def test_delete_customer( - transport: str = "grpc", request_type=service.DeleteCustomerRequest -): +@pytest.mark.parametrize("request_type", [service.DeleteCustomerRequest, dict,]) +def test_delete_customer(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1532,10 +1665,6 @@ def test_delete_customer( assert response is None -def test_delete_customer_from_dict(): - test_delete_customer(request_type=dict) - - 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. @@ -1710,9 +1839,8 @@ async def test_delete_customer_flattened_error_async(): ) -def test_import_customer( - transport: str = "grpc", request_type=service.ImportCustomerRequest -): +@pytest.mark.parametrize("request_type", [service.ImportCustomerRequest, dict,]) +def test_import_customer(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1751,10 +1879,6 @@ def test_import_customer( assert response.channel_partner_id == "channel_partner_id_value" -def test_import_customer_from_dict(): - test_import_customer(request_type=dict) - - def test_import_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. @@ -1872,9 +1996,8 @@ async def test_import_customer_field_headers_async(): assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] -def test_provision_cloud_identity( - transport: str = "grpc", request_type=service.ProvisionCloudIdentityRequest -): +@pytest.mark.parametrize("request_type", [service.ProvisionCloudIdentityRequest, dict,]) +def test_provision_cloud_identity(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1900,10 +2023,6 @@ def test_provision_cloud_identity( assert isinstance(response, future.Future) -def test_provision_cloud_identity_from_dict(): - test_provision_cloud_identity(request_type=dict) - - 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. @@ -2016,9 +2135,8 @@ async def test_provision_cloud_identity_field_headers_async(): assert ("x-goog-request-params", "customer=customer/value",) in kw["metadata"] -def test_list_entitlements( - transport: str = "grpc", request_type=service.ListEntitlementsRequest -): +@pytest.mark.parametrize("request_type", [service.ListEntitlementsRequest, dict,]) +def test_list_entitlements(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2047,10 +2165,6 @@ def test_list_entitlements( assert response.next_page_token == "next_page_token_value" -def test_list_entitlements_from_dict(): - test_list_entitlements(request_type=dict) - - 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. @@ -2164,8 +2278,10 @@ async def test_list_entitlements_field_headers_async(): assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] -def test_list_entitlements_pager(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_entitlements_pager(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2204,8 +2320,10 @@ def test_list_entitlements_pager(): assert all(isinstance(i, entitlements.Entitlement) for i in results) -def test_list_entitlements_pages(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_entitlements_pages(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2314,9 +2432,8 @@ async def test_list_entitlements_async_pages(): assert page_.raw_page.next_page_token == token -def test_list_transferable_skus( - transport: str = "grpc", request_type=service.ListTransferableSkusRequest -): +@pytest.mark.parametrize("request_type", [service.ListTransferableSkusRequest, dict,]) +def test_list_transferable_skus(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2345,10 +2462,6 @@ def test_list_transferable_skus( assert response.next_page_token == "next_page_token_value" -def test_list_transferable_skus_from_dict(): - test_list_transferable_skus(request_type=dict) - - 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. @@ -2464,8 +2577,10 @@ async def test_list_transferable_skus_field_headers_async(): assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] -def test_list_transferable_skus_pager(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_transferable_skus_pager(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2510,8 +2625,10 @@ def test_list_transferable_skus_pager(): assert all(isinstance(i, entitlements.TransferableSku) for i in results) -def test_list_transferable_skus_pages(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_transferable_skus_pages(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2638,9 +2755,8 @@ async def test_list_transferable_skus_async_pages(): assert page_.raw_page.next_page_token == token -def test_list_transferable_offers( - transport: str = "grpc", request_type=service.ListTransferableOffersRequest -): +@pytest.mark.parametrize("request_type", [service.ListTransferableOffersRequest, dict,]) +def test_list_transferable_offers(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2669,10 +2785,6 @@ def test_list_transferable_offers( assert response.next_page_token == "next_page_token_value" -def test_list_transferable_offers_from_dict(): - test_list_transferable_offers(request_type=dict) - - 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. @@ -2788,8 +2900,10 @@ async def test_list_transferable_offers_field_headers_async(): assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] -def test_list_transferable_offers_pager(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_transferable_offers_pager(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2834,8 +2948,10 @@ def test_list_transferable_offers_pager(): assert all(isinstance(i, service.TransferableOffer) for i in results) -def test_list_transferable_offers_pages(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_transferable_offers_pages(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2962,9 +3078,8 @@ async def test_list_transferable_offers_async_pages(): assert page_.raw_page.next_page_token == token -def test_get_entitlement( - transport: str = "grpc", request_type=service.GetEntitlementRequest -): +@pytest.mark.parametrize("request_type", [service.GetEntitlementRequest, dict,]) +def test_get_entitlement(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3005,10 +3120,6 @@ def test_get_entitlement( assert response.purchase_order_id == "purchase_order_id_value" -def test_get_entitlement_from_dict(): - test_get_entitlement(request_type=dict) - - 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. @@ -3130,9 +3241,8 @@ async def test_get_entitlement_field_headers_async(): assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] -def test_create_entitlement( - transport: str = "grpc", request_type=service.CreateEntitlementRequest -): +@pytest.mark.parametrize("request_type", [service.CreateEntitlementRequest, dict,]) +def test_create_entitlement(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3158,10 +3268,6 @@ def test_create_entitlement( assert isinstance(response, future.Future) -def test_create_entitlement_from_dict(): - test_create_entitlement(request_type=dict) - - 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. @@ -3274,9 +3380,8 @@ async def test_create_entitlement_field_headers_async(): assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] -def test_change_parameters( - transport: str = "grpc", request_type=service.ChangeParametersRequest -): +@pytest.mark.parametrize("request_type", [service.ChangeParametersRequest, dict,]) +def test_change_parameters(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3302,10 +3407,6 @@ def test_change_parameters( assert isinstance(response, future.Future) -def test_change_parameters_from_dict(): - test_change_parameters(request_type=dict) - - 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. @@ -3418,9 +3519,8 @@ async def test_change_parameters_field_headers_async(): assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] -def test_change_renewal_settings( - transport: str = "grpc", request_type=service.ChangeRenewalSettingsRequest -): +@pytest.mark.parametrize("request_type", [service.ChangeRenewalSettingsRequest, dict,]) +def test_change_renewal_settings(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3446,10 +3546,6 @@ def test_change_renewal_settings( assert isinstance(response, future.Future) -def test_change_renewal_settings_from_dict(): - test_change_renewal_settings(request_type=dict) - - 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. @@ -3562,7 +3658,8 @@ async def test_change_renewal_settings_field_headers_async(): assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] -def test_change_offer(transport: str = "grpc", request_type=service.ChangeOfferRequest): +@pytest.mark.parametrize("request_type", [service.ChangeOfferRequest, dict,]) +def test_change_offer(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3586,10 +3683,6 @@ def test_change_offer(transport: str = "grpc", request_type=service.ChangeOfferR assert isinstance(response, future.Future) -def test_change_offer_from_dict(): - test_change_offer(request_type=dict) - - 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. @@ -3694,9 +3787,8 @@ async def test_change_offer_field_headers_async(): assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] -def test_start_paid_service( - transport: str = "grpc", request_type=service.StartPaidServiceRequest -): +@pytest.mark.parametrize("request_type", [service.StartPaidServiceRequest, dict,]) +def test_start_paid_service(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3722,10 +3814,6 @@ def test_start_paid_service( assert isinstance(response, future.Future) -def test_start_paid_service_from_dict(): - test_start_paid_service(request_type=dict) - - 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. @@ -3838,9 +3926,8 @@ async def test_start_paid_service_field_headers_async(): assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] -def test_suspend_entitlement( - transport: str = "grpc", request_type=service.SuspendEntitlementRequest -): +@pytest.mark.parametrize("request_type", [service.SuspendEntitlementRequest, dict,]) +def test_suspend_entitlement(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3866,10 +3953,6 @@ def test_suspend_entitlement( assert isinstance(response, future.Future) -def test_suspend_entitlement_from_dict(): - test_suspend_entitlement(request_type=dict) - - 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. @@ -3982,9 +4065,8 @@ async def test_suspend_entitlement_field_headers_async(): assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] -def test_cancel_entitlement( - transport: str = "grpc", request_type=service.CancelEntitlementRequest -): +@pytest.mark.parametrize("request_type", [service.CancelEntitlementRequest, dict,]) +def test_cancel_entitlement(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4010,10 +4092,6 @@ def test_cancel_entitlement( assert isinstance(response, future.Future) -def test_cancel_entitlement_from_dict(): - test_cancel_entitlement(request_type=dict) - - 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. @@ -4126,9 +4204,8 @@ async def test_cancel_entitlement_field_headers_async(): assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] -def test_activate_entitlement( - transport: str = "grpc", request_type=service.ActivateEntitlementRequest -): +@pytest.mark.parametrize("request_type", [service.ActivateEntitlementRequest, dict,]) +def test_activate_entitlement(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4154,10 +4231,6 @@ def test_activate_entitlement( assert isinstance(response, future.Future) -def test_activate_entitlement_from_dict(): - test_activate_entitlement(request_type=dict) - - 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. @@ -4270,9 +4343,8 @@ async def test_activate_entitlement_field_headers_async(): assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] -def test_transfer_entitlements( - transport: str = "grpc", request_type=service.TransferEntitlementsRequest -): +@pytest.mark.parametrize("request_type", [service.TransferEntitlementsRequest, dict,]) +def test_transfer_entitlements(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4298,10 +4370,6 @@ def test_transfer_entitlements( assert isinstance(response, future.Future) -def test_transfer_entitlements_from_dict(): - test_transfer_entitlements(request_type=dict) - - 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. @@ -4414,9 +4482,10 @@ async def test_transfer_entitlements_field_headers_async(): assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] -def test_transfer_entitlements_to_google( - transport: str = "grpc", request_type=service.TransferEntitlementsToGoogleRequest -): +@pytest.mark.parametrize( + "request_type", [service.TransferEntitlementsToGoogleRequest, dict,] +) +def test_transfer_entitlements_to_google(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4442,10 +4511,6 @@ def test_transfer_entitlements_to_google( assert isinstance(response, future.Future) -def test_transfer_entitlements_to_google_from_dict(): - test_transfer_entitlements_to_google(request_type=dict) - - 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. @@ -4559,9 +4624,10 @@ async def test_transfer_entitlements_to_google_field_headers_async(): assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] -def test_list_channel_partner_links( - transport: str = "grpc", request_type=service.ListChannelPartnerLinksRequest -): +@pytest.mark.parametrize( + "request_type", [service.ListChannelPartnerLinksRequest, dict,] +) +def test_list_channel_partner_links(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4590,10 +4656,6 @@ def test_list_channel_partner_links( assert response.next_page_token == "next_page_token_value" -def test_list_channel_partner_links_from_dict(): - test_list_channel_partner_links(request_type=dict) - - 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. @@ -4709,8 +4771,10 @@ async def test_list_channel_partner_links_field_headers_async(): assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] -def test_list_channel_partner_links_pager(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_channel_partner_links_pager(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4757,8 +4821,10 @@ def test_list_channel_partner_links_pager(): ) -def test_list_channel_partner_links_pages(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_channel_partner_links_pages(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4887,9 +4953,8 @@ async def test_list_channel_partner_links_async_pages(): assert page_.raw_page.next_page_token == token -def test_get_channel_partner_link( - transport: str = "grpc", request_type=service.GetChannelPartnerLinkRequest -): +@pytest.mark.parametrize("request_type", [service.GetChannelPartnerLinkRequest, dict,]) +def test_get_channel_partner_link(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4926,10 +4991,6 @@ def test_get_channel_partner_link( assert response.public_id == "public_id_value" -def test_get_channel_partner_link_from_dict(): - test_get_channel_partner_link(request_type=dict) - - 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. @@ -5053,9 +5114,10 @@ async def test_get_channel_partner_link_field_headers_async(): assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] -def test_create_channel_partner_link( - transport: str = "grpc", request_type=service.CreateChannelPartnerLinkRequest -): +@pytest.mark.parametrize( + "request_type", [service.CreateChannelPartnerLinkRequest, dict,] +) +def test_create_channel_partner_link(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5092,10 +5154,6 @@ def test_create_channel_partner_link( assert response.public_id == "public_id_value" -def test_create_channel_partner_link_from_dict(): - test_create_channel_partner_link(request_type=dict) - - 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. @@ -5220,9 +5278,10 @@ async def test_create_channel_partner_link_field_headers_async(): assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] -def test_update_channel_partner_link( - transport: str = "grpc", request_type=service.UpdateChannelPartnerLinkRequest -): +@pytest.mark.parametrize( + "request_type", [service.UpdateChannelPartnerLinkRequest, dict,] +) +def test_update_channel_partner_link(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5259,10 +5318,6 @@ def test_update_channel_partner_link( assert response.public_id == "public_id_value" -def test_update_channel_partner_link_from_dict(): - test_update_channel_partner_link(request_type=dict) - - 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. @@ -5387,7 +5442,8 @@ async def test_update_channel_partner_link_field_headers_async(): assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] -def test_lookup_offer(transport: str = "grpc", request_type=service.LookupOfferRequest): +@pytest.mark.parametrize("request_type", [service.LookupOfferRequest, dict,]) +def test_lookup_offer(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5412,10 +5468,6 @@ def test_lookup_offer(transport: str = "grpc", request_type=service.LookupOfferR assert response.name == "name_value" -def test_lookup_offer_from_dict(): - test_lookup_offer(request_type=dict) - - def test_lookup_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. @@ -5519,9 +5571,8 @@ async def test_lookup_offer_field_headers_async(): assert ("x-goog-request-params", "entitlement=entitlement/value",) in kw["metadata"] -def test_list_products( - transport: str = "grpc", request_type=service.ListProductsRequest -): +@pytest.mark.parametrize("request_type", [service.ListProductsRequest, dict,]) +def test_list_products(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5548,10 +5599,6 @@ def test_list_products( assert response.next_page_token == "next_page_token_value" -def test_list_products_from_dict(): - test_list_products(request_type=dict) - - 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. @@ -5602,8 +5649,10 @@ async def test_list_products_async_from_dict(): await test_list_products_async(request_type=dict) -def test_list_products_pager(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_products_pager(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_products), "__call__") as call: @@ -5633,8 +5682,10 @@ def test_list_products_pager(): assert all(isinstance(i, products.Product) for i in results) -def test_list_products_pages(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_products_pages(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_products), "__call__") as call: @@ -5725,7 +5776,8 @@ async def test_list_products_async_pages(): assert page_.raw_page.next_page_token == token -def test_list_skus(transport: str = "grpc", request_type=service.ListSkusRequest): +@pytest.mark.parametrize("request_type", [service.ListSkusRequest, dict,]) +def test_list_skus(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5752,10 +5804,6 @@ def test_list_skus(transport: str = "grpc", request_type=service.ListSkusRequest assert response.next_page_token == "next_page_token_value" -def test_list_skus_from_dict(): - test_list_skus(request_type=dict) - - 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. @@ -5861,8 +5909,10 @@ async def test_list_skus_field_headers_async(): assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] -def test_list_skus_pager(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_skus_pager(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_skus), "__call__") as call: @@ -5891,8 +5941,10 @@ def test_list_skus_pager(): assert all(isinstance(i, products.Sku) for i in results) -def test_list_skus_pages(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_skus_pages(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_skus), "__call__") as call: @@ -5971,7 +6023,8 @@ async def test_list_skus_async_pages(): assert page_.raw_page.next_page_token == token -def test_list_offers(transport: str = "grpc", request_type=service.ListOffersRequest): +@pytest.mark.parametrize("request_type", [service.ListOffersRequest, dict,]) +def test_list_offers(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5998,10 +6051,6 @@ def test_list_offers(transport: str = "grpc", request_type=service.ListOffersReq assert response.next_page_token == "next_page_token_value" -def test_list_offers_from_dict(): - test_list_offers(request_type=dict) - - 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. @@ -6107,8 +6156,10 @@ async def test_list_offers_field_headers_async(): assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] -def test_list_offers_pager(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_offers_pager(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_offers), "__call__") as call: @@ -6139,8 +6190,10 @@ def test_list_offers_pager(): assert all(isinstance(i, offers.Offer) for i in results) -def test_list_offers_pages(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_offers_pages(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_offers), "__call__") as call: @@ -6225,9 +6278,8 @@ async def test_list_offers_async_pages(): assert page_.raw_page.next_page_token == token -def test_list_purchasable_skus( - transport: str = "grpc", request_type=service.ListPurchasableSkusRequest -): +@pytest.mark.parametrize("request_type", [service.ListPurchasableSkusRequest, dict,]) +def test_list_purchasable_skus(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6256,10 +6308,6 @@ def test_list_purchasable_skus( assert response.next_page_token == "next_page_token_value" -def test_list_purchasable_skus_from_dict(): - test_list_purchasable_skus(request_type=dict) - - 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. @@ -6375,8 +6423,10 @@ async def test_list_purchasable_skus_field_headers_async(): assert ("x-goog-request-params", "customer=customer/value",) in kw["metadata"] -def test_list_purchasable_skus_pager(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_purchasable_skus_pager(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6417,8 +6467,10 @@ def test_list_purchasable_skus_pager(): assert all(isinstance(i, service.PurchasableSku) for i in results) -def test_list_purchasable_skus_pages(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_purchasable_skus_pages(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6533,9 +6585,8 @@ async def test_list_purchasable_skus_async_pages(): assert page_.raw_page.next_page_token == token -def test_list_purchasable_offers( - transport: str = "grpc", request_type=service.ListPurchasableOffersRequest -): +@pytest.mark.parametrize("request_type", [service.ListPurchasableOffersRequest, dict,]) +def test_list_purchasable_offers(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6564,10 +6615,6 @@ def test_list_purchasable_offers( assert response.next_page_token == "next_page_token_value" -def test_list_purchasable_offers_from_dict(): - test_list_purchasable_offers(request_type=dict) - - 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. @@ -6683,8 +6730,10 @@ async def test_list_purchasable_offers_field_headers_async(): assert ("x-goog-request-params", "customer=customer/value",) in kw["metadata"] -def test_list_purchasable_offers_pager(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_purchasable_offers_pager(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6728,8 +6777,10 @@ def test_list_purchasable_offers_pager(): assert all(isinstance(i, service.PurchasableOffer) for i in results) -def test_list_purchasable_offers_pages(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_purchasable_offers_pages(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -6853,9 +6904,8 @@ async def test_list_purchasable_offers_async_pages(): assert page_.raw_page.next_page_token == token -def test_register_subscriber( - transport: str = "grpc", request_type=service.RegisterSubscriberRequest -): +@pytest.mark.parametrize("request_type", [service.RegisterSubscriberRequest, dict,]) +def test_register_subscriber(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6882,10 +6932,6 @@ def test_register_subscriber( assert response.topic == "topic_value" -def test_register_subscriber_from_dict(): - test_register_subscriber(request_type=dict) - - 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. @@ -6999,9 +7045,8 @@ async def test_register_subscriber_field_headers_async(): assert ("x-goog-request-params", "account=account/value",) in kw["metadata"] -def test_unregister_subscriber( - transport: str = "grpc", request_type=service.UnregisterSubscriberRequest -): +@pytest.mark.parametrize("request_type", [service.UnregisterSubscriberRequest, dict,]) +def test_unregister_subscriber(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7028,10 +7073,6 @@ def test_unregister_subscriber( assert response.topic == "topic_value" -def test_unregister_subscriber_from_dict(): - test_unregister_subscriber(request_type=dict) - - 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. @@ -7145,9 +7186,8 @@ async def test_unregister_subscriber_field_headers_async(): assert ("x-goog-request-params", "account=account/value",) in kw["metadata"] -def test_list_subscribers( - transport: str = "grpc", request_type=service.ListSubscribersRequest -): +@pytest.mark.parametrize("request_type", [service.ListSubscribersRequest, dict,]) +def test_list_subscribers(request_type, transport: str = "grpc"): client = CloudChannelServiceClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7178,10 +7218,6 @@ def test_list_subscribers( assert response.next_page_token == "next_page_token_value" -def test_list_subscribers_from_dict(): - test_list_subscribers(request_type=dict) - - 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. @@ -7293,8 +7329,10 @@ async def test_list_subscribers_field_headers_async(): assert ("x-goog-request-params", "account=account/value",) in kw["metadata"] -def test_list_subscribers_pager(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_subscribers_pager(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_subscribers), "__call__") as call: @@ -7326,8 +7364,10 @@ def test_list_subscribers_pager(): assert all(isinstance(i, str) for i in results) -def test_list_subscribers_pages(): - client = CloudChannelServiceClient(credentials=ga_credentials.AnonymousCredentials,) +def test_list_subscribers_pages(transport_name: str = "grpc"): + client = CloudChannelServiceClient( + credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_subscribers), "__call__") as call: @@ -7435,6 +7475,23 @@ def test_credentials_transport_error(): transport=transport, ) + # It is an error to provide an api_key and a transport instance. + transport = transports.CloudChannelServiceGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + options = client_options.ClientOptions() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = CloudChannelServiceClient(client_options=options, transport=transport,) + + # It is an error to provide an api_key and a credential. + options = mock.Mock() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = CloudChannelServiceClient( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + # It is an error to provide scopes and a transport instance. transport = transports.CloudChannelServiceGrpcTransport( credentials=ga_credentials.AnonymousCredentials(), @@ -8102,7 +8159,7 @@ def test_parse_common_location_path(): assert expected == actual -def test_client_withDEFAULT_CLIENT_INFO(): +def test_client_with_default_client_info(): client_info = gapic_v1.client_info.ClientInfo() with mock.patch.object( @@ -8167,3 +8224,36 @@ def test_client_ctx(): with client: pass close.assert_called() + + +@pytest.mark.parametrize( + "client_class,transport_class", + [ + (CloudChannelServiceClient, transports.CloudChannelServiceGrpcTransport), + ( + CloudChannelServiceAsyncClient, + transports.CloudChannelServiceGrpcAsyncIOTransport, + ), + ], +) +def test_api_key_credentials(client_class, transport_class): + with mock.patch.object( + google.auth._default, "get_api_key_credentials", create=True + ) as get_api_key_credentials: + mock_cred = mock.Mock() + get_api_key_credentials.return_value = mock_cred + options = client_options.ClientOptions() + options.api_key = "api_key" + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + client = client_class(client_options=options) + patched.assert_called_once_with( + credentials=mock_cred, + credentials_file=None, + host=client.DEFAULT_ENDPOINT, + scopes=None, + client_cert_source_for_mtls=None, + quota_project_id=None, + client_info=transports.base.DEFAULT_CLIENT_INFO, + always_use_jwt_access=True, + )