From 686f6c65f1e9c7659587b670592123bb8bf7a136 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 13 Jan 2022 16:22:34 +0000 Subject: [PATCH 01/14] build: switch to release-please for tagging (#205) --- .github/.OwlBot.lock.yaml | 2 +- .github/release-please.yml | 1 + .github/release-trigger.yml | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 .github/release-trigger.yml diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 6b8a73b3..ff5126c1 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:36a95b8f494e4674dc9eee9af98961293b51b86b3649942aac800ae6c1f796d4 + digest: sha256:dfa9b663b32de8b5b327e32c1da665a80de48876558dd58091d8160c60ad7355 diff --git a/.github/release-please.yml b/.github/release-please.yml index 4507ad05..466597e5 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 00000000..d4ca9418 --- /dev/null +++ b/.github/release-trigger.yml @@ -0,0 +1 @@ +enabled: true From 4de85700e310676264c2789277b74dd246da3d64 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 13 Jan 2022 20:19:36 +0100 Subject: [PATCH 02/14] chore(deps): update dependency google-cloud-tasks to v2.7.2 (#206) Co-authored-by: Leah E. Cole <6719667+leahecole@users.noreply.github.com> --- samples/snippets/requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/requirements.txt b/samples/snippets/requirements.txt index 912c8dda..4128ab74 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1 +1 @@ -google-cloud-tasks==2.7.1 +google-cloud-tasks==2.7.2 From 739030988bf304b1ed3cf8712794e656ebb5c4d1 Mon Sep 17 00:00:00 2001 From: Averi Kitsch Date: Thu, 13 Jan 2022 15:20:08 -0800 Subject: [PATCH 03/14] chore: update samples (#207) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update samples * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update create_http_task_test.py Co-authored-by: Owl Bot Co-authored-by: Charles Engelke --- samples/snippets/create_http_task.py | 17 +++++++++++++++-- samples/snippets/create_http_task_test.py | 12 ++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/samples/snippets/create_http_task.py b/samples/snippets/create_http_task.py index e6d7435e..40e735b3 100644 --- a/samples/snippets/create_http_task.py +++ b/samples/snippets/create_http_task.py @@ -18,13 +18,20 @@ def create_http_task( - project, queue, location, url, payload=None, in_seconds=None, task_name=None + project, + queue, + location, + url, + payload=None, + in_seconds=None, + task_name=None, + deadline=None, ): # [START cloud_tasks_create_http_task] """Create a task for a given queue with an arbitrary payload.""" from google.cloud import tasks_v2 - from google.protobuf import timestamp_pb2 + from google.protobuf import timestamp_pb2, duration_pb2 import datetime import json @@ -39,6 +46,7 @@ def create_http_task( # payload = 'hello' or {'param': 'value'} for application/json # in_seconds = 180 # task_name = 'my-unique-task' + # deadline = 900 # Construct the fully qualified queue name. parent = client.queue_path(project, location, queue) @@ -78,6 +86,11 @@ def create_http_task( # Add the name to tasks. task["name"] = client.task_path(project, location, queue, task_name) + if deadline is not None: + # Add dispatch deadline for requests sent to the worker. + duration = duration_pb2.Duration() + task["dispatch_deadline"] = duration.FromSeconds(deadline) + # Use the client to build and send the task. response = client.create_task(request={"parent": parent, "task": task}) diff --git a/samples/snippets/create_http_task_test.py b/samples/snippets/create_http_task_test.py index 20cfced9..a66f3287 100644 --- a/samples/snippets/create_http_task_test.py +++ b/samples/snippets/create_http_task_test.py @@ -46,3 +46,15 @@ def test_create_http_task(test_queue): TEST_PROJECT_ID, TEST_QUEUE_NAME, TEST_LOCATION, url ) assert TEST_QUEUE_NAME in result.name + + result = create_http_task.create_http_task( + TEST_PROJECT_ID, + TEST_QUEUE_NAME, + TEST_LOCATION, + url, + payload="hello", + in_seconds=180, + task_name=uuid.uuid4().hex, + deadline=900, + ) + assert TEST_QUEUE_NAME in result.name From 3d25dc77e90973ee010170e27af169899bda4ba8 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 14 Jan 2022 09:28:38 -0500 Subject: [PATCH 04/14] chore(python): update release.sh to use keystore (#208) Source-Link: https://github.com/googleapis/synthtool/commit/69fda12e2994f0b595a397e8bb6e3e9f380524eb Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:ae600f36b6bc972b368367b6f83a1d91ec2c82a4a116b383d67d547c56fe6de3 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- .kokoro/release.sh | 2 +- .kokoro/release/common.cfg | 12 +++++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index ff5126c1..eecb84c2 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:dfa9b663b32de8b5b327e32c1da665a80de48876558dd58091d8160c60ad7355 + digest: sha256:ae600f36b6bc972b368367b6f83a1d91ec2c82a4a116b383d67d547c56fe6de3 diff --git a/.kokoro/release.sh b/.kokoro/release.sh index 163eb07a..dcd5c6d9 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-tasks 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 716e424e..cc6bbafb 100644 --- a/.kokoro/release/common.cfg +++ b/.kokoro/release/common.cfg @@ -23,8 +23,18 @@ env_vars: { value: "github/python-tasks/.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" } From c2a1aca7f7086c1a1d596a7183f81bd528598e6f Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 18 Jan 2022 20:37:59 -0500 Subject: [PATCH 05/14] chore(python): Noxfile recognizes that tests can live in a folder (#210) Source-Link: https://github.com/googleapis/synthtool/commit/4760d8dce1351d93658cb11d02a1b7ceb23ae5d7 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:f0e4b51deef56bed74d3e2359c583fc104a8d6367da3984fc5c66938db738828 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- samples/snippets/noxfile.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index eecb84c2..52d79c11 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -1,3 +1,3 @@ docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:ae600f36b6bc972b368367b6f83a1d91ec2c82a4a116b383d67d547c56fe6de3 + digest: sha256:f0e4b51deef56bed74d3e2359c583fc104a8d6367da3984fc5c66938db738828 diff --git a/samples/snippets/noxfile.py b/samples/snippets/noxfile.py index 3bbef5d5..20cdfc62 100644 --- a/samples/snippets/noxfile.py +++ b/samples/snippets/noxfile.py @@ -187,6 +187,7 @@ def _session_tests( ) -> None: # check for presence of tests test_list = glob.glob("*_test.py") + glob.glob("test_*.py") + test_list.extend(glob.glob("tests")) if len(test_list) == 0: print("No tests found, skipping directory.") else: From e79e8ea1821163b128a01934f7ebec7f4e667436 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 20 Jan 2022 09:08:23 -0500 Subject: [PATCH 06/14] ci(python): run lint / unit tests / docs as GH actions (#212) * ci(python): run lint / unit tests / docs as GH actions Source-Link: https://github.com/googleapis/synthtool/commit/57be0cdb0b94e1669cee0ca38d790de1dfdbcd44 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:ed1f9983d5a935a89fe8085e8bb97d94e41015252c5b6c9771257cf8624367e6 * add commit to trigger gh actions Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- .github/.OwlBot.lock.yaml | 16 +++++++++- .github/workflows/docs.yml | 38 +++++++++++++++++++++++ .github/workflows/lint.yml | 25 +++++++++++++++ .github/workflows/unittest.yml | 57 ++++++++++++++++++++++++++++++++++ 4 files changed, 135 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/docs.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/unittest.yml diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 52d79c11..b668c04d 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:f0e4b51deef56bed74d3e2359c583fc104a8d6367da3984fc5c66938db738828 + digest: sha256:ed1f9983d5a935a89fe8085e8bb97d94e41015252c5b6c9771257cf8624367e6 + diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..f7b8344c --- /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 00000000..1e8b05c3 --- /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 00000000..074ee250 --- /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 From eeba41920c4ad0bcb11d444fc14758ac27566fcd Mon Sep 17 00:00:00 2001 From: Dina Graves Portman Date: Thu, 20 Jan 2022 10:56:23 -0500 Subject: [PATCH 07/14] chore: update codeowners (#211) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: update codeowners * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- .github/CODEOWNERS | 8 ++++---- .repo-metadata.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 25128855..63a84c3b 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -5,8 +5,8 @@ # https://help.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax # Note: This file is autogenerated. To make changes to the codeowner team, please update .repo-metadata.json. -# @googleapis/yoshi-python @googleapis/serverless-team are the default owners for changes in this repo -* @googleapis/yoshi-python @googleapis/serverless-team +# @googleapis/yoshi-python @googleapis/aap-dpes are the default owners for changes in this repo +* @googleapis/yoshi-python @googleapis/aap-dpes -# @googleapis/python-samples-reviewers @googleapis/serverless-team are the default owners for samples changes -/samples/ @googleapis/python-samples-reviewers @googleapis/serverless-team +# @googleapis/python-samples-reviewers @googleapis/aap-dpes are the default owners for samples changes +/samples/ @googleapis/python-samples-reviewers @googleapis/aap-dpes diff --git a/.repo-metadata.json b/.repo-metadata.json index 2144604c..c251c2ba 100644 --- a/.repo-metadata.json +++ b/.repo-metadata.json @@ -12,6 +12,6 @@ "api_id": "cloudtasks.googleapis.com", "requires_billing": true, "default_version": "v2", - "codeowner_team": "@googleapis/serverless-team", + "codeowner_team": "@googleapis/aap-dpes", "api_shortname": "cloudtasks" } From 1b19d3d48dd9f5f7de96ab1eea330a5342eb265d Mon Sep 17 00:00:00 2001 From: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> Date: Mon, 24 Jan 2022 13:09:26 -0700 Subject: [PATCH 08/14] chore: make samples 3.6 check optional (#213) --- .github/sync-repo-settings.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/sync-repo-settings.yaml b/.github/sync-repo-settings.yaml index 3e98ae70..37438d33 100644 --- a/.github/sync-repo-settings.yaml +++ b/.github/sync-repo-settings.yaml @@ -10,6 +10,5 @@ branchProtectionRules: - 'Kokoro' - 'cla/google' - 'Samples - Lint' - - 'Samples - Python 3.6' - 'Samples - Python 3.7' - 'Samples - Python 3.8' From ce215987f969cbc6347fb58cd2163394a6fc7f1c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 25 Jan 2022 10:31:04 -0500 Subject: [PATCH 09/14] feat: add api key support (#214) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: upgrade gapic-generator-java, gax-java and gapic-generator-python PiperOrigin-RevId: 423842556 Source-Link: https://github.com/googleapis/googleapis/commit/a616ca08f4b1416abbac7bc5dd6d61c791756a81 Source-Link: https://github.com/googleapis/googleapis-gen/commit/29b938c58c1e51d019f2ee539d55dc0a3c86a905 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjliOTM4YzU4YzFlNTFkMDE5ZjJlZTUzOWQ1NWRjMGEzYzg2YTkwNSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot Co-authored-by: Anthonios Partheniou --- .../services/cloud_tasks/async_client.py | 38 +++++- .../tasks_v2/services/cloud_tasks/client.py | 127 ++++++++++++------ .../services/cloud_tasks/async_client.py | 38 +++++- .../services/cloud_tasks/client.py | 127 ++++++++++++------ .../services/cloud_tasks/async_client.py | 38 +++++- .../services/cloud_tasks/client.py | 127 ++++++++++++------ tests/unit/gapic/tasks_v2/test_cloud_tasks.py | 124 +++++++++++++++++ .../gapic/tasks_v2beta2/test_cloud_tasks.py | 124 +++++++++++++++++ .../gapic/tasks_v2beta3/test_cloud_tasks.py | 124 +++++++++++++++++ 9 files changed, 735 insertions(+), 132 deletions(-) diff --git a/google/cloud/tasks_v2/services/cloud_tasks/async_client.py b/google/cloud/tasks_v2/services/cloud_tasks/async_client.py index 250d60b7..78c58f1a 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/async_client.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/async_client.py @@ -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 @@ -114,6 +114,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 CloudTasksClient.get_mtls_endpoint_and_cert_source(client_options) # type: ignore + @property def transport(self) -> CloudTasksTransport: """Returns the transport used by the client instance. diff --git a/google/cloud/tasks_v2/services/cloud_tasks/client.py b/google/cloud/tasks_v2/services/cloud_tasks/client.py index 04e5cd06..8353e6c5 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/client.py @@ -260,6 +260,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, *, @@ -310,57 +377,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, CloudTasksTransport): # transport is a CloudTasksTransport 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." @@ -372,6 +404,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, diff --git a/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py b/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py index 072eb6bd..37bfc3dc 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py @@ -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 @@ -114,6 +114,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 CloudTasksClient.get_mtls_endpoint_and_cert_source(client_options) # type: ignore + @property def transport(self) -> CloudTasksTransport: """Returns the transport used by the client instance. diff --git a/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py b/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py index 7188dc89..4e01ee2f 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py @@ -260,6 +260,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, *, @@ -310,57 +377,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, CloudTasksTransport): # transport is a CloudTasksTransport 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." @@ -372,6 +404,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, diff --git a/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py b/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py index e65ae368..092513f1 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py @@ -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 @@ -114,6 +114,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 CloudTasksClient.get_mtls_endpoint_and_cert_source(client_options) # type: ignore + @property def transport(self) -> CloudTasksTransport: """Returns the transport used by the client instance. diff --git a/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py b/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py index 1012117c..36daacee 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py @@ -260,6 +260,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, *, @@ -310,57 +377,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, CloudTasksTransport): # transport is a CloudTasksTransport 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." @@ -372,6 +404,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, diff --git a/tests/unit/gapic/tasks_v2/test_cloud_tasks.py b/tests/unit/gapic/tasks_v2/test_cloud_tasks.py index 3c511e52..db776e3d 100644 --- a/tests/unit/gapic/tasks_v2/test_cloud_tasks.py +++ b/tests/unit/gapic/tasks_v2/test_cloud_tasks.py @@ -398,6 +398,83 @@ def test_cloud_tasks_client_mtls_env_auto( ) +@pytest.mark.parametrize("client_class", [CloudTasksClient, CloudTasksAsyncClient]) +@mock.patch.object( + CloudTasksClient, "DEFAULT_ENDPOINT", modify_default_endpoint(CloudTasksClient) +) +@mock.patch.object( + CloudTasksAsyncClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(CloudTasksAsyncClient), +) +def test_cloud_tasks_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", [ @@ -3997,6 +4074,23 @@ def test_credentials_transport_error(): transport=transport, ) + # It is an error to provide an api_key and a transport instance. + transport = transports.CloudTasksGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + options = client_options.ClientOptions() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = CloudTasksClient(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 = CloudTasksClient( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + # It is an error to provide scopes and a transport instance. transport = transports.CloudTasksGrpcTransport( credentials=ga_credentials.AnonymousCredentials(), @@ -4580,3 +4674,33 @@ def test_client_ctx(): with client: pass close.assert_called() + + +@pytest.mark.parametrize( + "client_class,transport_class", + [ + (CloudTasksClient, transports.CloudTasksGrpcTransport), + (CloudTasksAsyncClient, transports.CloudTasksGrpcAsyncIOTransport), + ], +) +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, + ) diff --git a/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py b/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py index 7613f45c..3785a4b0 100644 --- a/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py +++ b/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py @@ -398,6 +398,83 @@ def test_cloud_tasks_client_mtls_env_auto( ) +@pytest.mark.parametrize("client_class", [CloudTasksClient, CloudTasksAsyncClient]) +@mock.patch.object( + CloudTasksClient, "DEFAULT_ENDPOINT", modify_default_endpoint(CloudTasksClient) +) +@mock.patch.object( + CloudTasksAsyncClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(CloudTasksAsyncClient), +) +def test_cloud_tasks_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", [ @@ -4846,6 +4923,23 @@ def test_credentials_transport_error(): transport=transport, ) + # It is an error to provide an api_key and a transport instance. + transport = transports.CloudTasksGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + options = client_options.ClientOptions() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = CloudTasksClient(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 = CloudTasksClient( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + # It is an error to provide scopes and a transport instance. transport = transports.CloudTasksGrpcTransport( credentials=ga_credentials.AnonymousCredentials(), @@ -5433,3 +5527,33 @@ def test_client_ctx(): with client: pass close.assert_called() + + +@pytest.mark.parametrize( + "client_class,transport_class", + [ + (CloudTasksClient, transports.CloudTasksGrpcTransport), + (CloudTasksAsyncClient, transports.CloudTasksGrpcAsyncIOTransport), + ], +) +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, + ) diff --git a/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py b/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py index 858eca12..7ea9efa0 100644 --- a/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py +++ b/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py @@ -398,6 +398,83 @@ def test_cloud_tasks_client_mtls_env_auto( ) +@pytest.mark.parametrize("client_class", [CloudTasksClient, CloudTasksAsyncClient]) +@mock.patch.object( + CloudTasksClient, "DEFAULT_ENDPOINT", modify_default_endpoint(CloudTasksClient) +) +@mock.patch.object( + CloudTasksAsyncClient, + "DEFAULT_ENDPOINT", + modify_default_endpoint(CloudTasksAsyncClient), +) +def test_cloud_tasks_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", [ @@ -4075,6 +4152,23 @@ def test_credentials_transport_error(): transport=transport, ) + # It is an error to provide an api_key and a transport instance. + transport = transports.CloudTasksGrpcTransport( + credentials=ga_credentials.AnonymousCredentials(), + ) + options = client_options.ClientOptions() + options.api_key = "api_key" + with pytest.raises(ValueError): + client = CloudTasksClient(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 = CloudTasksClient( + client_options=options, credentials=ga_credentials.AnonymousCredentials() + ) + # It is an error to provide scopes and a transport instance. transport = transports.CloudTasksGrpcTransport( credentials=ga_credentials.AnonymousCredentials(), @@ -4658,3 +4752,33 @@ def test_client_ctx(): with client: pass close.assert_called() + + +@pytest.mark.parametrize( + "client_class,transport_class", + [ + (CloudTasksClient, transports.CloudTasksGrpcTransport), + (CloudTasksAsyncClient, transports.CloudTasksGrpcAsyncIOTransport), + ], +) +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, + ) From 8dd8aec79d2302007e3f9511daeab817f05d2aa6 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 3 Feb 2022 15:22:49 +0000 Subject: [PATCH 10/14] chore: use gapic-generator-python 0.62.1 (#217) - [ ] Regenerate this pull request now. fix: resolve DuplicateCredentialArgs error when using credentials_file committer: parthea PiperOrigin-RevId: 425964861 Source-Link: https://github.com/googleapis/googleapis/commit/84b1a5a4f6fb2d04905be58e586b8a7a4310a8cf Source-Link: https://github.com/googleapis/googleapis-gen/commit/4fb761bbd8506ac156f49bac5f18306aa8eb3aa8 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGZiNzYxYmJkODUwNmFjMTU2ZjQ5YmFjNWYxODMwNmFhOGViM2FhOCJ9 --- .../services/cloud_tasks/async_client.py | 32 ++++----- .../tasks_v2/services/cloud_tasks/client.py | 32 ++++----- .../services/cloud_tasks/transports/grpc.py | 5 +- .../cloud_tasks/transports/grpc_asyncio.py | 5 +- .../services/cloud_tasks/async_client.py | 40 +++++------ .../services/cloud_tasks/client.py | 40 +++++------ .../services/cloud_tasks/transports/grpc.py | 5 +- .../cloud_tasks/transports/grpc_asyncio.py | 5 +- .../services/cloud_tasks/async_client.py | 32 ++++----- .../services/cloud_tasks/client.py | 32 ++++----- .../services/cloud_tasks/transports/grpc.py | 5 +- .../cloud_tasks/transports/grpc_asyncio.py | 5 +- tests/unit/gapic/tasks_v2/test_cloud_tasks.py | 69 ++++++++++++++++++- .../gapic/tasks_v2beta2/test_cloud_tasks.py | 69 ++++++++++++++++++- .../gapic/tasks_v2beta3/test_cloud_tasks.py | 69 ++++++++++++++++++- 15 files changed, 326 insertions(+), 119 deletions(-) diff --git a/google/cloud/tasks_v2/services/cloud_tasks/async_client.py b/google/cloud/tasks_v2/services/cloud_tasks/async_client.py index 78c58f1a..5661a066 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/async_client.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/async_client.py @@ -249,7 +249,7 @@ async def list_queues( """ # 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([parent]) if request is not None and has_flattened_params: @@ -340,7 +340,7 @@ async def get_queue( """ # 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: @@ -450,7 +450,7 @@ async def create_queue( """ # 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([parent, queue]) if request is not None and has_flattened_params: @@ -558,7 +558,7 @@ async def update_queue( """ # 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([queue, update_mask]) if request is not None and has_flattened_params: @@ -638,7 +638,7 @@ async def delete_queue( 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: @@ -727,7 +727,7 @@ async def purge_queue( """ # 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: @@ -809,7 +809,7 @@ async def pause_queue( """ # 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: @@ -898,7 +898,7 @@ async def resume_queue( """ # 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: @@ -1032,7 +1032,7 @@ async def get_iam_policy( """ # 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([resource]) if request is not None and has_flattened_params: @@ -1180,7 +1180,7 @@ async def set_iam_policy( """ # 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([resource]) if request is not None and has_flattened_params: @@ -1269,7 +1269,7 @@ async def test_iam_permissions( Response message for TestIamPermissions method. """ # 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([resource, permissions]) if request is not None and has_flattened_params: @@ -1365,7 +1365,7 @@ async def list_tasks( """ # 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([parent]) if request is not None and has_flattened_params: @@ -1451,7 +1451,7 @@ async def get_task( A unit of scheduled work. """ # 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: @@ -1584,7 +1584,7 @@ async def create_task( A unit of scheduled work. """ # 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([parent, task]) if request is not None and has_flattened_params: @@ -1655,7 +1655,7 @@ async def delete_task( 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: @@ -1760,7 +1760,7 @@ async def run_task( A unit of scheduled work. """ # 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: diff --git a/google/cloud/tasks_v2/services/cloud_tasks/client.py b/google/cloud/tasks_v2/services/cloud_tasks/client.py index 8353e6c5..7da4f4d2 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/client.py @@ -464,7 +464,7 @@ def list_queues( """ # 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([parent]) if request is not None and has_flattened_params: @@ -545,7 +545,7 @@ def get_queue( """ # 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: @@ -645,7 +645,7 @@ def create_queue( """ # 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([parent, queue]) if request is not None and has_flattened_params: @@ -753,7 +753,7 @@ def update_queue( """ # 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([queue, update_mask]) if request is not None and has_flattened_params: @@ -833,7 +833,7 @@ def delete_queue( 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,7 +912,7 @@ def purge_queue( """ # 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: @@ -994,7 +994,7 @@ def pause_queue( """ # 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: @@ -1083,7 +1083,7 @@ def resume_queue( """ # 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: @@ -1217,7 +1217,7 @@ def get_iam_policy( """ # 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([resource]) if request is not None and has_flattened_params: @@ -1354,7 +1354,7 @@ def set_iam_policy( """ # 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([resource]) if request is not None and has_flattened_params: @@ -1442,7 +1442,7 @@ def test_iam_permissions( Response message for TestIamPermissions method. """ # 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([resource, permissions]) if request is not None and has_flattened_params: @@ -1527,7 +1527,7 @@ def list_tasks( """ # 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([parent]) if request is not None and has_flattened_params: @@ -1603,7 +1603,7 @@ def get_task( A unit of scheduled work. """ # 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: @@ -1726,7 +1726,7 @@ def create_task( A unit of scheduled work. """ # 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([parent, task]) if request is not None and has_flattened_params: @@ -1797,7 +1797,7 @@ def delete_task( 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: @@ -1892,7 +1892,7 @@ def run_task( A unit of scheduled work. """ # 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: diff --git a/google/cloud/tasks_v2/services/cloud_tasks/transports/grpc.py b/google/cloud/tasks_v2/services/cloud_tasks/transports/grpc.py index 47efb962..6cb898fb 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/transports/grpc.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/transports/grpc.py @@ -166,8 +166,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, diff --git a/google/cloud/tasks_v2/services/cloud_tasks/transports/grpc_asyncio.py b/google/cloud/tasks_v2/services/cloud_tasks/transports/grpc_asyncio.py index 8a25d355..976507b1 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/transports/grpc_asyncio.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/transports/grpc_asyncio.py @@ -211,8 +211,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, diff --git a/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py b/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py index 37bfc3dc..352d6961 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py @@ -249,7 +249,7 @@ async def list_queues( """ # 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([parent]) if request is not None and has_flattened_params: @@ -340,7 +340,7 @@ async def get_queue( """ # 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: @@ -450,7 +450,7 @@ async def create_queue( """ # 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([parent, queue]) if request is not None and has_flattened_params: @@ -559,7 +559,7 @@ async def update_queue( """ # 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([queue, update_mask]) if request is not None and has_flattened_params: @@ -639,7 +639,7 @@ async def delete_queue( 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: @@ -728,7 +728,7 @@ async def purge_queue( """ # 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: @@ -810,7 +810,7 @@ async def pause_queue( """ # 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: @@ -899,7 +899,7 @@ async def resume_queue( """ # 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: @@ -1033,7 +1033,7 @@ async def get_iam_policy( """ # 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([resource]) if request is not None and has_flattened_params: @@ -1181,7 +1181,7 @@ async def set_iam_policy( """ # 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([resource]) if request is not None and has_flattened_params: @@ -1270,7 +1270,7 @@ async def test_iam_permissions( Response message for TestIamPermissions method. """ # 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([resource, permissions]) if request is not None and has_flattened_params: @@ -1366,7 +1366,7 @@ async def list_tasks( """ # 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([parent]) if request is not None and has_flattened_params: @@ -1452,7 +1452,7 @@ async def get_task( A unit of scheduled work. """ # 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: @@ -1589,7 +1589,7 @@ async def create_task( A unit of scheduled work. """ # 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([parent, task]) if request is not None and has_flattened_params: @@ -1660,7 +1660,7 @@ async def delete_task( 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: @@ -1795,7 +1795,7 @@ async def lease_tasks( """ # 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([parent, lease_duration]) if request is not None and has_flattened_params: @@ -1892,7 +1892,7 @@ async def acknowledge_task( 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, schedule_time]) if request is not None and has_flattened_params: @@ -1994,7 +1994,7 @@ async def renew_lease( A unit of scheduled work. """ # 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, schedule_time, lease_duration]) if request is not None and has_flattened_params: @@ -2090,7 +2090,7 @@ async def cancel_lease( A unit of scheduled work. """ # 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, schedule_time]) if request is not None and has_flattened_params: @@ -2194,7 +2194,7 @@ async def run_task( A unit of scheduled work. """ # 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: diff --git a/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py b/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py index 4e01ee2f..56be043d 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py @@ -464,7 +464,7 @@ def list_queues( """ # 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([parent]) if request is not None and has_flattened_params: @@ -545,7 +545,7 @@ def get_queue( """ # 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: @@ -645,7 +645,7 @@ def create_queue( """ # 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([parent, queue]) if request is not None and has_flattened_params: @@ -754,7 +754,7 @@ def update_queue( """ # 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([queue, update_mask]) if request is not None and has_flattened_params: @@ -834,7 +834,7 @@ def delete_queue( 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: @@ -913,7 +913,7 @@ def purge_queue( """ # 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: @@ -995,7 +995,7 @@ def pause_queue( """ # 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: @@ -1084,7 +1084,7 @@ def resume_queue( """ # 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: @@ -1218,7 +1218,7 @@ def get_iam_policy( """ # 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([resource]) if request is not None and has_flattened_params: @@ -1355,7 +1355,7 @@ def set_iam_policy( """ # 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([resource]) if request is not None and has_flattened_params: @@ -1443,7 +1443,7 @@ def test_iam_permissions( Response message for TestIamPermissions method. """ # 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([resource, permissions]) if request is not None and has_flattened_params: @@ -1528,7 +1528,7 @@ def list_tasks( """ # 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([parent]) if request is not None and has_flattened_params: @@ -1604,7 +1604,7 @@ def get_task( A unit of scheduled work. """ # 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: @@ -1731,7 +1731,7 @@ def create_task( A unit of scheduled work. """ # 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([parent, task]) if request is not None and has_flattened_params: @@ -1802,7 +1802,7 @@ def delete_task( 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: @@ -1927,7 +1927,7 @@ def lease_tasks( """ # 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([parent, lease_duration]) if request is not None and has_flattened_params: @@ -2024,7 +2024,7 @@ def acknowledge_task( 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, schedule_time]) if request is not None and has_flattened_params: @@ -2126,7 +2126,7 @@ def renew_lease( A unit of scheduled work. """ # 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, schedule_time, lease_duration]) if request is not None and has_flattened_params: @@ -2222,7 +2222,7 @@ def cancel_lease( A unit of scheduled work. """ # 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, schedule_time]) if request is not None and has_flattened_params: @@ -2326,7 +2326,7 @@ def run_task( A unit of scheduled work. """ # 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: diff --git a/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/grpc.py b/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/grpc.py index a5b58157..2f5af17a 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/grpc.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/grpc.py @@ -166,8 +166,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, diff --git a/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/grpc_asyncio.py b/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/grpc_asyncio.py index c58456b2..27513cd4 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/grpc_asyncio.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/grpc_asyncio.py @@ -211,8 +211,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, diff --git a/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py b/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py index 092513f1..1264f9be 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py @@ -249,7 +249,7 @@ async def list_queues( """ # 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([parent]) if request is not None and has_flattened_params: @@ -340,7 +340,7 @@ async def get_queue( """ # 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: @@ -450,7 +450,7 @@ async def create_queue( """ # 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([parent, queue]) if request is not None and has_flattened_params: @@ -559,7 +559,7 @@ async def update_queue( """ # 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([queue, update_mask]) if request is not None and has_flattened_params: @@ -639,7 +639,7 @@ async def delete_queue( 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: @@ -728,7 +728,7 @@ async def purge_queue( """ # 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: @@ -810,7 +810,7 @@ async def pause_queue( """ # 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: @@ -899,7 +899,7 @@ async def resume_queue( """ # 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: @@ -1033,7 +1033,7 @@ async def get_iam_policy( """ # 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([resource]) if request is not None and has_flattened_params: @@ -1181,7 +1181,7 @@ async def set_iam_policy( """ # 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([resource]) if request is not None and has_flattened_params: @@ -1270,7 +1270,7 @@ async def test_iam_permissions( Response message for TestIamPermissions method. """ # 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([resource, permissions]) if request is not None and has_flattened_params: @@ -1366,7 +1366,7 @@ async def list_tasks( """ # 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([parent]) if request is not None and has_flattened_params: @@ -1452,7 +1452,7 @@ async def get_task( A unit of scheduled work. """ # 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: @@ -1585,7 +1585,7 @@ async def create_task( A unit of scheduled work. """ # 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([parent, task]) if request is not None and has_flattened_params: @@ -1656,7 +1656,7 @@ async def delete_task( 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: @@ -1762,7 +1762,7 @@ async def run_task( A unit of scheduled work. """ # 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: diff --git a/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py b/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py index 36daacee..076a6c2d 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py @@ -464,7 +464,7 @@ def list_queues( """ # 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([parent]) if request is not None and has_flattened_params: @@ -545,7 +545,7 @@ def get_queue( """ # 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: @@ -645,7 +645,7 @@ def create_queue( """ # 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([parent, queue]) if request is not None and has_flattened_params: @@ -754,7 +754,7 @@ def update_queue( """ # 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([queue, update_mask]) if request is not None and has_flattened_params: @@ -834,7 +834,7 @@ def delete_queue( 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: @@ -913,7 +913,7 @@ def purge_queue( """ # 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: @@ -995,7 +995,7 @@ def pause_queue( """ # 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: @@ -1084,7 +1084,7 @@ def resume_queue( """ # 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: @@ -1218,7 +1218,7 @@ def get_iam_policy( """ # 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([resource]) if request is not None and has_flattened_params: @@ -1355,7 +1355,7 @@ def set_iam_policy( """ # 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([resource]) if request is not None and has_flattened_params: @@ -1443,7 +1443,7 @@ def test_iam_permissions( Response message for TestIamPermissions method. """ # 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([resource, permissions]) if request is not None and has_flattened_params: @@ -1528,7 +1528,7 @@ def list_tasks( """ # 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([parent]) if request is not None and has_flattened_params: @@ -1604,7 +1604,7 @@ def get_task( A unit of scheduled work. """ # 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: @@ -1727,7 +1727,7 @@ def create_task( A unit of scheduled work. """ # 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([parent, task]) if request is not None and has_flattened_params: @@ -1798,7 +1798,7 @@ def delete_task( 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: @@ -1894,7 +1894,7 @@ def run_task( A unit of scheduled work. """ # 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: diff --git a/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/grpc.py b/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/grpc.py index 3f0bb485..550340d8 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/grpc.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/grpc.py @@ -166,8 +166,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, diff --git a/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/grpc_asyncio.py b/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/grpc_asyncio.py index faad7554..44bf7fd3 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/grpc_asyncio.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/grpc_asyncio.py @@ -211,8 +211,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, diff --git a/tests/unit/gapic/tasks_v2/test_cloud_tasks.py b/tests/unit/gapic/tasks_v2/test_cloud_tasks.py index db776e3d..11c0444e 100644 --- a/tests/unit/gapic/tasks_v2/test_cloud_tasks.py +++ b/tests/unit/gapic/tasks_v2/test_cloud_tasks.py @@ -507,21 +507,23 @@ def test_cloud_tasks_client_client_options_scopes( @pytest.mark.parametrize( - "client_class,transport_class,transport_name", + "client_class,transport_class,transport_name,grpc_helpers", [ - (CloudTasksClient, transports.CloudTasksGrpcTransport, "grpc"), + (CloudTasksClient, transports.CloudTasksGrpcTransport, "grpc", grpc_helpers), ( CloudTasksAsyncClient, transports.CloudTasksGrpcAsyncIOTransport, "grpc_asyncio", + grpc_helpers_async, ), ], ) def test_cloud_tasks_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(client_options=options, transport=transport_name) @@ -555,6 +557,67 @@ def test_cloud_tasks_client_client_options_from_dict(): ) +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + (CloudTasksClient, transports.CloudTasksGrpcTransport, "grpc", grpc_helpers), + ( + CloudTasksAsyncClient, + transports.CloudTasksGrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ], +) +def test_cloud_tasks_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( + "cloudtasks.googleapis.com:443", + credentials=file_creds, + credentials_file=None, + quota_project_id=None, + default_scopes=("https://www.googleapis.com/auth/cloud-platform",), + scopes=None, + default_host="cloudtasks.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + @pytest.mark.parametrize("request_type", [cloudtasks.ListQueuesRequest, dict,]) def test_list_queues(request_type, transport: str = "grpc"): client = CloudTasksClient( diff --git a/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py b/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py index 3785a4b0..00fe29be 100644 --- a/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py +++ b/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py @@ -507,21 +507,23 @@ def test_cloud_tasks_client_client_options_scopes( @pytest.mark.parametrize( - "client_class,transport_class,transport_name", + "client_class,transport_class,transport_name,grpc_helpers", [ - (CloudTasksClient, transports.CloudTasksGrpcTransport, "grpc"), + (CloudTasksClient, transports.CloudTasksGrpcTransport, "grpc", grpc_helpers), ( CloudTasksAsyncClient, transports.CloudTasksGrpcAsyncIOTransport, "grpc_asyncio", + grpc_helpers_async, ), ], ) def test_cloud_tasks_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(client_options=options, transport=transport_name) @@ -555,6 +557,67 @@ def test_cloud_tasks_client_client_options_from_dict(): ) +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + (CloudTasksClient, transports.CloudTasksGrpcTransport, "grpc", grpc_helpers), + ( + CloudTasksAsyncClient, + transports.CloudTasksGrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ], +) +def test_cloud_tasks_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( + "cloudtasks.googleapis.com:443", + credentials=file_creds, + credentials_file=None, + quota_project_id=None, + default_scopes=("https://www.googleapis.com/auth/cloud-platform",), + scopes=None, + default_host="cloudtasks.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + @pytest.mark.parametrize("request_type", [cloudtasks.ListQueuesRequest, dict,]) def test_list_queues(request_type, transport: str = "grpc"): client = CloudTasksClient( diff --git a/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py b/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py index 7ea9efa0..ca3d61ce 100644 --- a/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py +++ b/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py @@ -507,21 +507,23 @@ def test_cloud_tasks_client_client_options_scopes( @pytest.mark.parametrize( - "client_class,transport_class,transport_name", + "client_class,transport_class,transport_name,grpc_helpers", [ - (CloudTasksClient, transports.CloudTasksGrpcTransport, "grpc"), + (CloudTasksClient, transports.CloudTasksGrpcTransport, "grpc", grpc_helpers), ( CloudTasksAsyncClient, transports.CloudTasksGrpcAsyncIOTransport, "grpc_asyncio", + grpc_helpers_async, ), ], ) def test_cloud_tasks_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(client_options=options, transport=transport_name) @@ -555,6 +557,67 @@ def test_cloud_tasks_client_client_options_from_dict(): ) +@pytest.mark.parametrize( + "client_class,transport_class,transport_name,grpc_helpers", + [ + (CloudTasksClient, transports.CloudTasksGrpcTransport, "grpc", grpc_helpers), + ( + CloudTasksAsyncClient, + transports.CloudTasksGrpcAsyncIOTransport, + "grpc_asyncio", + grpc_helpers_async, + ), + ], +) +def test_cloud_tasks_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( + "cloudtasks.googleapis.com:443", + credentials=file_creds, + credentials_file=None, + quota_project_id=None, + default_scopes=("https://www.googleapis.com/auth/cloud-platform",), + scopes=None, + default_host="cloudtasks.googleapis.com", + ssl_credentials=None, + options=[ + ("grpc.max_send_message_length", -1), + ("grpc.max_receive_message_length", -1), + ], + ) + + @pytest.mark.parametrize("request_type", [cloudtasks.ListQueuesRequest, dict,]) def test_list_queues(request_type, transport: str = "grpc"): client = CloudTasksClient( From 6aee785982e25bced911bc6902a0e88f92b4d742 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 7 Feb 2022 17:15:31 +0100 Subject: [PATCH 11/14] chore(deps): update dependency pytest to v7 (#219) --- samples/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/requirements-test.txt b/samples/snippets/requirements-test.txt index 92709451..4a46ff60 100644 --- a/samples/snippets/requirements-test.txt +++ b/samples/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==6.2.5 +pytest==7.0.0 From 49d6d870c339fd4cd83f5b33922c06f1db00a75c Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 11 Feb 2022 15:33:37 -0700 Subject: [PATCH 12/14] chore: use gapic-generator-python 0.63.2 (#220) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use gapic-generator-python 0.63.2 docs: add generated snippets PiperOrigin-RevId: 427792504 Source-Link: https://github.com/googleapis/googleapis/commit/55b9e1e0b3106c850d13958352bc0751147b6b15 Source-Link: https://github.com/googleapis/googleapis-gen/commit/bf4e86b753f42cb0edb1fd51fbe840d7da0a1cde Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYmY0ZTg2Yjc1M2Y0MmNiMGVkYjFmZDUxZmJlODQwZDdkYTBhMWNkZSJ9 * 🦉 Updates from OwlBot See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot --- .../services/cloud_tasks/async_client.py | 314 +++ .../tasks_v2/services/cloud_tasks/client.py | 330 +++ .../services/cloud_tasks/async_client.py | 391 ++++ .../services/cloud_tasks/client.py | 411 ++++ .../services/cloud_tasks/async_client.py | 314 +++ .../services/cloud_tasks/client.py | 330 +++ ...tasks_v2_cloud_tasks_create_queue_async.py | 45 + ..._tasks_v2_cloud_tasks_create_queue_sync.py | 45 + ..._tasks_v2_cloud_tasks_create_task_async.py | 45 + ...d_tasks_v2_cloud_tasks_create_task_sync.py | 45 + ...tasks_v2_cloud_tasks_delete_queue_async.py | 43 + ..._tasks_v2_cloud_tasks_delete_queue_sync.py | 43 + ..._tasks_v2_cloud_tasks_delete_task_async.py | 43 + ...d_tasks_v2_cloud_tasks_delete_task_sync.py | 43 + ...sks_v2_cloud_tasks_get_iam_policy_async.py | 45 + ...asks_v2_cloud_tasks_get_iam_policy_sync.py | 45 + ...ed_tasks_v2_cloud_tasks_get_queue_async.py | 45 + ...ted_tasks_v2_cloud_tasks_get_queue_sync.py | 45 + ...ted_tasks_v2_cloud_tasks_get_task_async.py | 45 + ...ated_tasks_v2_cloud_tasks_get_task_sync.py | 45 + ..._tasks_v2_cloud_tasks_list_queues_async.py | 46 + ...d_tasks_v2_cloud_tasks_list_queues_sync.py | 46 + ...d_tasks_v2_cloud_tasks_list_tasks_async.py | 46 + ...ed_tasks_v2_cloud_tasks_list_tasks_sync.py | 46 + ..._tasks_v2_cloud_tasks_pause_queue_async.py | 45 + ...d_tasks_v2_cloud_tasks_pause_queue_sync.py | 45 + ..._tasks_v2_cloud_tasks_purge_queue_async.py | 45 + ...d_tasks_v2_cloud_tasks_purge_queue_sync.py | 45 + ...tasks_v2_cloud_tasks_resume_queue_async.py | 45 + ..._tasks_v2_cloud_tasks_resume_queue_sync.py | 45 + ...ted_tasks_v2_cloud_tasks_run_task_async.py | 45 + ...ated_tasks_v2_cloud_tasks_run_task_sync.py | 45 + ...sks_v2_cloud_tasks_set_iam_policy_async.py | 45 + ...asks_v2_cloud_tasks_set_iam_policy_sync.py | 45 + ..._cloud_tasks_test_iam_permissions_async.py | 46 + ...2_cloud_tasks_test_iam_permissions_sync.py | 46 + ...tasks_v2_cloud_tasks_update_queue_async.py | 44 + ..._tasks_v2_cloud_tasks_update_queue_sync.py | 44 + ...eta2_cloud_tasks_acknowledge_task_async.py | 43 + ...beta2_cloud_tasks_acknowledge_task_sync.py | 43 + ..._v2beta2_cloud_tasks_cancel_lease_async.py | 45 + ...s_v2beta2_cloud_tasks_cancel_lease_sync.py | 45 + ..._v2beta2_cloud_tasks_create_queue_async.py | 45 + ...s_v2beta2_cloud_tasks_create_queue_sync.py | 45 + ...s_v2beta2_cloud_tasks_create_task_async.py | 45 + ...ks_v2beta2_cloud_tasks_create_task_sync.py | 45 + ..._v2beta2_cloud_tasks_delete_queue_async.py | 43 + ...s_v2beta2_cloud_tasks_delete_queue_sync.py | 43 + ...s_v2beta2_cloud_tasks_delete_task_async.py | 43 + ...ks_v2beta2_cloud_tasks_delete_task_sync.py | 43 + ...2beta2_cloud_tasks_get_iam_policy_async.py | 45 + ...v2beta2_cloud_tasks_get_iam_policy_sync.py | 45 + ...sks_v2beta2_cloud_tasks_get_queue_async.py | 45 + ...asks_v2beta2_cloud_tasks_get_queue_sync.py | 45 + ...asks_v2beta2_cloud_tasks_get_task_async.py | 45 + ...tasks_v2beta2_cloud_tasks_get_task_sync.py | 45 + ...s_v2beta2_cloud_tasks_lease_tasks_async.py | 45 + ...ks_v2beta2_cloud_tasks_lease_tasks_sync.py | 45 + ...s_v2beta2_cloud_tasks_list_queues_async.py | 46 + ...ks_v2beta2_cloud_tasks_list_queues_sync.py | 46 + ...ks_v2beta2_cloud_tasks_list_tasks_async.py | 46 + ...sks_v2beta2_cloud_tasks_list_tasks_sync.py | 46 + ...s_v2beta2_cloud_tasks_pause_queue_async.py | 45 + ...ks_v2beta2_cloud_tasks_pause_queue_sync.py | 45 + ...s_v2beta2_cloud_tasks_purge_queue_async.py | 45 + ...ks_v2beta2_cloud_tasks_purge_queue_sync.py | 45 + ...s_v2beta2_cloud_tasks_renew_lease_async.py | 45 + ...ks_v2beta2_cloud_tasks_renew_lease_sync.py | 45 + ..._v2beta2_cloud_tasks_resume_queue_async.py | 45 + ...s_v2beta2_cloud_tasks_resume_queue_sync.py | 45 + ...asks_v2beta2_cloud_tasks_run_task_async.py | 45 + ...tasks_v2beta2_cloud_tasks_run_task_sync.py | 45 + ...2beta2_cloud_tasks_set_iam_policy_async.py | 45 + ...v2beta2_cloud_tasks_set_iam_policy_sync.py | 45 + ..._cloud_tasks_test_iam_permissions_async.py | 46 + ...2_cloud_tasks_test_iam_permissions_sync.py | 46 + ..._v2beta2_cloud_tasks_update_queue_async.py | 44 + ...s_v2beta2_cloud_tasks_update_queue_sync.py | 44 + ..._v2beta3_cloud_tasks_create_queue_async.py | 45 + ...s_v2beta3_cloud_tasks_create_queue_sync.py | 45 + ...s_v2beta3_cloud_tasks_create_task_async.py | 45 + ...ks_v2beta3_cloud_tasks_create_task_sync.py | 45 + ..._v2beta3_cloud_tasks_delete_queue_async.py | 43 + ...s_v2beta3_cloud_tasks_delete_queue_sync.py | 43 + ...s_v2beta3_cloud_tasks_delete_task_async.py | 43 + ...ks_v2beta3_cloud_tasks_delete_task_sync.py | 43 + ...2beta3_cloud_tasks_get_iam_policy_async.py | 45 + ...v2beta3_cloud_tasks_get_iam_policy_sync.py | 45 + ...sks_v2beta3_cloud_tasks_get_queue_async.py | 45 + ...asks_v2beta3_cloud_tasks_get_queue_sync.py | 45 + ...asks_v2beta3_cloud_tasks_get_task_async.py | 45 + ...tasks_v2beta3_cloud_tasks_get_task_sync.py | 45 + ...s_v2beta3_cloud_tasks_list_queues_async.py | 46 + ...ks_v2beta3_cloud_tasks_list_queues_sync.py | 46 + ...ks_v2beta3_cloud_tasks_list_tasks_async.py | 46 + ...sks_v2beta3_cloud_tasks_list_tasks_sync.py | 46 + ...s_v2beta3_cloud_tasks_pause_queue_async.py | 45 + ...ks_v2beta3_cloud_tasks_pause_queue_sync.py | 45 + ...s_v2beta3_cloud_tasks_purge_queue_async.py | 45 + ...ks_v2beta3_cloud_tasks_purge_queue_sync.py | 45 + ..._v2beta3_cloud_tasks_resume_queue_async.py | 45 + ...s_v2beta3_cloud_tasks_resume_queue_sync.py | 45 + ...asks_v2beta3_cloud_tasks_run_task_async.py | 45 + ...tasks_v2beta3_cloud_tasks_run_task_sync.py | 45 + ...2beta3_cloud_tasks_set_iam_policy_async.py | 45 + ...v2beta3_cloud_tasks_set_iam_policy_sync.py | 45 + ..._cloud_tasks_test_iam_permissions_async.py | 46 + ...3_cloud_tasks_test_iam_permissions_sync.py | 46 + ..._v2beta3_cloud_tasks_update_queue_async.py | 44 + ...s_v2beta3_cloud_tasks_update_queue_sync.py | 44 + .../snippet_metadata_tasks_v2.json | 1420 +++++++++++++ .../snippet_metadata_tasks_v2beta2.json | 1772 +++++++++++++++++ .../snippet_metadata_tasks_v2beta3.json | 1420 +++++++++++++ 113 files changed, 11366 insertions(+) create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_create_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_create_queue_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_create_task_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_create_task_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_delete_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_delete_queue_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_delete_task_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_delete_task_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_iam_policy_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_iam_policy_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_queue_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_task_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_task_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_list_queues_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_list_queues_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_list_tasks_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_list_tasks_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_pause_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_pause_queue_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_purge_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_purge_queue_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_resume_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_resume_queue_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_run_task_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_run_task_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_set_iam_policy_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_set_iam_policy_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_test_iam_permissions_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_test_iam_permissions_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_update_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_update_queue_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_acknowledge_task_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_acknowledge_task_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_cancel_lease_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_cancel_lease_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_create_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_create_queue_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_create_task_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_create_task_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_delete_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_delete_queue_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_delete_task_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_delete_task_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_iam_policy_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_iam_policy_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_queue_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_task_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_task_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_lease_tasks_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_lease_tasks_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_list_queues_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_list_queues_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_list_tasks_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_list_tasks_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_pause_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_pause_queue_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_purge_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_purge_queue_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_renew_lease_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_renew_lease_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_resume_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_resume_queue_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_run_task_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_run_task_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_set_iam_policy_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_set_iam_policy_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_test_iam_permissions_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_test_iam_permissions_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_update_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_update_queue_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_create_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_create_queue_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_create_task_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_create_task_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_delete_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_delete_queue_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_delete_task_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_delete_task_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_iam_policy_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_iam_policy_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_queue_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_task_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_task_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_list_queues_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_list_queues_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_list_tasks_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_list_tasks_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_pause_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_pause_queue_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_purge_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_purge_queue_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_resume_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_resume_queue_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_run_task_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_run_task_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_set_iam_policy_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_set_iam_policy_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_test_iam_permissions_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_test_iam_permissions_sync.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_update_queue_async.py create mode 100644 samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_update_queue_sync.py create mode 100644 samples/generated_samples/snippet_metadata_tasks_v2.json create mode 100644 samples/generated_samples/snippet_metadata_tasks_v2beta2.json create mode 100644 samples/generated_samples/snippet_metadata_tasks_v2beta3.json diff --git a/google/cloud/tasks_v2/services/cloud_tasks/async_client.py b/google/cloud/tasks_v2/services/cloud_tasks/async_client.py index 5661a066..ee93b143 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/async_client.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/async_client.py @@ -222,6 +222,27 @@ async def list_queues( r"""Lists queues. Queues are returned in lexicographical order. + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_list_queues(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.ListQueuesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_queues(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.tasks_v2.types.ListQueuesRequest, dict]): The request object. Request message for @@ -312,6 +333,25 @@ async def get_queue( ) -> queue.Queue: r"""Gets a queue. + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_get_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.GetQueueRequest( + name="name_value", + ) + + # Make the request + response = client.get_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2.types.GetQueueRequest, dict]): The request object. Request message for @@ -408,6 +448,26 @@ async def create_queue( queue.yaml `__ before using this method. + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_create_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.CreateQueueRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2.types.CreateQueueRequest, dict]): The request object. Request message for @@ -513,6 +573,25 @@ async def update_queue( queue.yaml `__ before using this method. + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_update_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.UpdateQueueRequest( + ) + + # Make the request + response = client.update_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2.types.UpdateQueueRequest, dict]): The request object. Request message for @@ -620,6 +699,23 @@ async def delete_queue( queue.yaml `__ before using this method. + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_delete_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.DeleteQueueRequest( + name="name_value", + ) + + # Make the request + client.delete_queue(request=request) + Args: request (Union[google.cloud.tasks_v2.types.DeleteQueueRequest, dict]): The request object. Request message for @@ -699,6 +795,26 @@ async def purge_queue( effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible. + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_purge_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.PurgeQueueRequest( + name="name_value", + ) + + # Make the request + response = client.purge_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2.types.PurgeQueueRequest, dict]): The request object. Request message for @@ -781,6 +897,26 @@ async def pause_queue( paused if its [state][google.cloud.tasks.v2.Queue.state] is [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED]. + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_pause_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.PauseQueueRequest( + name="name_value", + ) + + # Make the request + response = client.pause_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2.types.PauseQueueRequest, dict]): The request object. Request message for @@ -870,6 +1006,26 @@ async def resume_queue( Scaling Risks `__. + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_resume_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.ResumeQueueRequest( + name="name_value", + ) + + # Make the request + response = client.resume_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2.types.ResumeQueueRequest, dict]): The request object. Request message for @@ -953,6 +1109,26 @@ async def get_iam_policy( - ``cloudtasks.queues.getIamPolicy`` + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_get_iam_policy(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]): The request object. Request message for `GetIamPolicy` @@ -1101,6 +1277,26 @@ async def set_iam_policy( - ``cloudtasks.queues.setIamPolicy`` + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_set_iam_policy(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]): The request object. Request message for `SetIamPolicy` @@ -1236,6 +1432,27 @@ async def test_iam_permissions( authorization checking. This operation may "fail open" without warning. + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_test_iam_permissions(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value_1', 'permissions_value_2'], + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]): The request object. Request message for @@ -1337,6 +1554,27 @@ async def list_tasks( The tasks may be returned in any order. The ordering may change at any time. + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_list_tasks(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.ListTasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tasks(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.tasks_v2.types.ListTasksRequest, dict]): The request object. Request message for listing tasks @@ -1428,6 +1666,25 @@ async def get_task( ) -> task.Task: r"""Gets a task. + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_get_task(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.GetTaskRequest( + name="name_value", + ) + + # Make the request + response = client.get_task(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2.types.GetTaskRequest, dict]): The request object. Request message for getting a task @@ -1514,6 +1771,26 @@ async def create_task( - The maximum task size is 100KB. + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_create_task(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.CreateTaskRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_task(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2.types.CreateTaskRequest, dict]): The request object. Request message for @@ -1636,6 +1913,23 @@ async def delete_task( A task cannot be deleted if it has executed successfully or permanently failed. + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_delete_task(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.DeleteTaskRequest( + name="name_value", + ) + + # Make the request + client.delete_task(request=request) + Args: request (Union[google.cloud.tasks_v2.types.DeleteTaskRequest, dict]): The request object. Request message for deleting a task @@ -1737,6 +2031,26 @@ async def run_task( [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a task that has already succeeded or permanently failed. + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_run_task(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.RunTaskRequest( + name="name_value", + ) + + # Make the request + response = client.run_task(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2.types.RunTaskRequest, dict]): The request object. Request message for forcing a task diff --git a/google/cloud/tasks_v2/services/cloud_tasks/client.py b/google/cloud/tasks_v2/services/cloud_tasks/client.py index 7da4f4d2..0343d21a 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/client.py @@ -437,6 +437,28 @@ def list_queues( r"""Lists queues. Queues are returned in lexicographical order. + + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_list_queues(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.ListQueuesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_queues(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.tasks_v2.types.ListQueuesRequest, dict]): The request object. Request message for @@ -517,6 +539,26 @@ def get_queue( ) -> queue.Queue: r"""Gets a queue. + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_get_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.GetQueueRequest( + name="name_value", + ) + + # Make the request + response = client.get_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2.types.GetQueueRequest, dict]): The request object. Request message for @@ -603,6 +645,27 @@ def create_queue( queue.yaml `__ before using this method. + + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_create_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.CreateQueueRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2.types.CreateQueueRequest, dict]): The request object. Request message for @@ -708,6 +771,26 @@ def update_queue( queue.yaml `__ before using this method. + + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_update_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.UpdateQueueRequest( + ) + + # Make the request + response = client.update_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2.types.UpdateQueueRequest, dict]): The request object. Request message for @@ -815,6 +898,24 @@ def delete_queue( queue.yaml `__ before using this method. + + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_delete_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.DeleteQueueRequest( + name="name_value", + ) + + # Make the request + client.delete_queue(request=request) + Args: request (Union[google.cloud.tasks_v2.types.DeleteQueueRequest, dict]): The request object. Request message for @@ -884,6 +985,27 @@ def purge_queue( effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible. + + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_purge_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.PurgeQueueRequest( + name="name_value", + ) + + # Make the request + response = client.purge_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2.types.PurgeQueueRequest, dict]): The request object. Request message for @@ -966,6 +1088,27 @@ def pause_queue( paused if its [state][google.cloud.tasks.v2.Queue.state] is [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED]. + + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_pause_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.PauseQueueRequest( + name="name_value", + ) + + # Make the request + response = client.pause_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2.types.PauseQueueRequest, dict]): The request object. Request message for @@ -1055,6 +1198,27 @@ def resume_queue( Scaling Risks `__. + + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_resume_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.ResumeQueueRequest( + name="name_value", + ) + + # Make the request + response = client.resume_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2.types.ResumeQueueRequest, dict]): The request object. Request message for @@ -1138,6 +1302,27 @@ def get_iam_policy( - ``cloudtasks.queues.getIamPolicy`` + + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_get_iam_policy(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]): The request object. Request message for `GetIamPolicy` @@ -1275,6 +1460,27 @@ def set_iam_policy( - ``cloudtasks.queues.setIamPolicy`` + + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_set_iam_policy(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]): The request object. Request message for `SetIamPolicy` @@ -1409,6 +1615,28 @@ def test_iam_permissions( authorization checking. This operation may "fail open" without warning. + + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_test_iam_permissions(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value_1', 'permissions_value_2'], + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]): The request object. Request message for @@ -1499,6 +1727,28 @@ def list_tasks( The tasks may be returned in any order. The ordering may change at any time. + + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_list_tasks(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.ListTasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tasks(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.tasks_v2.types.ListTasksRequest, dict]): The request object. Request message for listing tasks @@ -1580,6 +1830,26 @@ def get_task( ) -> task.Task: r"""Gets a task. + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_get_task(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.GetTaskRequest( + name="name_value", + ) + + # Make the request + response = client.get_task(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2.types.GetTaskRequest, dict]): The request object. Request message for getting a task @@ -1656,6 +1926,27 @@ def create_task( - The maximum task size is 100KB. + + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_create_task(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.CreateTaskRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_task(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2.types.CreateTaskRequest, dict]): The request object. Request message for @@ -1778,6 +2069,24 @@ def delete_task( A task cannot be deleted if it has executed successfully or permanently failed. + + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_delete_task(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.DeleteTaskRequest( + name="name_value", + ) + + # Make the request + client.delete_task(request=request) + Args: request (Union[google.cloud.tasks_v2.types.DeleteTaskRequest, dict]): The request object. Request message for deleting a task @@ -1869,6 +2178,27 @@ def run_task( [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a task that has already succeeded or permanently failed. + + + .. code-block:: + + from google.cloud import tasks_v2 + + def sample_run_task(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.RunTaskRequest( + name="name_value", + ) + + # Make the request + response = client.run_task(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2.types.RunTaskRequest, dict]): The request object. Request message for forcing a task diff --git a/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py b/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py index 352d6961..7afbc95b 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py @@ -222,6 +222,27 @@ async def list_queues( r"""Lists queues. Queues are returned in lexicographical order. + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_list_queues(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.ListQueuesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_queues(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.ListQueuesRequest, dict]): The request object. Request message for @@ -312,6 +333,25 @@ async def get_queue( ) -> queue.Queue: r"""Gets a queue. + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_get_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.GetQueueRequest( + name="name_value", + ) + + # Make the request + response = client.get_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.GetQueueRequest, dict]): The request object. Request message for @@ -408,6 +448,26 @@ async def create_queue( queue.yaml `__ before using this method. + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_create_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.CreateQueueRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.CreateQueueRequest, dict]): The request object. Request message for @@ -513,6 +573,25 @@ async def update_queue( queue.yaml `__ before using this method. + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_update_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.UpdateQueueRequest( + ) + + # Make the request + response = client.update_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.UpdateQueueRequest, dict]): The request object. Request message for @@ -621,6 +700,23 @@ async def delete_queue( queue.yaml `__ before using this method. + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_delete_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.DeleteQueueRequest( + name="name_value", + ) + + # Make the request + client.delete_queue(request=request) + Args: request (Union[google.cloud.tasks_v2beta2.types.DeleteQueueRequest, dict]): The request object. Request message for @@ -700,6 +796,26 @@ async def purge_queue( effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible. + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_purge_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.PurgeQueueRequest( + name="name_value", + ) + + # Make the request + response = client.purge_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.PurgeQueueRequest, dict]): The request object. Request message for @@ -782,6 +898,26 @@ async def pause_queue( paused if its [state][google.cloud.tasks.v2beta2.Queue.state] is [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED]. + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_pause_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.PauseQueueRequest( + name="name_value", + ) + + # Make the request + response = client.pause_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.PauseQueueRequest, dict]): The request object. Request message for @@ -871,6 +1007,26 @@ async def resume_queue( Scaling Risks `__. + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_resume_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.ResumeQueueRequest( + name="name_value", + ) + + # Make the request + response = client.resume_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.ResumeQueueRequest, dict]): The request object. Request message for @@ -954,6 +1110,26 @@ async def get_iam_policy( - ``cloudtasks.queues.getIamPolicy`` + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_get_iam_policy(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]): The request object. Request message for `GetIamPolicy` @@ -1102,6 +1278,26 @@ async def set_iam_policy( - ``cloudtasks.queues.setIamPolicy`` + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_set_iam_policy(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]): The request object. Request message for `SetIamPolicy` @@ -1237,6 +1433,27 @@ async def test_iam_permissions( authorization checking. This operation may "fail open" without warning. + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_test_iam_permissions(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value_1', 'permissions_value_2'], + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]): The request object. Request message for @@ -1338,6 +1555,27 @@ async def list_tasks( The tasks may be returned in any order. The ordering may change at any time. + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_list_tasks(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.ListTasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tasks(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.ListTasksRequest, dict]): The request object. Request message for listing tasks @@ -1429,6 +1667,25 @@ async def get_task( ) -> task.Task: r"""Gets a task. + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_get_task(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.GetTaskRequest( + name="name_value", + ) + + # Make the request + response = client.get_task(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.GetTaskRequest, dict]): The request object. Request message for getting a task @@ -1519,6 +1776,26 @@ async def create_task( - For [pull queues][google.cloud.tasks.v2beta2.PullTarget], the maximum task size is 1MB. + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_create_task(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.CreateTaskRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_task(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.CreateTaskRequest, dict]): The request object. Request message for @@ -1641,6 +1918,23 @@ async def delete_task( A task cannot be deleted if it has completed successfully or permanently failed. + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_delete_task(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.DeleteTaskRequest( + name="name_value", + ) + + # Make the request + client.delete_task(request=request) + Args: request (Union[google.cloud.tasks_v2beta2.types.DeleteTaskRequest, dict]): The request object. Request message for deleting a task @@ -1740,6 +2034,26 @@ async def lease_tasks( [max_tasks_dispatched_per_second][google.cloud.tasks.v2beta2.RateLimits.max_tasks_dispatched_per_second] is exceeded. + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_lease_tasks(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.LeaseTasksRequest( + parent="parent_value", + ) + + # Make the request + response = client.lease_tasks(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.LeaseTasksRequest, dict]): The request object. Request message for leasing tasks @@ -1859,6 +2173,23 @@ async def acknowledge_task( [GetTask][google.cloud.tasks.v2beta2.CloudTasks.GetTask], or [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks]. + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_acknowledge_task(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.AcknowledgeTaskRequest( + name="name_value", + ) + + # Make the request + client.acknowledge_task(request=request) + Args: request (Union[google.cloud.tasks_v2beta2.types.AcknowledgeTaskRequest, dict]): The request object. Request message for acknowledging a @@ -1947,6 +2278,26 @@ async def renew_lease( in the task's [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_renew_lease(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.RenewLeaseRequest( + name="name_value", + ) + + # Make the request + response = client.renew_lease(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.RenewLeaseRequest, dict]): The request object. Request message for renewing a lease @@ -2053,6 +2404,26 @@ async def cancel_lease( next caller of [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks]. + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_cancel_lease(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.CancelLeaseRequest( + name="name_value", + ) + + # Make the request + response = client.cancel_lease(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.CancelLeaseRequest, dict]): The request object. Request message for canceling a @@ -2171,6 +2542,26 @@ async def run_task( be called on a [pull task][google.cloud.tasks.v2beta2.PullMessage]. + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_run_task(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.RunTaskRequest( + name="name_value", + ) + + # Make the request + response = client.run_task(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.RunTaskRequest, dict]): The request object. Request message for forcing a task diff --git a/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py b/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py index 56be043d..2a29ebac 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py @@ -437,6 +437,28 @@ def list_queues( r"""Lists queues. Queues are returned in lexicographical order. + + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_list_queues(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.ListQueuesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_queues(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.ListQueuesRequest, dict]): The request object. Request message for @@ -517,6 +539,26 @@ def get_queue( ) -> queue.Queue: r"""Gets a queue. + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_get_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.GetQueueRequest( + name="name_value", + ) + + # Make the request + response = client.get_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.GetQueueRequest, dict]): The request object. Request message for @@ -603,6 +645,27 @@ def create_queue( queue.yaml `__ before using this method. + + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_create_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.CreateQueueRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.CreateQueueRequest, dict]): The request object. Request message for @@ -708,6 +771,26 @@ def update_queue( queue.yaml `__ before using this method. + + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_update_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.UpdateQueueRequest( + ) + + # Make the request + response = client.update_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.UpdateQueueRequest, dict]): The request object. Request message for @@ -816,6 +899,24 @@ def delete_queue( queue.yaml `__ before using this method. + + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_delete_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.DeleteQueueRequest( + name="name_value", + ) + + # Make the request + client.delete_queue(request=request) + Args: request (Union[google.cloud.tasks_v2beta2.types.DeleteQueueRequest, dict]): The request object. Request message for @@ -885,6 +986,27 @@ def purge_queue( effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible. + + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_purge_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.PurgeQueueRequest( + name="name_value", + ) + + # Make the request + response = client.purge_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.PurgeQueueRequest, dict]): The request object. Request message for @@ -967,6 +1089,27 @@ def pause_queue( paused if its [state][google.cloud.tasks.v2beta2.Queue.state] is [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED]. + + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_pause_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.PauseQueueRequest( + name="name_value", + ) + + # Make the request + response = client.pause_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.PauseQueueRequest, dict]): The request object. Request message for @@ -1056,6 +1199,27 @@ def resume_queue( Scaling Risks `__. + + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_resume_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.ResumeQueueRequest( + name="name_value", + ) + + # Make the request + response = client.resume_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.ResumeQueueRequest, dict]): The request object. Request message for @@ -1139,6 +1303,27 @@ def get_iam_policy( - ``cloudtasks.queues.getIamPolicy`` + + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_get_iam_policy(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]): The request object. Request message for `GetIamPolicy` @@ -1276,6 +1461,27 @@ def set_iam_policy( - ``cloudtasks.queues.setIamPolicy`` + + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_set_iam_policy(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]): The request object. Request message for `SetIamPolicy` @@ -1410,6 +1616,28 @@ def test_iam_permissions( authorization checking. This operation may "fail open" without warning. + + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_test_iam_permissions(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value_1', 'permissions_value_2'], + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]): The request object. Request message for @@ -1500,6 +1728,28 @@ def list_tasks( The tasks may be returned in any order. The ordering may change at any time. + + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_list_tasks(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.ListTasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tasks(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.ListTasksRequest, dict]): The request object. Request message for listing tasks @@ -1581,6 +1831,26 @@ def get_task( ) -> task.Task: r"""Gets a task. + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_get_task(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.GetTaskRequest( + name="name_value", + ) + + # Make the request + response = client.get_task(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.GetTaskRequest, dict]): The request object. Request message for getting a task @@ -1661,6 +1931,27 @@ def create_task( - For [pull queues][google.cloud.tasks.v2beta2.PullTarget], the maximum task size is 1MB. + + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_create_task(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.CreateTaskRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_task(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.CreateTaskRequest, dict]): The request object. Request message for @@ -1783,6 +2074,24 @@ def delete_task( A task cannot be deleted if it has completed successfully or permanently failed. + + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_delete_task(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.DeleteTaskRequest( + name="name_value", + ) + + # Make the request + client.delete_task(request=request) + Args: request (Union[google.cloud.tasks_v2beta2.types.DeleteTaskRequest, dict]): The request object. Request message for deleting a task @@ -1872,6 +2181,27 @@ def lease_tasks( [max_tasks_dispatched_per_second][google.cloud.tasks.v2beta2.RateLimits.max_tasks_dispatched_per_second] is exceeded. + + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_lease_tasks(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.LeaseTasksRequest( + parent="parent_value", + ) + + # Make the request + response = client.lease_tasks(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.LeaseTasksRequest, dict]): The request object. Request message for leasing tasks @@ -1991,6 +2321,24 @@ def acknowledge_task( [GetTask][google.cloud.tasks.v2beta2.CloudTasks.GetTask], or [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks]. + + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_acknowledge_task(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.AcknowledgeTaskRequest( + name="name_value", + ) + + # Make the request + client.acknowledge_task(request=request) + Args: request (Union[google.cloud.tasks_v2beta2.types.AcknowledgeTaskRequest, dict]): The request object. Request message for acknowledging a @@ -2079,6 +2427,27 @@ def renew_lease( in the task's [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. + + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_renew_lease(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.RenewLeaseRequest( + name="name_value", + ) + + # Make the request + response = client.renew_lease(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.RenewLeaseRequest, dict]): The request object. Request message for renewing a lease @@ -2185,6 +2554,27 @@ def cancel_lease( next caller of [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks]. + + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_cancel_lease(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.CancelLeaseRequest( + name="name_value", + ) + + # Make the request + response = client.cancel_lease(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.CancelLeaseRequest, dict]): The request object. Request message for canceling a @@ -2303,6 +2693,27 @@ def run_task( be called on a [pull task][google.cloud.tasks.v2beta2.PullMessage]. + + + .. code-block:: + + from google.cloud import tasks_v2beta2 + + def sample_run_task(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.RunTaskRequest( + name="name_value", + ) + + # Make the request + response = client.run_task(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta2.types.RunTaskRequest, dict]): The request object. Request message for forcing a task diff --git a/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py b/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py index 1264f9be..83d42849 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py @@ -222,6 +222,27 @@ async def list_queues( r"""Lists queues. Queues are returned in lexicographical order. + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_list_queues(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.ListQueuesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_queues(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.ListQueuesRequest, dict]): The request object. Request message for @@ -312,6 +333,25 @@ async def get_queue( ) -> queue.Queue: r"""Gets a queue. + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_get_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.GetQueueRequest( + name="name_value", + ) + + # Make the request + response = client.get_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.GetQueueRequest, dict]): The request object. Request message for @@ -408,6 +448,26 @@ async def create_queue( queue.yaml `__ before using this method. + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_create_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.CreateQueueRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.CreateQueueRequest, dict]): The request object. Request message for @@ -513,6 +573,25 @@ async def update_queue( queue.yaml `__ before using this method. + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_update_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.UpdateQueueRequest( + ) + + # Make the request + response = client.update_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.UpdateQueueRequest, dict]): The request object. Request message for @@ -621,6 +700,23 @@ async def delete_queue( queue.yaml `__ before using this method. + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_delete_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.DeleteQueueRequest( + name="name_value", + ) + + # Make the request + client.delete_queue(request=request) + Args: request (Union[google.cloud.tasks_v2beta3.types.DeleteQueueRequest, dict]): The request object. Request message for @@ -700,6 +796,26 @@ async def purge_queue( effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible. + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_purge_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.PurgeQueueRequest( + name="name_value", + ) + + # Make the request + response = client.purge_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.PurgeQueueRequest, dict]): The request object. Request message for @@ -782,6 +898,26 @@ async def pause_queue( paused if its [state][google.cloud.tasks.v2beta3.Queue.state] is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED]. + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_pause_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.PauseQueueRequest( + name="name_value", + ) + + # Make the request + response = client.pause_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.PauseQueueRequest, dict]): The request object. Request message for @@ -871,6 +1007,26 @@ async def resume_queue( Scaling Risks `__. + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_resume_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.ResumeQueueRequest( + name="name_value", + ) + + # Make the request + response = client.resume_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.ResumeQueueRequest, dict]): The request object. Request message for @@ -954,6 +1110,26 @@ async def get_iam_policy( - ``cloudtasks.queues.getIamPolicy`` + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_get_iam_policy(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]): The request object. Request message for `GetIamPolicy` @@ -1102,6 +1278,26 @@ async def set_iam_policy( - ``cloudtasks.queues.setIamPolicy`` + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_set_iam_policy(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]): The request object. Request message for `SetIamPolicy` @@ -1237,6 +1433,27 @@ async def test_iam_permissions( authorization checking. This operation may "fail open" without warning. + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_test_iam_permissions(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value_1', 'permissions_value_2'], + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]): The request object. Request message for @@ -1338,6 +1555,27 @@ async def list_tasks( The tasks may be returned in any order. The ordering may change at any time. + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_list_tasks(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.ListTasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tasks(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.ListTasksRequest, dict]): The request object. Request message for listing tasks @@ -1429,6 +1667,25 @@ async def get_task( ) -> task.Task: r"""Gets a task. + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_get_task(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.GetTaskRequest( + name="name_value", + ) + + # Make the request + response = client.get_task(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.GetTaskRequest, dict]): The request object. Request message for getting a task @@ -1515,6 +1772,26 @@ async def create_task( - The maximum task size is 100KB. + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_create_task(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.CreateTaskRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_task(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.CreateTaskRequest, dict]): The request object. Request message for @@ -1637,6 +1914,23 @@ async def delete_task( A task cannot be deleted if it has executed successfully or permanently failed. + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_delete_task(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.DeleteTaskRequest( + name="name_value", + ) + + # Make the request + client.delete_task(request=request) + Args: request (Union[google.cloud.tasks_v2beta3.types.DeleteTaskRequest, dict]): The request object. Request message for deleting a task @@ -1739,6 +2033,26 @@ async def run_task( [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a task that has already succeeded or permanently failed. + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_run_task(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.RunTaskRequest( + name="name_value", + ) + + # Make the request + response = client.run_task(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.RunTaskRequest, dict]): The request object. Request message for forcing a task diff --git a/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py b/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py index 076a6c2d..b6474ad0 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py @@ -437,6 +437,28 @@ def list_queues( r"""Lists queues. Queues are returned in lexicographical order. + + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_list_queues(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.ListQueuesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_queues(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.ListQueuesRequest, dict]): The request object. Request message for @@ -517,6 +539,26 @@ def get_queue( ) -> queue.Queue: r"""Gets a queue. + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_get_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.GetQueueRequest( + name="name_value", + ) + + # Make the request + response = client.get_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.GetQueueRequest, dict]): The request object. Request message for @@ -603,6 +645,27 @@ def create_queue( queue.yaml `__ before using this method. + + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_create_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.CreateQueueRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.CreateQueueRequest, dict]): The request object. Request message for @@ -708,6 +771,26 @@ def update_queue( queue.yaml `__ before using this method. + + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_update_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.UpdateQueueRequest( + ) + + # Make the request + response = client.update_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.UpdateQueueRequest, dict]): The request object. Request message for @@ -816,6 +899,24 @@ def delete_queue( queue.yaml `__ before using this method. + + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_delete_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.DeleteQueueRequest( + name="name_value", + ) + + # Make the request + client.delete_queue(request=request) + Args: request (Union[google.cloud.tasks_v2beta3.types.DeleteQueueRequest, dict]): The request object. Request message for @@ -885,6 +986,27 @@ def purge_queue( effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible. + + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_purge_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.PurgeQueueRequest( + name="name_value", + ) + + # Make the request + response = client.purge_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.PurgeQueueRequest, dict]): The request object. Request message for @@ -967,6 +1089,27 @@ def pause_queue( paused if its [state][google.cloud.tasks.v2beta3.Queue.state] is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED]. + + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_pause_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.PauseQueueRequest( + name="name_value", + ) + + # Make the request + response = client.pause_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.PauseQueueRequest, dict]): The request object. Request message for @@ -1056,6 +1199,27 @@ def resume_queue( Scaling Risks `__. + + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_resume_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.ResumeQueueRequest( + name="name_value", + ) + + # Make the request + response = client.resume_queue(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.ResumeQueueRequest, dict]): The request object. Request message for @@ -1139,6 +1303,27 @@ def get_iam_policy( - ``cloudtasks.queues.getIamPolicy`` + + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_get_iam_policy(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]): The request object. Request message for `GetIamPolicy` @@ -1276,6 +1461,27 @@ def set_iam_policy( - ``cloudtasks.queues.setIamPolicy`` + + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_set_iam_policy(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]): The request object. Request message for `SetIamPolicy` @@ -1410,6 +1616,28 @@ def test_iam_permissions( authorization checking. This operation may "fail open" without warning. + + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_test_iam_permissions(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value_1', 'permissions_value_2'], + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]): The request object. Request message for @@ -1500,6 +1728,28 @@ def list_tasks( The tasks may be returned in any order. The ordering may change at any time. + + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_list_tasks(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.ListTasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tasks(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.ListTasksRequest, dict]): The request object. Request message for listing tasks @@ -1581,6 +1831,26 @@ def get_task( ) -> task.Task: r"""Gets a task. + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_get_task(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.GetTaskRequest( + name="name_value", + ) + + # Make the request + response = client.get_task(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.GetTaskRequest, dict]): The request object. Request message for getting a task @@ -1657,6 +1927,27 @@ def create_task( - The maximum task size is 100KB. + + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_create_task(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.CreateTaskRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_task(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.CreateTaskRequest, dict]): The request object. Request message for @@ -1779,6 +2070,24 @@ def delete_task( A task cannot be deleted if it has executed successfully or permanently failed. + + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_delete_task(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.DeleteTaskRequest( + name="name_value", + ) + + # Make the request + client.delete_task(request=request) + Args: request (Union[google.cloud.tasks_v2beta3.types.DeleteTaskRequest, dict]): The request object. Request message for deleting a task @@ -1871,6 +2180,27 @@ def run_task( [NOT_FOUND][google.rpc.Code.NOT_FOUND] when it is called on a task that has already succeeded or permanently failed. + + + .. code-block:: + + from google.cloud import tasks_v2beta3 + + def sample_run_task(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.RunTaskRequest( + name="name_value", + ) + + # Make the request + response = client.run_task(request=request) + + # Handle the response + print(response) + Args: request (Union[google.cloud.tasks_v2beta3.types.RunTaskRequest, dict]): The request object. Request message for forcing a task diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_create_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_create_queue_async.py new file mode 100644 index 00000000..7a394885 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_create_queue_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_CreateQueue_async] +from google.cloud import tasks_v2 + + +async def sample_create_queue(): + # Create a client + client = tasks_v2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2.CreateQueueRequest( + parent="parent_value", + ) + + # Make the request + response = await client.create_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_CreateQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_create_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_create_queue_sync.py new file mode 100644 index 00000000..33ac4e28 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_create_queue_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_CreateQueue_sync] +from google.cloud import tasks_v2 + + +def sample_create_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.CreateQueueRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_CreateQueue_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_create_task_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_create_task_async.py new file mode 100644 index 00000000..768adef2 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_create_task_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_CreateTask_async] +from google.cloud import tasks_v2 + + +async def sample_create_task(): + # Create a client + client = tasks_v2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2.CreateTaskRequest( + parent="parent_value", + ) + + # Make the request + response = await client.create_task(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_CreateTask_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_create_task_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_create_task_sync.py new file mode 100644 index 00000000..bb120206 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_create_task_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_CreateTask_sync] +from google.cloud import tasks_v2 + + +def sample_create_task(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.CreateTaskRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_task(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_CreateTask_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_delete_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_delete_queue_async.py new file mode 100644 index 00000000..ed8e8e46 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_delete_queue_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_DeleteQueue_async] +from google.cloud import tasks_v2 + + +async def sample_delete_queue(): + # Create a client + client = tasks_v2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2.DeleteQueueRequest( + name="name_value", + ) + + # Make the request + await client.delete_queue(request=request) + + +# [END cloudtasks_generated_tasks_v2_CloudTasks_DeleteQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_delete_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_delete_queue_sync.py new file mode 100644 index 00000000..7a9cdf70 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_delete_queue_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_DeleteQueue_sync] +from google.cloud import tasks_v2 + + +def sample_delete_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.DeleteQueueRequest( + name="name_value", + ) + + # Make the request + client.delete_queue(request=request) + + +# [END cloudtasks_generated_tasks_v2_CloudTasks_DeleteQueue_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_delete_task_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_delete_task_async.py new file mode 100644 index 00000000..a541ee3e --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_delete_task_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_DeleteTask_async] +from google.cloud import tasks_v2 + + +async def sample_delete_task(): + # Create a client + client = tasks_v2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2.DeleteTaskRequest( + name="name_value", + ) + + # Make the request + await client.delete_task(request=request) + + +# [END cloudtasks_generated_tasks_v2_CloudTasks_DeleteTask_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_delete_task_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_delete_task_sync.py new file mode 100644 index 00000000..e08e68f0 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_delete_task_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_DeleteTask_sync] +from google.cloud import tasks_v2 + + +def sample_delete_task(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.DeleteTaskRequest( + name="name_value", + ) + + # Make the request + client.delete_task(request=request) + + +# [END cloudtasks_generated_tasks_v2_CloudTasks_DeleteTask_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_iam_policy_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_iam_policy_async.py new file mode 100644 index 00000000..122d7a71 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_iam_policy_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetIamPolicy +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_GetIamPolicy_async] +from google.cloud import tasks_v2 + + +async def sample_get_iam_policy(): + # Create a client + client = tasks_v2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = await client.get_iam_policy(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_GetIamPolicy_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_iam_policy_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_iam_policy_sync.py new file mode 100644 index 00000000..f0c82dd8 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_iam_policy_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetIamPolicy +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_GetIamPolicy_sync] +from google.cloud import tasks_v2 + + +def sample_get_iam_policy(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_GetIamPolicy_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_queue_async.py new file mode 100644 index 00000000..3e3ab398 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_queue_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_GetQueue_async] +from google.cloud import tasks_v2 + + +async def sample_get_queue(): + # Create a client + client = tasks_v2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2.GetQueueRequest( + name="name_value", + ) + + # Make the request + response = await client.get_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_GetQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_queue_sync.py new file mode 100644 index 00000000..726f9fad --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_queue_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_GetQueue_sync] +from google.cloud import tasks_v2 + + +def sample_get_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.GetQueueRequest( + name="name_value", + ) + + # Make the request + response = client.get_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_GetQueue_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_task_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_task_async.py new file mode 100644 index 00000000..448b385e --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_task_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_GetTask_async] +from google.cloud import tasks_v2 + + +async def sample_get_task(): + # Create a client + client = tasks_v2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2.GetTaskRequest( + name="name_value", + ) + + # Make the request + response = await client.get_task(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_GetTask_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_task_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_task_sync.py new file mode 100644 index 00000000..edab8572 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_get_task_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_GetTask_sync] +from google.cloud import tasks_v2 + + +def sample_get_task(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.GetTaskRequest( + name="name_value", + ) + + # Make the request + response = client.get_task(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_GetTask_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_list_queues_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_list_queues_async.py new file mode 100644 index 00000000..8af6815f --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_list_queues_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListQueues +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_ListQueues_async] +from google.cloud import tasks_v2 + + +async def sample_list_queues(): + # Create a client + client = tasks_v2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2.ListQueuesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_queues(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_ListQueues_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_list_queues_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_list_queues_sync.py new file mode 100644 index 00000000..3f8d4bb8 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_list_queues_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListQueues +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_ListQueues_sync] +from google.cloud import tasks_v2 + + +def sample_list_queues(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.ListQueuesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_queues(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_ListQueues_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_list_tasks_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_list_tasks_async.py new file mode 100644 index 00000000..a396219f --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_list_tasks_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTasks +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_ListTasks_async] +from google.cloud import tasks_v2 + + +async def sample_list_tasks(): + # Create a client + client = tasks_v2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2.ListTasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tasks(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_ListTasks_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_list_tasks_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_list_tasks_sync.py new file mode 100644 index 00000000..7fb16521 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_list_tasks_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTasks +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_ListTasks_sync] +from google.cloud import tasks_v2 + + +def sample_list_tasks(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.ListTasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tasks(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_ListTasks_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_pause_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_pause_queue_async.py new file mode 100644 index 00000000..8c3cdb18 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_pause_queue_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PauseQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_PauseQueue_async] +from google.cloud import tasks_v2 + + +async def sample_pause_queue(): + # Create a client + client = tasks_v2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2.PauseQueueRequest( + name="name_value", + ) + + # Make the request + response = await client.pause_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_PauseQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_pause_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_pause_queue_sync.py new file mode 100644 index 00000000..63444e5c --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_pause_queue_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PauseQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_PauseQueue_sync] +from google.cloud import tasks_v2 + + +def sample_pause_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.PauseQueueRequest( + name="name_value", + ) + + # Make the request + response = client.pause_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_PauseQueue_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_purge_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_purge_queue_async.py new file mode 100644 index 00000000..c59e7080 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_purge_queue_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PurgeQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_PurgeQueue_async] +from google.cloud import tasks_v2 + + +async def sample_purge_queue(): + # Create a client + client = tasks_v2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2.PurgeQueueRequest( + name="name_value", + ) + + # Make the request + response = await client.purge_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_PurgeQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_purge_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_purge_queue_sync.py new file mode 100644 index 00000000..51240ca1 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_purge_queue_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PurgeQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_PurgeQueue_sync] +from google.cloud import tasks_v2 + + +def sample_purge_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.PurgeQueueRequest( + name="name_value", + ) + + # Make the request + response = client.purge_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_PurgeQueue_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_resume_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_resume_queue_async.py new file mode 100644 index 00000000..227dc425 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_resume_queue_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ResumeQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_ResumeQueue_async] +from google.cloud import tasks_v2 + + +async def sample_resume_queue(): + # Create a client + client = tasks_v2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2.ResumeQueueRequest( + name="name_value", + ) + + # Make the request + response = await client.resume_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_ResumeQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_resume_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_resume_queue_sync.py new file mode 100644 index 00000000..01dc3292 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_resume_queue_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ResumeQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_ResumeQueue_sync] +from google.cloud import tasks_v2 + + +def sample_resume_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.ResumeQueueRequest( + name="name_value", + ) + + # Make the request + response = client.resume_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_ResumeQueue_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_run_task_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_run_task_async.py new file mode 100644 index 00000000..8aae851a --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_run_task_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RunTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_RunTask_async] +from google.cloud import tasks_v2 + + +async def sample_run_task(): + # Create a client + client = tasks_v2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2.RunTaskRequest( + name="name_value", + ) + + # Make the request + response = await client.run_task(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_RunTask_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_run_task_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_run_task_sync.py new file mode 100644 index 00000000..8a885ccc --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_run_task_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RunTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_RunTask_sync] +from google.cloud import tasks_v2 + + +def sample_run_task(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.RunTaskRequest( + name="name_value", + ) + + # Make the request + response = client.run_task(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_RunTask_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_set_iam_policy_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_set_iam_policy_async.py new file mode 100644 index 00000000..9b599bda --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_set_iam_policy_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SetIamPolicy +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_SetIamPolicy_async] +from google.cloud import tasks_v2 + + +async def sample_set_iam_policy(): + # Create a client + client = tasks_v2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = await client.set_iam_policy(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_SetIamPolicy_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_set_iam_policy_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_set_iam_policy_sync.py new file mode 100644 index 00000000..09d7b434 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_set_iam_policy_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SetIamPolicy +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_SetIamPolicy_sync] +from google.cloud import tasks_v2 + + +def sample_set_iam_policy(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_SetIamPolicy_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_test_iam_permissions_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_test_iam_permissions_async.py new file mode 100644 index 00000000..87419265 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_test_iam_permissions_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TestIamPermissions +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_TestIamPermissions_async] +from google.cloud import tasks_v2 + + +async def sample_test_iam_permissions(): + # Create a client + client = tasks_v2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value_1', 'permissions_value_2'], + ) + + # Make the request + response = await client.test_iam_permissions(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_TestIamPermissions_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_test_iam_permissions_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_test_iam_permissions_sync.py new file mode 100644 index 00000000..1c26e2d3 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_test_iam_permissions_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TestIamPermissions +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_TestIamPermissions_sync] +from google.cloud import tasks_v2 + + +def sample_test_iam_permissions(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value_1', 'permissions_value_2'], + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_TestIamPermissions_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_update_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_update_queue_async.py new file mode 100644 index 00000000..a6c8bc09 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_update_queue_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_UpdateQueue_async] +from google.cloud import tasks_v2 + + +async def sample_update_queue(): + # Create a client + client = tasks_v2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2.UpdateQueueRequest( + ) + + # Make the request + response = await client.update_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_UpdateQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_update_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_update_queue_sync.py new file mode 100644 index 00000000..65f0af17 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2_cloud_tasks_update_queue_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2_CloudTasks_UpdateQueue_sync] +from google.cloud import tasks_v2 + + +def sample_update_queue(): + # Create a client + client = tasks_v2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2.UpdateQueueRequest( + ) + + # Make the request + response = client.update_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2_CloudTasks_UpdateQueue_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_acknowledge_task_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_acknowledge_task_async.py new file mode 100644 index 00000000..4feba15d --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_acknowledge_task_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AcknowledgeTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_AcknowledgeTask_async] +from google.cloud import tasks_v2beta2 + + +async def sample_acknowledge_task(): + # Create a client + client = tasks_v2beta2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta2.AcknowledgeTaskRequest( + name="name_value", + ) + + # Make the request + await client.acknowledge_task(request=request) + + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_AcknowledgeTask_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_acknowledge_task_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_acknowledge_task_sync.py new file mode 100644 index 00000000..e0388b24 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_acknowledge_task_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for AcknowledgeTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_AcknowledgeTask_sync] +from google.cloud import tasks_v2beta2 + + +def sample_acknowledge_task(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.AcknowledgeTaskRequest( + name="name_value", + ) + + # Make the request + client.acknowledge_task(request=request) + + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_AcknowledgeTask_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_cancel_lease_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_cancel_lease_async.py new file mode 100644 index 00000000..c49c0609 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_cancel_lease_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CancelLease +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_CancelLease_async] +from google.cloud import tasks_v2beta2 + + +async def sample_cancel_lease(): + # Create a client + client = tasks_v2beta2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta2.CancelLeaseRequest( + name="name_value", + ) + + # Make the request + response = await client.cancel_lease(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_CancelLease_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_cancel_lease_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_cancel_lease_sync.py new file mode 100644 index 00000000..bee63f63 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_cancel_lease_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CancelLease +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_CancelLease_sync] +from google.cloud import tasks_v2beta2 + + +def sample_cancel_lease(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.CancelLeaseRequest( + name="name_value", + ) + + # Make the request + response = client.cancel_lease(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_CancelLease_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_create_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_create_queue_async.py new file mode 100644 index 00000000..f0aebedf --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_create_queue_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_CreateQueue_async] +from google.cloud import tasks_v2beta2 + + +async def sample_create_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta2.CreateQueueRequest( + parent="parent_value", + ) + + # Make the request + response = await client.create_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_CreateQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_create_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_create_queue_sync.py new file mode 100644 index 00000000..0fa73006 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_create_queue_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_CreateQueue_sync] +from google.cloud import tasks_v2beta2 + + +def sample_create_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.CreateQueueRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_CreateQueue_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_create_task_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_create_task_async.py new file mode 100644 index 00000000..8e98e233 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_create_task_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_CreateTask_async] +from google.cloud import tasks_v2beta2 + + +async def sample_create_task(): + # Create a client + client = tasks_v2beta2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta2.CreateTaskRequest( + parent="parent_value", + ) + + # Make the request + response = await client.create_task(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_CreateTask_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_create_task_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_create_task_sync.py new file mode 100644 index 00000000..80101f53 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_create_task_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_CreateTask_sync] +from google.cloud import tasks_v2beta2 + + +def sample_create_task(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.CreateTaskRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_task(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_CreateTask_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_delete_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_delete_queue_async.py new file mode 100644 index 00000000..494e8f3c --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_delete_queue_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_DeleteQueue_async] +from google.cloud import tasks_v2beta2 + + +async def sample_delete_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta2.DeleteQueueRequest( + name="name_value", + ) + + # Make the request + await client.delete_queue(request=request) + + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_DeleteQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_delete_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_delete_queue_sync.py new file mode 100644 index 00000000..f8cb30ac --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_delete_queue_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_DeleteQueue_sync] +from google.cloud import tasks_v2beta2 + + +def sample_delete_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.DeleteQueueRequest( + name="name_value", + ) + + # Make the request + client.delete_queue(request=request) + + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_DeleteQueue_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_delete_task_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_delete_task_async.py new file mode 100644 index 00000000..f5ae4a6a --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_delete_task_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_DeleteTask_async] +from google.cloud import tasks_v2beta2 + + +async def sample_delete_task(): + # Create a client + client = tasks_v2beta2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta2.DeleteTaskRequest( + name="name_value", + ) + + # Make the request + await client.delete_task(request=request) + + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_DeleteTask_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_delete_task_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_delete_task_sync.py new file mode 100644 index 00000000..846270fb --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_delete_task_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_DeleteTask_sync] +from google.cloud import tasks_v2beta2 + + +def sample_delete_task(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.DeleteTaskRequest( + name="name_value", + ) + + # Make the request + client.delete_task(request=request) + + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_DeleteTask_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_iam_policy_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_iam_policy_async.py new file mode 100644 index 00000000..0101abee --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_iam_policy_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetIamPolicy +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_GetIamPolicy_async] +from google.cloud import tasks_v2beta2 + + +async def sample_get_iam_policy(): + # Create a client + client = tasks_v2beta2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta2.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = await client.get_iam_policy(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_GetIamPolicy_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_iam_policy_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_iam_policy_sync.py new file mode 100644 index 00000000..a6fe34a4 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_iam_policy_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetIamPolicy +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_GetIamPolicy_sync] +from google.cloud import tasks_v2beta2 + + +def sample_get_iam_policy(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_GetIamPolicy_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_queue_async.py new file mode 100644 index 00000000..51d449fb --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_queue_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_GetQueue_async] +from google.cloud import tasks_v2beta2 + + +async def sample_get_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta2.GetQueueRequest( + name="name_value", + ) + + # Make the request + response = await client.get_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_GetQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_queue_sync.py new file mode 100644 index 00000000..5fd69edb --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_queue_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_GetQueue_sync] +from google.cloud import tasks_v2beta2 + + +def sample_get_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.GetQueueRequest( + name="name_value", + ) + + # Make the request + response = client.get_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_GetQueue_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_task_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_task_async.py new file mode 100644 index 00000000..8257d8e5 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_task_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_GetTask_async] +from google.cloud import tasks_v2beta2 + + +async def sample_get_task(): + # Create a client + client = tasks_v2beta2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta2.GetTaskRequest( + name="name_value", + ) + + # Make the request + response = await client.get_task(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_GetTask_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_task_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_task_sync.py new file mode 100644 index 00000000..edfa875d --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_task_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_GetTask_sync] +from google.cloud import tasks_v2beta2 + + +def sample_get_task(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.GetTaskRequest( + name="name_value", + ) + + # Make the request + response = client.get_task(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_GetTask_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_lease_tasks_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_lease_tasks_async.py new file mode 100644 index 00000000..608add9b --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_lease_tasks_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for LeaseTasks +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_LeaseTasks_async] +from google.cloud import tasks_v2beta2 + + +async def sample_lease_tasks(): + # Create a client + client = tasks_v2beta2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta2.LeaseTasksRequest( + parent="parent_value", + ) + + # Make the request + response = await client.lease_tasks(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_LeaseTasks_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_lease_tasks_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_lease_tasks_sync.py new file mode 100644 index 00000000..caab21e9 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_lease_tasks_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for LeaseTasks +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_LeaseTasks_sync] +from google.cloud import tasks_v2beta2 + + +def sample_lease_tasks(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.LeaseTasksRequest( + parent="parent_value", + ) + + # Make the request + response = client.lease_tasks(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_LeaseTasks_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_list_queues_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_list_queues_async.py new file mode 100644 index 00000000..132cd471 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_list_queues_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListQueues +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_ListQueues_async] +from google.cloud import tasks_v2beta2 + + +async def sample_list_queues(): + # Create a client + client = tasks_v2beta2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta2.ListQueuesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_queues(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_ListQueues_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_list_queues_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_list_queues_sync.py new file mode 100644 index 00000000..1bc6fa8e --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_list_queues_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListQueues +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_ListQueues_sync] +from google.cloud import tasks_v2beta2 + + +def sample_list_queues(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.ListQueuesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_queues(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_ListQueues_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_list_tasks_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_list_tasks_async.py new file mode 100644 index 00000000..54a01f23 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_list_tasks_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTasks +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_ListTasks_async] +from google.cloud import tasks_v2beta2 + + +async def sample_list_tasks(): + # Create a client + client = tasks_v2beta2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta2.ListTasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tasks(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_ListTasks_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_list_tasks_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_list_tasks_sync.py new file mode 100644 index 00000000..2d4484d4 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_list_tasks_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTasks +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_ListTasks_sync] +from google.cloud import tasks_v2beta2 + + +def sample_list_tasks(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.ListTasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tasks(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_ListTasks_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_pause_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_pause_queue_async.py new file mode 100644 index 00000000..af15fcd6 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_pause_queue_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PauseQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_PauseQueue_async] +from google.cloud import tasks_v2beta2 + + +async def sample_pause_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta2.PauseQueueRequest( + name="name_value", + ) + + # Make the request + response = await client.pause_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_PauseQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_pause_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_pause_queue_sync.py new file mode 100644 index 00000000..361473af --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_pause_queue_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PauseQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_PauseQueue_sync] +from google.cloud import tasks_v2beta2 + + +def sample_pause_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.PauseQueueRequest( + name="name_value", + ) + + # Make the request + response = client.pause_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_PauseQueue_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_purge_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_purge_queue_async.py new file mode 100644 index 00000000..bb6fd101 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_purge_queue_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PurgeQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_PurgeQueue_async] +from google.cloud import tasks_v2beta2 + + +async def sample_purge_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta2.PurgeQueueRequest( + name="name_value", + ) + + # Make the request + response = await client.purge_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_PurgeQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_purge_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_purge_queue_sync.py new file mode 100644 index 00000000..61548d97 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_purge_queue_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PurgeQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_PurgeQueue_sync] +from google.cloud import tasks_v2beta2 + + +def sample_purge_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.PurgeQueueRequest( + name="name_value", + ) + + # Make the request + response = client.purge_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_PurgeQueue_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_renew_lease_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_renew_lease_async.py new file mode 100644 index 00000000..edf97861 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_renew_lease_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RenewLease +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_RenewLease_async] +from google.cloud import tasks_v2beta2 + + +async def sample_renew_lease(): + # Create a client + client = tasks_v2beta2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta2.RenewLeaseRequest( + name="name_value", + ) + + # Make the request + response = await client.renew_lease(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_RenewLease_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_renew_lease_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_renew_lease_sync.py new file mode 100644 index 00000000..f7b95e17 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_renew_lease_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RenewLease +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_RenewLease_sync] +from google.cloud import tasks_v2beta2 + + +def sample_renew_lease(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.RenewLeaseRequest( + name="name_value", + ) + + # Make the request + response = client.renew_lease(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_RenewLease_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_resume_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_resume_queue_async.py new file mode 100644 index 00000000..15eea3d0 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_resume_queue_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ResumeQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_ResumeQueue_async] +from google.cloud import tasks_v2beta2 + + +async def sample_resume_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta2.ResumeQueueRequest( + name="name_value", + ) + + # Make the request + response = await client.resume_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_ResumeQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_resume_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_resume_queue_sync.py new file mode 100644 index 00000000..3552c2ff --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_resume_queue_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ResumeQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_ResumeQueue_sync] +from google.cloud import tasks_v2beta2 + + +def sample_resume_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.ResumeQueueRequest( + name="name_value", + ) + + # Make the request + response = client.resume_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_ResumeQueue_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_run_task_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_run_task_async.py new file mode 100644 index 00000000..c4c157cb --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_run_task_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RunTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_RunTask_async] +from google.cloud import tasks_v2beta2 + + +async def sample_run_task(): + # Create a client + client = tasks_v2beta2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta2.RunTaskRequest( + name="name_value", + ) + + # Make the request + response = await client.run_task(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_RunTask_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_run_task_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_run_task_sync.py new file mode 100644 index 00000000..2cc916f3 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_run_task_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RunTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_RunTask_sync] +from google.cloud import tasks_v2beta2 + + +def sample_run_task(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.RunTaskRequest( + name="name_value", + ) + + # Make the request + response = client.run_task(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_RunTask_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_set_iam_policy_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_set_iam_policy_async.py new file mode 100644 index 00000000..d5c5e908 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_set_iam_policy_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SetIamPolicy +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_SetIamPolicy_async] +from google.cloud import tasks_v2beta2 + + +async def sample_set_iam_policy(): + # Create a client + client = tasks_v2beta2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta2.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = await client.set_iam_policy(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_SetIamPolicy_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_set_iam_policy_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_set_iam_policy_sync.py new file mode 100644 index 00000000..0b28f1d6 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_set_iam_policy_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SetIamPolicy +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_SetIamPolicy_sync] +from google.cloud import tasks_v2beta2 + + +def sample_set_iam_policy(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_SetIamPolicy_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_test_iam_permissions_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_test_iam_permissions_async.py new file mode 100644 index 00000000..74f2ff7c --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_test_iam_permissions_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TestIamPermissions +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_TestIamPermissions_async] +from google.cloud import tasks_v2beta2 + + +async def sample_test_iam_permissions(): + # Create a client + client = tasks_v2beta2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta2.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value_1', 'permissions_value_2'], + ) + + # Make the request + response = await client.test_iam_permissions(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_TestIamPermissions_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_test_iam_permissions_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_test_iam_permissions_sync.py new file mode 100644 index 00000000..84190def --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_test_iam_permissions_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TestIamPermissions +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_TestIamPermissions_sync] +from google.cloud import tasks_v2beta2 + + +def sample_test_iam_permissions(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value_1', 'permissions_value_2'], + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_TestIamPermissions_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_update_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_update_queue_async.py new file mode 100644 index 00000000..7349b4cf --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_update_queue_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_UpdateQueue_async] +from google.cloud import tasks_v2beta2 + + +async def sample_update_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta2.UpdateQueueRequest( + ) + + # Make the request + response = await client.update_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_UpdateQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_update_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_update_queue_sync.py new file mode 100644 index 00000000..4f8e1104 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta2_cloud_tasks_update_queue_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta2_CloudTasks_UpdateQueue_sync] +from google.cloud import tasks_v2beta2 + + +def sample_update_queue(): + # Create a client + client = tasks_v2beta2.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta2.UpdateQueueRequest( + ) + + # Make the request + response = client.update_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta2_CloudTasks_UpdateQueue_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_create_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_create_queue_async.py new file mode 100644 index 00000000..66ddf77c --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_create_queue_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_CreateQueue_async] +from google.cloud import tasks_v2beta3 + + +async def sample_create_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta3.CreateQueueRequest( + parent="parent_value", + ) + + # Make the request + response = await client.create_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_CreateQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_create_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_create_queue_sync.py new file mode 100644 index 00000000..2648c76b --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_create_queue_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_CreateQueue_sync] +from google.cloud import tasks_v2beta3 + + +def sample_create_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.CreateQueueRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_CreateQueue_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_create_task_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_create_task_async.py new file mode 100644 index 00000000..b197a58b --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_create_task_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_CreateTask_async] +from google.cloud import tasks_v2beta3 + + +async def sample_create_task(): + # Create a client + client = tasks_v2beta3.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta3.CreateTaskRequest( + parent="parent_value", + ) + + # Make the request + response = await client.create_task(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_CreateTask_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_create_task_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_create_task_sync.py new file mode 100644 index 00000000..450f6435 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_create_task_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_CreateTask_sync] +from google.cloud import tasks_v2beta3 + + +def sample_create_task(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.CreateTaskRequest( + parent="parent_value", + ) + + # Make the request + response = client.create_task(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_CreateTask_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_delete_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_delete_queue_async.py new file mode 100644 index 00000000..bd5905a5 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_delete_queue_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_DeleteQueue_async] +from google.cloud import tasks_v2beta3 + + +async def sample_delete_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta3.DeleteQueueRequest( + name="name_value", + ) + + # Make the request + await client.delete_queue(request=request) + + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_DeleteQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_delete_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_delete_queue_sync.py new file mode 100644 index 00000000..9b1c6c11 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_delete_queue_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_DeleteQueue_sync] +from google.cloud import tasks_v2beta3 + + +def sample_delete_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.DeleteQueueRequest( + name="name_value", + ) + + # Make the request + client.delete_queue(request=request) + + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_DeleteQueue_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_delete_task_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_delete_task_async.py new file mode 100644 index 00000000..5c2decc0 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_delete_task_async.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_DeleteTask_async] +from google.cloud import tasks_v2beta3 + + +async def sample_delete_task(): + # Create a client + client = tasks_v2beta3.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta3.DeleteTaskRequest( + name="name_value", + ) + + # Make the request + await client.delete_task(request=request) + + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_DeleteTask_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_delete_task_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_delete_task_sync.py new file mode 100644 index 00000000..45bab213 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_delete_task_sync.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_DeleteTask_sync] +from google.cloud import tasks_v2beta3 + + +def sample_delete_task(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.DeleteTaskRequest( + name="name_value", + ) + + # Make the request + client.delete_task(request=request) + + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_DeleteTask_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_iam_policy_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_iam_policy_async.py new file mode 100644 index 00000000..68bc0446 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_iam_policy_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetIamPolicy +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_GetIamPolicy_async] +from google.cloud import tasks_v2beta3 + + +async def sample_get_iam_policy(): + # Create a client + client = tasks_v2beta3.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta3.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = await client.get_iam_policy(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_GetIamPolicy_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_iam_policy_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_iam_policy_sync.py new file mode 100644 index 00000000..cea61282 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_iam_policy_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetIamPolicy +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_GetIamPolicy_sync] +from google.cloud import tasks_v2beta3 + + +def sample_get_iam_policy(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_GetIamPolicy_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_queue_async.py new file mode 100644 index 00000000..bc7992f8 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_queue_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_GetQueue_async] +from google.cloud import tasks_v2beta3 + + +async def sample_get_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta3.GetQueueRequest( + name="name_value", + ) + + # Make the request + response = await client.get_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_GetQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_queue_sync.py new file mode 100644 index 00000000..23f15f97 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_queue_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_GetQueue_sync] +from google.cloud import tasks_v2beta3 + + +def sample_get_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.GetQueueRequest( + name="name_value", + ) + + # Make the request + response = client.get_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_GetQueue_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_task_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_task_async.py new file mode 100644 index 00000000..88b6c9a3 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_task_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_GetTask_async] +from google.cloud import tasks_v2beta3 + + +async def sample_get_task(): + # Create a client + client = tasks_v2beta3.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta3.GetTaskRequest( + name="name_value", + ) + + # Make the request + response = await client.get_task(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_GetTask_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_task_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_task_sync.py new file mode 100644 index 00000000..9f90fc21 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_task_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_GetTask_sync] +from google.cloud import tasks_v2beta3 + + +def sample_get_task(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.GetTaskRequest( + name="name_value", + ) + + # Make the request + response = client.get_task(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_GetTask_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_list_queues_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_list_queues_async.py new file mode 100644 index 00000000..cc1b8000 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_list_queues_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListQueues +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_ListQueues_async] +from google.cloud import tasks_v2beta3 + + +async def sample_list_queues(): + # Create a client + client = tasks_v2beta3.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta3.ListQueuesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_queues(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_ListQueues_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_list_queues_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_list_queues_sync.py new file mode 100644 index 00000000..d1e2fc4a --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_list_queues_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListQueues +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_ListQueues_sync] +from google.cloud import tasks_v2beta3 + + +def sample_list_queues(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.ListQueuesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_queues(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_ListQueues_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_list_tasks_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_list_tasks_async.py new file mode 100644 index 00000000..bd00a508 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_list_tasks_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTasks +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_ListTasks_async] +from google.cloud import tasks_v2beta3 + + +async def sample_list_tasks(): + # Create a client + client = tasks_v2beta3.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta3.ListTasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tasks(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_ListTasks_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_list_tasks_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_list_tasks_sync.py new file mode 100644 index 00000000..798c831a --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_list_tasks_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTasks +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_ListTasks_sync] +from google.cloud import tasks_v2beta3 + + +def sample_list_tasks(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.ListTasksRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tasks(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_ListTasks_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_pause_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_pause_queue_async.py new file mode 100644 index 00000000..3f9e9dba --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_pause_queue_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PauseQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_PauseQueue_async] +from google.cloud import tasks_v2beta3 + + +async def sample_pause_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta3.PauseQueueRequest( + name="name_value", + ) + + # Make the request + response = await client.pause_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_PauseQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_pause_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_pause_queue_sync.py new file mode 100644 index 00000000..70b13afb --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_pause_queue_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PauseQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_PauseQueue_sync] +from google.cloud import tasks_v2beta3 + + +def sample_pause_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.PauseQueueRequest( + name="name_value", + ) + + # Make the request + response = client.pause_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_PauseQueue_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_purge_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_purge_queue_async.py new file mode 100644 index 00000000..d6fe86b5 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_purge_queue_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PurgeQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_PurgeQueue_async] +from google.cloud import tasks_v2beta3 + + +async def sample_purge_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta3.PurgeQueueRequest( + name="name_value", + ) + + # Make the request + response = await client.purge_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_PurgeQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_purge_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_purge_queue_sync.py new file mode 100644 index 00000000..ca224c23 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_purge_queue_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PurgeQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_PurgeQueue_sync] +from google.cloud import tasks_v2beta3 + + +def sample_purge_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.PurgeQueueRequest( + name="name_value", + ) + + # Make the request + response = client.purge_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_PurgeQueue_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_resume_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_resume_queue_async.py new file mode 100644 index 00000000..8d6df0ba --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_resume_queue_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ResumeQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_ResumeQueue_async] +from google.cloud import tasks_v2beta3 + + +async def sample_resume_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta3.ResumeQueueRequest( + name="name_value", + ) + + # Make the request + response = await client.resume_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_ResumeQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_resume_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_resume_queue_sync.py new file mode 100644 index 00000000..b64a7ae1 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_resume_queue_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ResumeQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_ResumeQueue_sync] +from google.cloud import tasks_v2beta3 + + +def sample_resume_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.ResumeQueueRequest( + name="name_value", + ) + + # Make the request + response = client.resume_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_ResumeQueue_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_run_task_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_run_task_async.py new file mode 100644 index 00000000..7d015ec8 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_run_task_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RunTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_RunTask_async] +from google.cloud import tasks_v2beta3 + + +async def sample_run_task(): + # Create a client + client = tasks_v2beta3.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta3.RunTaskRequest( + name="name_value", + ) + + # Make the request + response = await client.run_task(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_RunTask_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_run_task_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_run_task_sync.py new file mode 100644 index 00000000..3b9bebf2 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_run_task_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RunTask +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_RunTask_sync] +from google.cloud import tasks_v2beta3 + + +def sample_run_task(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.RunTaskRequest( + name="name_value", + ) + + # Make the request + response = client.run_task(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_RunTask_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_set_iam_policy_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_set_iam_policy_async.py new file mode 100644 index 00000000..50752297 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_set_iam_policy_async.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SetIamPolicy +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_SetIamPolicy_async] +from google.cloud import tasks_v2beta3 + + +async def sample_set_iam_policy(): + # Create a client + client = tasks_v2beta3.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta3.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = await client.set_iam_policy(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_SetIamPolicy_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_set_iam_policy_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_set_iam_policy_sync.py new file mode 100644 index 00000000..3af365e1 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_set_iam_policy_sync.py @@ -0,0 +1,45 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SetIamPolicy +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_SetIamPolicy_sync] +from google.cloud import tasks_v2beta3 + + +def sample_set_iam_policy(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_SetIamPolicy_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_test_iam_permissions_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_test_iam_permissions_async.py new file mode 100644 index 00000000..009d0f85 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_test_iam_permissions_async.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TestIamPermissions +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_TestIamPermissions_async] +from google.cloud import tasks_v2beta3 + + +async def sample_test_iam_permissions(): + # Create a client + client = tasks_v2beta3.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta3.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value_1', 'permissions_value_2'], + ) + + # Make the request + response = await client.test_iam_permissions(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_TestIamPermissions_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_test_iam_permissions_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_test_iam_permissions_sync.py new file mode 100644 index 00000000..07541ae9 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_test_iam_permissions_sync.py @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TestIamPermissions +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_TestIamPermissions_sync] +from google.cloud import tasks_v2beta3 + + +def sample_test_iam_permissions(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value_1', 'permissions_value_2'], + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_TestIamPermissions_sync] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_update_queue_async.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_update_queue_async.py new file mode 100644 index 00000000..9717e0b9 --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_update_queue_async.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_UpdateQueue_async] +from google.cloud import tasks_v2beta3 + + +async def sample_update_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksAsyncClient() + + # Initialize request argument(s) + request = tasks_v2beta3.UpdateQueueRequest( + ) + + # Make the request + response = await client.update_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_UpdateQueue_async] diff --git a/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_update_queue_sync.py b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_update_queue_sync.py new file mode 100644 index 00000000..8e08d95d --- /dev/null +++ b/samples/generated_samples/cloudtasks_generated_tasks_v2beta3_cloud_tasks_update_queue_sync.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateQueue +# 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-tasks + + +# [START cloudtasks_generated_tasks_v2beta3_CloudTasks_UpdateQueue_sync] +from google.cloud import tasks_v2beta3 + + +def sample_update_queue(): + # Create a client + client = tasks_v2beta3.CloudTasksClient() + + # Initialize request argument(s) + request = tasks_v2beta3.UpdateQueueRequest( + ) + + # Make the request + response = client.update_queue(request=request) + + # Handle the response + print(response) + +# [END cloudtasks_generated_tasks_v2beta3_CloudTasks_UpdateQueue_sync] diff --git a/samples/generated_samples/snippet_metadata_tasks_v2.json b/samples/generated_samples/snippet_metadata_tasks_v2.json new file mode 100644 index 00000000..f00a313e --- /dev/null +++ b/samples/generated_samples/snippet_metadata_tasks_v2.json @@ -0,0 +1,1420 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudTasks" + }, + "shortName": "CreateQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_create_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_CreateQueue_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": "CloudTasks" + }, + "shortName": "CreateQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_create_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_CreateQueue_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": "CloudTasks" + }, + "shortName": "CreateTask" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_create_task_async.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_CreateTask_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": "CloudTasks" + }, + "shortName": "CreateTask" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_create_task_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_CreateTask_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": "CloudTasks" + }, + "shortName": "DeleteQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_delete_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_DeleteQueue_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": "CloudTasks" + }, + "shortName": "DeleteQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_delete_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_DeleteQueue_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": "CloudTasks" + }, + "shortName": "DeleteTask" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_delete_task_async.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_DeleteTask_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": "CloudTasks" + }, + "shortName": "DeleteTask" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_delete_task_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_DeleteTask_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": "CloudTasks" + }, + "shortName": "GetIamPolicy" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_get_iam_policy_async.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_GetIamPolicy_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": "CloudTasks" + }, + "shortName": "GetIamPolicy" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_get_iam_policy_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_GetIamPolicy_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": "CloudTasks" + }, + "shortName": "GetQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_get_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_GetQueue_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": "CloudTasks" + }, + "shortName": "GetQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_get_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_GetQueue_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": "CloudTasks" + }, + "shortName": "GetTask" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_get_task_async.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_GetTask_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": "CloudTasks" + }, + "shortName": "GetTask" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_get_task_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_GetTask_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": "CloudTasks" + }, + "shortName": "ListQueues" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_list_queues_async.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_ListQueues_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": "CloudTasks" + }, + "shortName": "ListQueues" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_list_queues_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_ListQueues_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": "CloudTasks" + }, + "shortName": "ListTasks" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_list_tasks_async.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_ListTasks_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": "CloudTasks" + }, + "shortName": "ListTasks" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_list_tasks_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_ListTasks_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": "CloudTasks" + }, + "shortName": "PauseQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_pause_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_PauseQueue_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": "CloudTasks" + }, + "shortName": "PauseQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_pause_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_PauseQueue_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": "CloudTasks" + }, + "shortName": "PurgeQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_purge_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_PurgeQueue_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": "CloudTasks" + }, + "shortName": "PurgeQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_purge_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_PurgeQueue_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": "CloudTasks" + }, + "shortName": "ResumeQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_resume_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_ResumeQueue_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": "CloudTasks" + }, + "shortName": "ResumeQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_resume_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_ResumeQueue_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": "CloudTasks" + }, + "shortName": "RunTask" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_run_task_async.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_RunTask_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": "CloudTasks" + }, + "shortName": "RunTask" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_run_task_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_RunTask_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": "CloudTasks" + }, + "shortName": "SetIamPolicy" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_set_iam_policy_async.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_SetIamPolicy_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": "CloudTasks" + }, + "shortName": "SetIamPolicy" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_set_iam_policy_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_SetIamPolicy_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": "CloudTasks" + }, + "shortName": "TestIamPermissions" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_test_iam_permissions_async.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_TestIamPermissions_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": "CloudTasks" + }, + "shortName": "TestIamPermissions" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_test_iam_permissions_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_TestIamPermissions_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": "CloudTasks" + }, + "shortName": "UpdateQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_update_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_UpdateQueue_async", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudTasks" + }, + "shortName": "UpdateQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2_cloud_tasks_update_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2_CloudTasks_UpdateQueue_sync", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} diff --git a/samples/generated_samples/snippet_metadata_tasks_v2beta2.json b/samples/generated_samples/snippet_metadata_tasks_v2beta2.json new file mode 100644 index 00000000..967ebf31 --- /dev/null +++ b/samples/generated_samples/snippet_metadata_tasks_v2beta2.json @@ -0,0 +1,1772 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudTasks" + }, + "shortName": "AcknowledgeTask" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_acknowledge_task_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_AcknowledgeTask_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": "CloudTasks" + }, + "shortName": "AcknowledgeTask" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_acknowledge_task_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_AcknowledgeTask_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": "CloudTasks" + }, + "shortName": "CancelLease" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_cancel_lease_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_CancelLease_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": "CloudTasks" + }, + "shortName": "CancelLease" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_cancel_lease_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_CancelLease_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": "CloudTasks" + }, + "shortName": "CreateQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_create_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_CreateQueue_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": "CloudTasks" + }, + "shortName": "CreateQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_create_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_CreateQueue_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": "CloudTasks" + }, + "shortName": "CreateTask" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_create_task_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_CreateTask_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": "CloudTasks" + }, + "shortName": "CreateTask" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_create_task_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_CreateTask_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": "CloudTasks" + }, + "shortName": "DeleteQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_delete_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_DeleteQueue_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": "CloudTasks" + }, + "shortName": "DeleteQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_delete_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_DeleteQueue_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": "CloudTasks" + }, + "shortName": "DeleteTask" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_delete_task_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_DeleteTask_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": "CloudTasks" + }, + "shortName": "DeleteTask" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_delete_task_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_DeleteTask_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": "CloudTasks" + }, + "shortName": "GetIamPolicy" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_iam_policy_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_GetIamPolicy_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": "CloudTasks" + }, + "shortName": "GetIamPolicy" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_iam_policy_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_GetIamPolicy_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": "CloudTasks" + }, + "shortName": "GetQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_GetQueue_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": "CloudTasks" + }, + "shortName": "GetQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_GetQueue_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": "CloudTasks" + }, + "shortName": "GetTask" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_task_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_GetTask_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": "CloudTasks" + }, + "shortName": "GetTask" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_get_task_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_GetTask_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": "CloudTasks" + }, + "shortName": "LeaseTasks" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_lease_tasks_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_LeaseTasks_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": "CloudTasks" + }, + "shortName": "LeaseTasks" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_lease_tasks_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_LeaseTasks_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": "CloudTasks" + }, + "shortName": "ListQueues" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_list_queues_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_ListQueues_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": "CloudTasks" + }, + "shortName": "ListQueues" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_list_queues_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_ListQueues_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": "CloudTasks" + }, + "shortName": "ListTasks" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_list_tasks_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_ListTasks_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": "CloudTasks" + }, + "shortName": "ListTasks" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_list_tasks_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_ListTasks_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": "CloudTasks" + }, + "shortName": "PauseQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_pause_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_PauseQueue_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": "CloudTasks" + }, + "shortName": "PauseQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_pause_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_PauseQueue_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": "CloudTasks" + }, + "shortName": "PurgeQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_purge_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_PurgeQueue_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": "CloudTasks" + }, + "shortName": "PurgeQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_purge_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_PurgeQueue_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": "CloudTasks" + }, + "shortName": "RenewLease" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_renew_lease_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_RenewLease_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": "CloudTasks" + }, + "shortName": "RenewLease" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_renew_lease_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_RenewLease_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": "CloudTasks" + }, + "shortName": "ResumeQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_resume_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_ResumeQueue_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": "CloudTasks" + }, + "shortName": "ResumeQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_resume_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_ResumeQueue_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": "CloudTasks" + }, + "shortName": "RunTask" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_run_task_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_RunTask_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": "CloudTasks" + }, + "shortName": "RunTask" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_run_task_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_RunTask_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": "CloudTasks" + }, + "shortName": "SetIamPolicy" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_set_iam_policy_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_SetIamPolicy_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": "CloudTasks" + }, + "shortName": "SetIamPolicy" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_set_iam_policy_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_SetIamPolicy_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": "CloudTasks" + }, + "shortName": "TestIamPermissions" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_test_iam_permissions_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_TestIamPermissions_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": "CloudTasks" + }, + "shortName": "TestIamPermissions" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_test_iam_permissions_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_TestIamPermissions_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": "CloudTasks" + }, + "shortName": "UpdateQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_update_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_UpdateQueue_async", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudTasks" + }, + "shortName": "UpdateQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta2_cloud_tasks_update_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta2_CloudTasks_UpdateQueue_sync", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} diff --git a/samples/generated_samples/snippet_metadata_tasks_v2beta3.json b/samples/generated_samples/snippet_metadata_tasks_v2beta3.json new file mode 100644 index 00000000..0ce28a65 --- /dev/null +++ b/samples/generated_samples/snippet_metadata_tasks_v2beta3.json @@ -0,0 +1,1420 @@ +{ + "snippets": [ + { + "clientMethod": { + "async": true, + "method": { + "service": { + "shortName": "CloudTasks" + }, + "shortName": "CreateQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_create_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_CreateQueue_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": "CloudTasks" + }, + "shortName": "CreateQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_create_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_CreateQueue_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": "CloudTasks" + }, + "shortName": "CreateTask" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_create_task_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_CreateTask_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": "CloudTasks" + }, + "shortName": "CreateTask" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_create_task_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_CreateTask_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": "CloudTasks" + }, + "shortName": "DeleteQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_delete_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_DeleteQueue_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": "CloudTasks" + }, + "shortName": "DeleteQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_delete_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_DeleteQueue_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": "CloudTasks" + }, + "shortName": "DeleteTask" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_delete_task_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_DeleteTask_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": "CloudTasks" + }, + "shortName": "DeleteTask" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_delete_task_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_DeleteTask_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": "CloudTasks" + }, + "shortName": "GetIamPolicy" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_iam_policy_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_GetIamPolicy_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": "CloudTasks" + }, + "shortName": "GetIamPolicy" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_iam_policy_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_GetIamPolicy_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": "CloudTasks" + }, + "shortName": "GetQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_GetQueue_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": "CloudTasks" + }, + "shortName": "GetQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_GetQueue_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": "CloudTasks" + }, + "shortName": "GetTask" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_task_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_GetTask_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": "CloudTasks" + }, + "shortName": "GetTask" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_get_task_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_GetTask_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": "CloudTasks" + }, + "shortName": "ListQueues" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_list_queues_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_ListQueues_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": "CloudTasks" + }, + "shortName": "ListQueues" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_list_queues_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_ListQueues_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": "CloudTasks" + }, + "shortName": "ListTasks" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_list_tasks_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_ListTasks_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": "CloudTasks" + }, + "shortName": "ListTasks" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_list_tasks_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_ListTasks_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": "CloudTasks" + }, + "shortName": "PauseQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_pause_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_PauseQueue_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": "CloudTasks" + }, + "shortName": "PauseQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_pause_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_PauseQueue_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": "CloudTasks" + }, + "shortName": "PurgeQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_purge_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_PurgeQueue_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": "CloudTasks" + }, + "shortName": "PurgeQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_purge_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_PurgeQueue_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": "CloudTasks" + }, + "shortName": "ResumeQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_resume_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_ResumeQueue_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": "CloudTasks" + }, + "shortName": "ResumeQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_resume_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_ResumeQueue_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": "CloudTasks" + }, + "shortName": "RunTask" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_run_task_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_RunTask_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": "CloudTasks" + }, + "shortName": "RunTask" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_run_task_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_RunTask_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": "CloudTasks" + }, + "shortName": "SetIamPolicy" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_set_iam_policy_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_SetIamPolicy_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": "CloudTasks" + }, + "shortName": "SetIamPolicy" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_set_iam_policy_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_SetIamPolicy_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": "CloudTasks" + }, + "shortName": "TestIamPermissions" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_test_iam_permissions_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_TestIamPermissions_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": "CloudTasks" + }, + "shortName": "TestIamPermissions" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_test_iam_permissions_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_TestIamPermissions_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": "CloudTasks" + }, + "shortName": "UpdateQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_update_queue_async.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_UpdateQueue_async", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + }, + { + "clientMethod": { + "method": { + "service": { + "shortName": "CloudTasks" + }, + "shortName": "UpdateQueue" + } + }, + "file": "cloudtasks_generated_tasks_v2beta3_cloud_tasks_update_queue_sync.py", + "regionTag": "cloudtasks_generated_tasks_v2beta3_CloudTasks_UpdateQueue_sync", + "segments": [ + { + "end": 43, + "start": 27, + "type": "FULL" + }, + { + "end": 43, + "start": 27, + "type": "SHORT" + }, + { + "end": 33, + "start": 31, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 37, + "start": 34, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 40, + "start": 38, + "type": "REQUEST_EXECUTION" + }, + { + "end": 44, + "start": 41, + "type": "RESPONSE_HANDLING" + } + ] + } + ] +} From a4ffd280850b30ed1013ce1ba7872f92370755dc Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 14 Feb 2022 17:08:55 +0100 Subject: [PATCH 13/14] chore(deps): update dependency pytest to v7.0.1 (#221) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [![WhiteSource Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [pytest](https://docs.pytest.org/en/latest/) ([source](https://togithub.com/pytest-dev/pytest), [changelog](https://docs.pytest.org/en/stable/changelog.html)) | `==7.0.0` -> `==7.0.1` | [![age](https://badges.renovateapi.com/packages/pypi/pytest/7.0.1/age-slim)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://badges.renovateapi.com/packages/pypi/pytest/7.0.1/adoption-slim)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://badges.renovateapi.com/packages/pypi/pytest/7.0.1/compatibility-slim/7.0.0)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://badges.renovateapi.com/packages/pypi/pytest/7.0.1/confidence-slim/7.0.0)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes
pytest-dev/pytest ### [`v7.0.1`](https://togithub.com/pytest-dev/pytest/releases/7.0.1) [Compare Source](https://togithub.com/pytest-dev/pytest/compare/7.0.0...7.0.1) # pytest 7.0.1 (2022-02-11) ## Bug Fixes - [#​9608](https://togithub.com/pytest-dev/pytest/issues/9608): Fix invalid importing of `importlib.readers` in Python 3.9. - [#​9610](https://togithub.com/pytest-dev/pytest/issues/9610): Restore \[UnitTestFunction.obj]{.title-ref} to return unbound rather than bound method. Fixes a crash during a failed teardown in unittest TestCases with non-default \[\__init\_\_]{.title-ref}. Regressed in pytest 7.0.0. - [#​9636](https://togithub.com/pytest-dev/pytest/issues/9636): The `pythonpath` plugin was renamed to `python_path`. This avoids a conflict with the `pytest-pythonpath` plugin. - [#​9642](https://togithub.com/pytest-dev/pytest/issues/9642): Fix running tests by id with `::` in the parametrize portion. - [#​9643](https://togithub.com/pytest-dev/pytest/issues/9643): Delay issuing a `~pytest.PytestWarning`{.interpreted-text role="class"} about diamond inheritance involving `~pytest.Item`{.interpreted-text role="class"} and `~pytest.Collector`{.interpreted-text role="class"} so it can be filtered using `standard warning filters `{.interpreted-text role="ref"}.
--- ### Configuration 📅 **Schedule**: At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Renovate will not automatically rebase this PR, because other commits have been found. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] If you want to rebase/retry this PR, click this checkbox. --- This PR has been generated by [WhiteSource Renovate](https://renovate.whitesourcesoftware.com). View repository job log [here](https://app.renovatebot.com/dashboard#github/googleapis/python-tasks). --- samples/snippets/requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/snippets/requirements-test.txt b/samples/snippets/requirements-test.txt index 4a46ff60..c2845bff 100644 --- a/samples/snippets/requirements-test.txt +++ b/samples/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.0.0 +pytest==7.0.1 From a81243dbbb2ca9ede4359a7d7b670368b4c90405 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Wed, 23 Feb 2022 09:03:18 -0700 Subject: [PATCH 14/14] chore(main): release 2.8.0 (#215) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 12 ++++++++++++ setup.py | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d4ddec8..44b24684 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,18 @@ [1]: https://pypi.org/project/google-cloud-tasks/#history +## [2.8.0](https://github.com/googleapis/python-tasks/compare/v2.7.2...v2.8.0) (2022-02-14) + + +### Features + +* add api key support ([#214](https://github.com/googleapis/python-tasks/issues/214)) ([ce21598](https://github.com/googleapis/python-tasks/commit/ce215987f969cbc6347fb58cd2163394a6fc7f1c)) + + +### Bug Fixes + +* resolve DuplicateCredentialArgs error when using credentials_file ([8dd8aec](https://github.com/googleapis/python-tasks/commit/8dd8aec79d2302007e3f9511daeab817f05d2aa6)) + ### [2.7.2](https://www.github.com/googleapis/python-tasks/compare/v2.7.1...v2.7.2) (2022-01-08) diff --git a/setup.py b/setup.py index a99bf79e..c59bb405 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ name = "google-cloud-tasks" description = "Cloud Tasks API API client library" -version = "2.7.2" +version = "2.8.0" release_status = "Development Status :: 5 - Production/Stable" dependencies = [ # NOTE: Maintainers, please do not require google-api-core>=2.x.x