From ca7557af665f9c30c1495ed251fe740af8c75a94 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 7 Mar 2022 20:50:53 +0100 Subject: [PATCH 01/17] chore(deps): update dependency google-cloud-tasks to v2.8.1 (#236) --- 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 d5240056..f2b4ae7f 100644 --- a/samples/snippets/requirements.txt +++ b/samples/snippets/requirements.txt @@ -1 +1 @@ -google-cloud-tasks==2.8.0 +google-cloud-tasks==2.8.1 From 4d21898cf2191d1c1be87d4b1a3a4f85bc5a3957 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 13 Mar 2022 17:08:35 +0100 Subject: [PATCH 02/17] chore(deps): update dependency pytest to v7.1.0 (#238) --- 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 c2845bff..824a8a7a 100644 --- a/samples/snippets/requirements-test.txt +++ b/samples/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.0.1 +pytest==7.1.0 From 2144edf21c9826b49bdb2e15df0c1a6a055280cc Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 19 Mar 2022 11:56:57 +0100 Subject: [PATCH 03/17] chore(deps): update dependency pytest to v7.1.1 (#239) --- 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 824a8a7a..4f6bf643 100644 --- a/samples/snippets/requirements-test.txt +++ b/samples/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.1.0 +pytest==7.1.1 From 31276ed4f26fd6a20a1401d25f9b7a7daeb689d1 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 23 Mar 2022 11:32:44 -0600 Subject: [PATCH 04/17] chore(python): configure release-please on previous major versions (#241) Source-Link: https://github.com/googleapis/synthtool/commit/c1dd87e9287f8de99930d3046dd555c4d03384c6 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 2 +- .github/release-please.yml | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 44c78f7c..88076277 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:4e1991042fe54b991db9ca17c8fb386e61b22fe4d1472a568bf0fcac85dcf5d3 + digest: sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba diff --git a/.github/release-please.yml b/.github/release-please.yml index 466597e5..29601ad4 100644 --- a/.github/release-please.yml +++ b/.github/release-please.yml @@ -1,2 +1,11 @@ releaseType: python handleGHRelease: true +# NOTE: this section is generated by synthtool.languages.python +# See https://github.com/googleapis/synthtool/blob/master/synthtool/languages/python.py +branches: +- branch: v1 + handleGHRelease: true + releaseType: python +- branch: v0 + handleGHRelease: true + releaseType: python From d363ff16fb6a780785bc66a7b222696ea89d0547 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Tue, 29 Mar 2022 00:02:23 +0000 Subject: [PATCH 05/17] chore(python): use black==22.3.0 (#243) Source-Link: https://github.com/googleapis/synthtool/commit/6fab84af09f2cf89a031fd8671d1def6b2931b11 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe --- .github/.OwlBot.lock.yaml | 2 +- docs/conf.py | 13 +- .../services/cloud_tasks/async_client.py | 133 +- .../tasks_v2/services/cloud_tasks/client.py | 185 +- .../services/cloud_tasks/transports/base.py | 42 +- .../services/cloud_tasks/transports/grpc.py | 3 +- google/cloud/tasks_v2/types/cloudtasks.py | 153 +- google/cloud/tasks_v2/types/queue.py | 90 +- google/cloud/tasks_v2/types/target.py | 98 +- google/cloud/tasks_v2/types/task.py | 76 +- .../services/cloud_tasks/async_client.py | 159 +- .../services/cloud_tasks/client.py | 211 ++- .../services/cloud_tasks/transports/base.py | 58 +- .../services/cloud_tasks/transports/grpc.py | 3 +- .../cloud/tasks_v2beta2/types/cloudtasks.py | 239 ++- google/cloud/tasks_v2beta2/types/queue.py | 129 +- google/cloud/tasks_v2beta2/types/target.py | 63 +- google/cloud/tasks_v2beta2/types/task.py | 76 +- .../services/cloud_tasks/async_client.py | 133 +- .../services/cloud_tasks/client.py | 185 +- .../services/cloud_tasks/transports/base.py | 42 +- .../services/cloud_tasks/transports/grpc.py | 3 +- .../cloud/tasks_v2beta3/types/cloudtasks.py | 165 +- google/cloud/tasks_v2beta3/types/queue.py | 132 +- google/cloud/tasks_v2beta3/types/target.py | 112 +- google/cloud/tasks_v2beta3/types/task.py | 81 +- noxfile.py | 9 +- samples/snippets/create_http_task.py | 8 +- .../snippets/create_http_task_with_token.py | 8 +- samples/snippets/noxfile.py | 4 +- tests/unit/gapic/tasks_v2/test_cloud_tasks.py | 1416 ++++++++++---- .../gapic/tasks_v2beta2/test_cloud_tasks.py | 1649 +++++++++++++---- .../gapic/tasks_v2beta3/test_cloud_tasks.py | 1368 ++++++++++---- 33 files changed, 5506 insertions(+), 1542 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 88076277..87dd0061 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:2d13c2172a5d6129c861edaa48b60ead15aeaf58aa75e02d870c4cbdfa63aaba + digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe diff --git a/docs/conf.py b/docs/conf.py index 6a310b89..e6a9ea76 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -314,7 +314,13 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (root_doc, "google-cloud-tasks", "google-cloud-tasks Documentation", [author], 1,) + ( + root_doc, + "google-cloud-tasks", + "google-cloud-tasks Documentation", + [author], + 1, + ) ] # If true, show URL addresses after external links. @@ -355,7 +361,10 @@ intersphinx_mapping = { "python": ("https://python.readthedocs.org/en/latest/", None), "google-auth": ("https://googleapis.dev/python/google-auth/latest/", None), - "google.api_core": ("https://googleapis.dev/python/google-api-core/latest/", None,), + "google.api_core": ( + "https://googleapis.dev/python/google-api-core/latest/", + None, + ), "grpc": ("https://grpc.github.io/grpc/python/", None), "proto-plus": ("https://proto-plus-python.readthedocs.io/en/latest/", None), "protobuf": ("https://googleapis.dev/python/protobuf/latest/", None), diff --git a/google/cloud/tasks_v2/services/cloud_tasks/async_client.py b/google/cloud/tasks_v2/services/cloud_tasks/async_client.py index 7fc2d4a9..070459dd 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/async_client.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/async_client.py @@ -311,12 +311,20 @@ def sample_list_queues(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListQueuesAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -421,7 +429,12 @@ def sample_get_queue(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -543,7 +556,12 @@ def sample_create_queue(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -672,7 +690,12 @@ def sample_update_queue(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -776,7 +799,10 @@ def sample_delete_queue(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def purge_queue( @@ -874,7 +900,12 @@ def sample_purge_queue(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -976,7 +1007,12 @@ def sample_pause_queue(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1085,7 +1121,12 @@ def sample_resume_queue(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1222,7 +1263,9 @@ def sample_get_iam_policy(): if isinstance(request, dict): request = iam_policy_pb2.GetIamPolicyRequest(**request) elif not request: - request = iam_policy_pb2.GetIamPolicyRequest(resource=resource,) + request = iam_policy_pb2.GetIamPolicyRequest( + resource=resource, + ) # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. @@ -1249,7 +1292,12 @@ def sample_get_iam_policy(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1390,7 +1438,9 @@ def sample_set_iam_policy(): if isinstance(request, dict): request = iam_policy_pb2.SetIamPolicyRequest(**request) elif not request: - request = iam_policy_pb2.SetIamPolicyRequest(resource=resource,) + request = iam_policy_pb2.SetIamPolicyRequest( + resource=resource, + ) # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. @@ -1407,7 +1457,12 @@ def sample_set_iam_policy(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1501,7 +1556,8 @@ def sample_test_iam_permissions(): request = iam_policy_pb2.TestIamPermissionsRequest(**request) elif not request: request = iam_policy_pb2.TestIamPermissionsRequest( - resource=resource, permissions=permissions, + resource=resource, + permissions=permissions, ) # Wrap the RPC method; this adds retry and timeout information, @@ -1529,7 +1585,12 @@ def sample_test_iam_permissions(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1644,12 +1705,20 @@ def sample_list_tasks(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListTasksAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1749,7 +1818,12 @@ def sample_get_task(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1894,7 +1968,12 @@ def sample_create_task(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1991,7 +2070,10 @@ def sample_delete_task(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def run_task( @@ -2105,7 +2187,12 @@ def sample_run_task(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2119,7 +2206,9 @@ async def __aexit__(self, exc_type, exc, tb): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-tasks",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-tasks", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/tasks_v2/services/cloud_tasks/client.py b/google/cloud/tasks_v2/services/cloud_tasks/client.py index c1196cc2..96d9998a 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/client.py @@ -63,7 +63,10 @@ class CloudTasksClientMeta(type): _transport_registry["grpc"] = CloudTasksGrpcTransport _transport_registry["grpc_asyncio"] = CloudTasksGrpcAsyncIOTransport - def get_transport_class(cls, label: str = None,) -> Type[CloudTasksTransport]: + def get_transport_class( + cls, + label: str = None, + ) -> Type[CloudTasksTransport]: """Returns an appropriate transport class. Args: @@ -170,10 +173,16 @@ def transport(self) -> CloudTasksTransport: return self._transport @staticmethod - def queue_path(project: str, location: str, queue: str,) -> str: + def queue_path( + project: str, + location: str, + queue: str, + ) -> str: """Returns a fully-qualified queue string.""" return "projects/{project}/locations/{location}/queues/{queue}".format( - project=project, location=location, queue=queue, + project=project, + location=location, + queue=queue, ) @staticmethod @@ -186,10 +195,18 @@ def parse_queue_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def task_path(project: str, location: str, queue: str, task: str,) -> str: + def task_path( + project: str, + location: str, + queue: str, + task: str, + ) -> str: """Returns a fully-qualified task string.""" return "projects/{project}/locations/{location}/queues/{queue}/tasks/{task}".format( - project=project, location=location, queue=queue, task=task, + project=project, + location=location, + queue=queue, + task=task, ) @staticmethod @@ -202,7 +219,9 @@ def parse_task_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_billing_account_path(billing_account: str,) -> str: + def common_billing_account_path( + billing_account: str, + ) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -215,9 +234,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path(folder: str,) -> str: + def common_folder_path( + folder: str, + ) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format(folder=folder,) + return "folders/{folder}".format( + folder=folder, + ) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -226,9 +249,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path(organization: str,) -> str: + def common_organization_path( + organization: str, + ) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format(organization=organization,) + return "organizations/{organization}".format( + organization=organization, + ) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -237,9 +264,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path(project: str,) -> str: + def common_project_path( + project: str, + ) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format(project=project,) + return "projects/{project}".format( + project=project, + ) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -248,10 +279,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path(project: str, location: str,) -> str: + def common_location_path( + project: str, + location: str, + ) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) @staticmethod @@ -516,12 +551,20 @@ def sample_list_queues(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListQueuesPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -616,7 +659,12 @@ def sample_get_queue(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -738,7 +786,12 @@ def sample_create_queue(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -867,7 +920,12 @@ def sample_update_queue(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -961,7 +1019,10 @@ def sample_delete_queue(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def purge_queue( @@ -1059,7 +1120,12 @@ def sample_purge_queue(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1161,7 +1227,12 @@ def sample_pause_queue(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1270,7 +1341,12 @@ def sample_resume_queue(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1423,7 +1499,12 @@ def sample_get_iam_policy(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1580,7 +1661,12 @@ def sample_set_iam_policy(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1691,7 +1777,12 @@ def sample_test_iam_permissions(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1796,12 +1887,20 @@ def sample_list_tasks(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListTasksPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1891,7 +1990,12 @@ def sample_get_task(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2036,7 +2140,12 @@ def sample_create_task(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2123,7 +2232,10 @@ def sample_delete_task(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def run_task( @@ -2237,7 +2349,12 @@ def sample_run_task(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2258,7 +2375,9 @@ def __exit__(self, type, value, traceback): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-tasks",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-tasks", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/tasks_v2/services/cloud_tasks/transports/base.py b/google/cloud/tasks_v2/services/cloud_tasks/transports/base.py index 796513f3..77a75271 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/transports/base.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/transports/base.py @@ -36,7 +36,9 @@ try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-tasks",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-tasks", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() @@ -156,10 +158,14 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.create_queue: gapic_v1.method.wrap_method( - self.create_queue, default_timeout=10.0, client_info=client_info, + self.create_queue, + default_timeout=10.0, + client_info=client_info, ), self.update_queue: gapic_v1.method.wrap_method( - self.update_queue, default_timeout=10.0, client_info=client_info, + self.update_queue, + default_timeout=10.0, + client_info=client_info, ), self.delete_queue: gapic_v1.method.wrap_method( self.delete_queue, @@ -177,13 +183,19 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.purge_queue: gapic_v1.method.wrap_method( - self.purge_queue, default_timeout=10.0, client_info=client_info, + self.purge_queue, + default_timeout=10.0, + client_info=client_info, ), self.pause_queue: gapic_v1.method.wrap_method( - self.pause_queue, default_timeout=10.0, client_info=client_info, + self.pause_queue, + default_timeout=10.0, + client_info=client_info, ), self.resume_queue: gapic_v1.method.wrap_method( - self.resume_queue, default_timeout=10.0, client_info=client_info, + self.resume_queue, + default_timeout=10.0, + client_info=client_info, ), self.get_iam_policy: gapic_v1.method.wrap_method( self.get_iam_policy, @@ -201,7 +213,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.set_iam_policy: gapic_v1.method.wrap_method( - self.set_iam_policy, default_timeout=10.0, client_info=client_info, + self.set_iam_policy, + default_timeout=10.0, + client_info=client_info, ), self.test_iam_permissions: gapic_v1.method.wrap_method( self.test_iam_permissions, @@ -249,7 +263,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.create_task: gapic_v1.method.wrap_method( - self.create_task, default_timeout=10.0, client_info=client_info, + self.create_task, + default_timeout=10.0, + client_info=client_info, ), self.delete_task: gapic_v1.method.wrap_method( self.delete_task, @@ -267,16 +283,18 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.run_task: gapic_v1.method.wrap_method( - self.run_task, default_timeout=10.0, client_info=client_info, + self.run_task, + default_timeout=10.0, + client_info=client_info, ), } def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() 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 211d2ef0..35e13bf7 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/transports/grpc.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/transports/grpc.py @@ -232,8 +232,7 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service. - """ + """Return the channel designed to connect to this service.""" return self._grpc_channel @property diff --git a/google/cloud/tasks_v2/types/cloudtasks.py b/google/cloud/tasks_v2/types/cloudtasks.py index de7059f4..0b068d4b 100644 --- a/google/cloud/tasks_v2/types/cloudtasks.py +++ b/google/cloud/tasks_v2/types/cloudtasks.py @@ -84,10 +84,22 @@ class ListQueuesRequest(proto.Message): while iterating through pages. """ - parent = proto.Field(proto.STRING, number=1,) - filter = proto.Field(proto.STRING, number=2,) - page_size = proto.Field(proto.INT32, number=3,) - page_token = proto.Field(proto.STRING, number=4,) + parent = proto.Field( + proto.STRING, + number=1, + ) + filter = proto.Field( + proto.STRING, + number=2, + ) + page_size = proto.Field( + proto.INT32, + number=3, + ) + page_token = proto.Field( + proto.STRING, + number=4, + ) class ListQueuesResponse(proto.Message): @@ -114,8 +126,15 @@ class ListQueuesResponse(proto.Message): def raw_page(self): return self - queues = proto.RepeatedField(proto.MESSAGE, number=1, message=gct_queue.Queue,) - next_page_token = proto.Field(proto.STRING, number=2,) + queues = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=gct_queue.Queue, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) class GetQueueRequest(proto.Message): @@ -128,7 +147,10 @@ class GetQueueRequest(proto.Message): ``projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class CreateQueueRequest(proto.Message): @@ -151,8 +173,15 @@ class CreateQueueRequest(proto.Message): the same as an existing queue. """ - parent = proto.Field(proto.STRING, number=1,) - queue = proto.Field(proto.MESSAGE, number=2, message=gct_queue.Queue,) + parent = proto.Field( + proto.STRING, + number=1, + ) + queue = proto.Field( + proto.MESSAGE, + number=2, + message=gct_queue.Queue, + ) class UpdateQueueRequest(proto.Message): @@ -176,9 +205,15 @@ class UpdateQueueRequest(proto.Message): If empty, then all fields will be updated. """ - queue = proto.Field(proto.MESSAGE, number=1, message=gct_queue.Queue,) + queue = proto.Field( + proto.MESSAGE, + number=1, + message=gct_queue.Queue, + ) update_mask = proto.Field( - proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=2, + message=field_mask_pb2.FieldMask, ) @@ -192,7 +227,10 @@ class DeleteQueueRequest(proto.Message): ``projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class PurgeQueueRequest(proto.Message): @@ -205,7 +243,10 @@ class PurgeQueueRequest(proto.Message): ``projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class PauseQueueRequest(proto.Message): @@ -218,7 +259,10 @@ class PauseQueueRequest(proto.Message): ``projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class ResumeQueueRequest(proto.Message): @@ -231,7 +275,10 @@ class ResumeQueueRequest(proto.Message): ``projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class ListTasksRequest(proto.Message): @@ -282,10 +329,23 @@ class ListTasksRequest(proto.Message): The page token is valid for only 2 hours. """ - parent = proto.Field(proto.STRING, number=1,) - response_view = proto.Field(proto.ENUM, number=2, enum=gct_task.Task.View,) - page_size = proto.Field(proto.INT32, number=3,) - page_token = proto.Field(proto.STRING, number=4,) + parent = proto.Field( + proto.STRING, + number=1, + ) + response_view = proto.Field( + proto.ENUM, + number=2, + enum=gct_task.Task.View, + ) + page_size = proto.Field( + proto.INT32, + number=3, + ) + page_token = proto.Field( + proto.STRING, + number=4, + ) class ListTasksResponse(proto.Message): @@ -310,8 +370,15 @@ class ListTasksResponse(proto.Message): def raw_page(self): return self - tasks = proto.RepeatedField(proto.MESSAGE, number=1, message=gct_task.Task,) - next_page_token = proto.Field(proto.STRING, number=2,) + tasks = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=gct_task.Task, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) class GetTaskRequest(proto.Message): @@ -340,8 +407,15 @@ class GetTaskRequest(proto.Message): [Task][google.cloud.tasks.v2.Task] resource. """ - name = proto.Field(proto.STRING, number=1,) - response_view = proto.Field(proto.ENUM, number=2, enum=gct_task.Task.View,) + name = proto.Field( + proto.STRING, + number=1, + ) + response_view = proto.Field( + proto.ENUM, + number=2, + enum=gct_task.Task.View, + ) class CreateTaskRequest(proto.Message): @@ -412,9 +486,20 @@ class CreateTaskRequest(proto.Message): [Task][google.cloud.tasks.v2.Task] resource. """ - parent = proto.Field(proto.STRING, number=1,) - task = proto.Field(proto.MESSAGE, number=2, message=gct_task.Task,) - response_view = proto.Field(proto.ENUM, number=3, enum=gct_task.Task.View,) + parent = proto.Field( + proto.STRING, + number=1, + ) + task = proto.Field( + proto.MESSAGE, + number=2, + message=gct_task.Task, + ) + response_view = proto.Field( + proto.ENUM, + number=3, + enum=gct_task.Task.View, + ) class DeleteTaskRequest(proto.Message): @@ -427,7 +512,10 @@ class DeleteTaskRequest(proto.Message): ``projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class RunTaskRequest(proto.Message): @@ -456,8 +544,15 @@ class RunTaskRequest(proto.Message): [Task][google.cloud.tasks.v2.Task] resource. """ - name = proto.Field(proto.STRING, number=1,) - response_view = proto.Field(proto.ENUM, number=2, enum=gct_task.Task.View,) + name = proto.Field( + proto.STRING, + number=1, + ) + response_view = proto.Field( + proto.ENUM, + number=2, + enum=gct_task.Task.View, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/tasks_v2/types/queue.py b/google/cloud/tasks_v2/types/queue.py index f9ca584c..092383e3 100644 --- a/google/cloud/tasks_v2/types/queue.py +++ b/google/cloud/tasks_v2/types/queue.py @@ -22,7 +22,12 @@ __protobuf__ = proto.module( package="google.cloud.tasks.v2", - manifest={"Queue", "RateLimits", "RetryConfig", "StackdriverLoggingConfig",}, + manifest={ + "Queue", + "RateLimits", + "RetryConfig", + "StackdriverLoggingConfig", + }, ) @@ -149,16 +154,39 @@ class State(proto.Enum): PAUSED = 2 DISABLED = 3 - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) app_engine_routing_override = proto.Field( - proto.MESSAGE, number=2, message=target.AppEngineRouting, + proto.MESSAGE, + number=2, + message=target.AppEngineRouting, + ) + rate_limits = proto.Field( + proto.MESSAGE, + number=3, + message="RateLimits", + ) + retry_config = proto.Field( + proto.MESSAGE, + number=4, + message="RetryConfig", + ) + state = proto.Field( + proto.ENUM, + number=5, + enum=State, + ) + purge_time = proto.Field( + proto.MESSAGE, + number=6, + message=timestamp_pb2.Timestamp, ) - rate_limits = proto.Field(proto.MESSAGE, number=3, message="RateLimits",) - retry_config = proto.Field(proto.MESSAGE, number=4, message="RetryConfig",) - state = proto.Field(proto.ENUM, number=5, enum=State,) - purge_time = proto.Field(proto.MESSAGE, number=6, message=timestamp_pb2.Timestamp,) stackdriver_logging_config = proto.Field( - proto.MESSAGE, number=9, message="StackdriverLoggingConfig", + proto.MESSAGE, + number=9, + message="StackdriverLoggingConfig", ) @@ -238,9 +266,18 @@ class RateLimits(proto.Message): queue.yaml/xml `__. """ - max_dispatches_per_second = proto.Field(proto.DOUBLE, number=1,) - max_burst_size = proto.Field(proto.INT32, number=2,) - max_concurrent_dispatches = proto.Field(proto.INT32, number=3,) + max_dispatches_per_second = proto.Field( + proto.DOUBLE, + number=1, + ) + max_burst_size = proto.Field( + proto.INT32, + number=2, + ) + max_concurrent_dispatches = proto.Field( + proto.INT32, + number=3, + ) class RetryConfig(proto.Message): @@ -351,13 +388,29 @@ class RetryConfig(proto.Message): queue.yaml/xml `__. """ - max_attempts = proto.Field(proto.INT32, number=1,) + max_attempts = proto.Field( + proto.INT32, + number=1, + ) max_retry_duration = proto.Field( - proto.MESSAGE, number=2, message=duration_pb2.Duration, + proto.MESSAGE, + number=2, + message=duration_pb2.Duration, + ) + min_backoff = proto.Field( + proto.MESSAGE, + number=3, + message=duration_pb2.Duration, + ) + max_backoff = proto.Field( + proto.MESSAGE, + number=4, + message=duration_pb2.Duration, + ) + max_doublings = proto.Field( + proto.INT32, + number=5, ) - min_backoff = proto.Field(proto.MESSAGE, number=3, message=duration_pb2.Duration,) - max_backoff = proto.Field(proto.MESSAGE, number=4, message=duration_pb2.Duration,) - max_doublings = proto.Field(proto.INT32, number=5,) class StackdriverLoggingConfig(proto.Message): @@ -373,7 +426,10 @@ class StackdriverLoggingConfig(proto.Message): 0.0 is the default and means that no operations are logged. """ - sampling_ratio = proto.Field(proto.DOUBLE, number=1,) + sampling_ratio = proto.Field( + proto.DOUBLE, + number=1, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/tasks_v2/types/target.py b/google/cloud/tasks_v2/types/target.py index d95381aa..e66b324b 100644 --- a/google/cloud/tasks_v2/types/target.py +++ b/google/cloud/tasks_v2/types/target.py @@ -165,15 +165,35 @@ class HttpRequest(proto.Message): This field is a member of `oneof`_ ``authorization_header``. """ - url = proto.Field(proto.STRING, number=1,) - http_method = proto.Field(proto.ENUM, number=2, enum="HttpMethod",) - headers = proto.MapField(proto.STRING, proto.STRING, number=3,) - body = proto.Field(proto.BYTES, number=4,) + url = proto.Field( + proto.STRING, + number=1, + ) + http_method = proto.Field( + proto.ENUM, + number=2, + enum="HttpMethod", + ) + headers = proto.MapField( + proto.STRING, + proto.STRING, + number=3, + ) + body = proto.Field( + proto.BYTES, + number=4, + ) oauth_token = proto.Field( - proto.MESSAGE, number=5, oneof="authorization_header", message="OAuthToken", + proto.MESSAGE, + number=5, + oneof="authorization_header", + message="OAuthToken", ) oidc_token = proto.Field( - proto.MESSAGE, number=6, oneof="authorization_header", message="OidcToken", + proto.MESSAGE, + number=6, + oneof="authorization_header", + message="OidcToken", ) @@ -328,13 +348,29 @@ class AppEngineHttpRequest(proto.Message): incompatible [HttpMethod][google.cloud.tasks.v2.HttpMethod]. """ - http_method = proto.Field(proto.ENUM, number=1, enum="HttpMethod",) + http_method = proto.Field( + proto.ENUM, + number=1, + enum="HttpMethod", + ) app_engine_routing = proto.Field( - proto.MESSAGE, number=2, message="AppEngineRouting", + proto.MESSAGE, + number=2, + message="AppEngineRouting", + ) + relative_uri = proto.Field( + proto.STRING, + number=3, + ) + headers = proto.MapField( + proto.STRING, + proto.STRING, + number=4, + ) + body = proto.Field( + proto.BYTES, + number=5, ) - relative_uri = proto.Field(proto.STRING, number=3,) - headers = proto.MapField(proto.STRING, proto.STRING, number=4,) - body = proto.Field(proto.BYTES, number=5,) class AppEngineRouting(proto.Message): @@ -440,10 +476,22 @@ class AppEngineRouting(proto.Message): Routed `__. """ - service = proto.Field(proto.STRING, number=1,) - version = proto.Field(proto.STRING, number=2,) - instance = proto.Field(proto.STRING, number=3,) - host = proto.Field(proto.STRING, number=4,) + service = proto.Field( + proto.STRING, + number=1, + ) + version = proto.Field( + proto.STRING, + number=2, + ) + instance = proto.Field( + proto.STRING, + number=3, + ) + host = proto.Field( + proto.STRING, + number=4, + ) class OAuthToken(proto.Message): @@ -467,8 +515,14 @@ class OAuthToken(proto.Message): will be used. """ - service_account_email = proto.Field(proto.STRING, number=1,) - scope = proto.Field(proto.STRING, number=2,) + service_account_email = proto.Field( + proto.STRING, + number=1, + ) + scope = proto.Field( + proto.STRING, + number=2, + ) class OidcToken(proto.Message): @@ -492,8 +546,14 @@ class OidcToken(proto.Message): target will be used. """ - service_account_email = proto.Field(proto.STRING, number=1,) - audience = proto.Field(proto.STRING, number=2,) + service_account_email = proto.Field( + proto.STRING, + number=1, + ) + audience = proto.Field( + proto.STRING, + number=2, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/tasks_v2/types/task.py b/google/cloud/tasks_v2/types/task.py index b744c452..69357fd2 100644 --- a/google/cloud/tasks_v2/types/task.py +++ b/google/cloud/tasks_v2/types/task.py @@ -22,7 +22,11 @@ __protobuf__ = proto.module( - package="google.cloud.tasks.v2", manifest={"Task", "Attempt",}, + package="google.cloud.tasks.v2", + manifest={ + "Task", + "Attempt", + }, ) @@ -163,7 +167,10 @@ class View(proto.Enum): BASIC = 1 FULL = 2 - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) app_engine_http_request = proto.Field( proto.MESSAGE, number=2, @@ -171,20 +178,49 @@ class View(proto.Enum): message=target.AppEngineHttpRequest, ) http_request = proto.Field( - proto.MESSAGE, number=3, oneof="message_type", message=target.HttpRequest, + proto.MESSAGE, + number=3, + oneof="message_type", + message=target.HttpRequest, ) schedule_time = proto.Field( - proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=4, + message=timestamp_pb2.Timestamp, + ) + create_time = proto.Field( + proto.MESSAGE, + number=5, + message=timestamp_pb2.Timestamp, ) - create_time = proto.Field(proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp,) dispatch_deadline = proto.Field( - proto.MESSAGE, number=6, message=duration_pb2.Duration, + proto.MESSAGE, + number=6, + message=duration_pb2.Duration, + ) + dispatch_count = proto.Field( + proto.INT32, + number=7, + ) + response_count = proto.Field( + proto.INT32, + number=8, + ) + first_attempt = proto.Field( + proto.MESSAGE, + number=9, + message="Attempt", + ) + last_attempt = proto.Field( + proto.MESSAGE, + number=10, + message="Attempt", + ) + view = proto.Field( + proto.ENUM, + number=11, + enum=View, ) - dispatch_count = proto.Field(proto.INT32, number=7,) - response_count = proto.Field(proto.INT32, number=8,) - first_attempt = proto.Field(proto.MESSAGE, number=9, message="Attempt",) - last_attempt = proto.Field(proto.MESSAGE, number=10, message="Attempt",) - view = proto.Field(proto.ENUM, number=11, enum=View,) class Attempt(proto.Message): @@ -216,15 +252,25 @@ class Attempt(proto.Message): """ schedule_time = proto.Field( - proto.MESSAGE, number=1, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=1, + message=timestamp_pb2.Timestamp, ) dispatch_time = proto.Field( - proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, ) response_time = proto.Field( - proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + response_status = proto.Field( + proto.MESSAGE, + number=4, + message=status_pb2.Status, ) - response_status = proto.Field(proto.MESSAGE, number=4, message=status_pb2.Status,) __all__ = tuple(sorted(__protobuf__.manifest)) 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 97e616af..ca826dd3 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py @@ -311,12 +311,20 @@ def sample_list_queues(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListQueuesAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -421,7 +429,12 @@ def sample_get_queue(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -543,7 +556,12 @@ def sample_create_queue(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -673,7 +691,12 @@ def sample_update_queue(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -777,7 +800,10 @@ def sample_delete_queue(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def purge_queue( @@ -875,7 +901,12 @@ def sample_purge_queue(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -977,7 +1008,12 @@ def sample_pause_queue(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1086,7 +1122,12 @@ def sample_resume_queue(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1223,7 +1264,9 @@ def sample_get_iam_policy(): if isinstance(request, dict): request = iam_policy_pb2.GetIamPolicyRequest(**request) elif not request: - request = iam_policy_pb2.GetIamPolicyRequest(resource=resource,) + request = iam_policy_pb2.GetIamPolicyRequest( + resource=resource, + ) # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. @@ -1250,7 +1293,12 @@ def sample_get_iam_policy(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1391,7 +1439,9 @@ def sample_set_iam_policy(): if isinstance(request, dict): request = iam_policy_pb2.SetIamPolicyRequest(**request) elif not request: - request = iam_policy_pb2.SetIamPolicyRequest(resource=resource,) + request = iam_policy_pb2.SetIamPolicyRequest( + resource=resource, + ) # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. @@ -1408,7 +1458,12 @@ def sample_set_iam_policy(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1502,7 +1557,8 @@ def sample_test_iam_permissions(): request = iam_policy_pb2.TestIamPermissionsRequest(**request) elif not request: request = iam_policy_pb2.TestIamPermissionsRequest( - resource=resource, permissions=permissions, + resource=resource, + permissions=permissions, ) # Wrap the RPC method; this adds retry and timeout information, @@ -1530,7 +1586,12 @@ def sample_test_iam_permissions(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1645,12 +1706,20 @@ def sample_list_tasks(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListTasksAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1750,7 +1819,12 @@ def sample_get_task(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1899,7 +1973,12 @@ def sample_create_task(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1996,7 +2075,10 @@ def sample_delete_task(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def lease_tasks( @@ -2142,7 +2224,12 @@ def sample_lease_tasks(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2257,7 +2344,10 @@ def sample_acknowledge_task(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def renew_lease( @@ -2380,7 +2470,12 @@ def sample_renew_lease(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2494,7 +2589,12 @@ def sample_cancel_lease(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2616,7 +2716,12 @@ def sample_run_task(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2630,7 +2735,9 @@ async def __aexit__(self, exc_type, exc, tb): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-tasks",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-tasks", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py b/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py index 1f94e6a4..1144de2e 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py @@ -63,7 +63,10 @@ class CloudTasksClientMeta(type): _transport_registry["grpc"] = CloudTasksGrpcTransport _transport_registry["grpc_asyncio"] = CloudTasksGrpcAsyncIOTransport - def get_transport_class(cls, label: str = None,) -> Type[CloudTasksTransport]: + def get_transport_class( + cls, + label: str = None, + ) -> Type[CloudTasksTransport]: """Returns an appropriate transport class. Args: @@ -170,10 +173,16 @@ def transport(self) -> CloudTasksTransport: return self._transport @staticmethod - def queue_path(project: str, location: str, queue: str,) -> str: + def queue_path( + project: str, + location: str, + queue: str, + ) -> str: """Returns a fully-qualified queue string.""" return "projects/{project}/locations/{location}/queues/{queue}".format( - project=project, location=location, queue=queue, + project=project, + location=location, + queue=queue, ) @staticmethod @@ -186,10 +195,18 @@ def parse_queue_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def task_path(project: str, location: str, queue: str, task: str,) -> str: + def task_path( + project: str, + location: str, + queue: str, + task: str, + ) -> str: """Returns a fully-qualified task string.""" return "projects/{project}/locations/{location}/queues/{queue}/tasks/{task}".format( - project=project, location=location, queue=queue, task=task, + project=project, + location=location, + queue=queue, + task=task, ) @staticmethod @@ -202,7 +219,9 @@ def parse_task_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_billing_account_path(billing_account: str,) -> str: + def common_billing_account_path( + billing_account: str, + ) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -215,9 +234,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path(folder: str,) -> str: + def common_folder_path( + folder: str, + ) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format(folder=folder,) + return "folders/{folder}".format( + folder=folder, + ) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -226,9 +249,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path(organization: str,) -> str: + def common_organization_path( + organization: str, + ) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format(organization=organization,) + return "organizations/{organization}".format( + organization=organization, + ) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -237,9 +264,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path(project: str,) -> str: + def common_project_path( + project: str, + ) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format(project=project,) + return "projects/{project}".format( + project=project, + ) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -248,10 +279,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path(project: str, location: str,) -> str: + def common_location_path( + project: str, + location: str, + ) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) @staticmethod @@ -516,12 +551,20 @@ def sample_list_queues(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListQueuesPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -616,7 +659,12 @@ def sample_get_queue(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -738,7 +786,12 @@ def sample_create_queue(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -868,7 +921,12 @@ def sample_update_queue(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -962,7 +1020,10 @@ def sample_delete_queue(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def purge_queue( @@ -1060,7 +1121,12 @@ def sample_purge_queue(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1162,7 +1228,12 @@ def sample_pause_queue(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1271,7 +1342,12 @@ def sample_resume_queue(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1424,7 +1500,12 @@ def sample_get_iam_policy(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1581,7 +1662,12 @@ def sample_set_iam_policy(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1692,7 +1778,12 @@ def sample_test_iam_permissions(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1797,12 +1888,20 @@ def sample_list_tasks(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListTasksPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1892,7 +1991,12 @@ def sample_get_task(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2041,7 +2145,12 @@ def sample_create_task(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2128,7 +2237,10 @@ def sample_delete_task(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def lease_tasks( @@ -2274,7 +2386,12 @@ def sample_lease_tasks(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2389,7 +2506,10 @@ def sample_acknowledge_task(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def renew_lease( @@ -2512,7 +2632,12 @@ def sample_renew_lease(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2626,7 +2751,12 @@ def sample_cancel_lease(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2748,7 +2878,12 @@ def sample_run_task(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2769,7 +2904,9 @@ def __exit__(self, type, value, traceback): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-tasks",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-tasks", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/base.py b/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/base.py index 4d608810..8c1904e4 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/base.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/base.py @@ -36,7 +36,9 @@ try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-tasks",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-tasks", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() @@ -156,10 +158,14 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.create_queue: gapic_v1.method.wrap_method( - self.create_queue, default_timeout=20.0, client_info=client_info, + self.create_queue, + default_timeout=20.0, + client_info=client_info, ), self.update_queue: gapic_v1.method.wrap_method( - self.update_queue, default_timeout=20.0, client_info=client_info, + self.update_queue, + default_timeout=20.0, + client_info=client_info, ), self.delete_queue: gapic_v1.method.wrap_method( self.delete_queue, @@ -177,13 +183,19 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.purge_queue: gapic_v1.method.wrap_method( - self.purge_queue, default_timeout=20.0, client_info=client_info, + self.purge_queue, + default_timeout=20.0, + client_info=client_info, ), self.pause_queue: gapic_v1.method.wrap_method( - self.pause_queue, default_timeout=20.0, client_info=client_info, + self.pause_queue, + default_timeout=20.0, + client_info=client_info, ), self.resume_queue: gapic_v1.method.wrap_method( - self.resume_queue, default_timeout=20.0, client_info=client_info, + self.resume_queue, + default_timeout=20.0, + client_info=client_info, ), self.get_iam_policy: gapic_v1.method.wrap_method( self.get_iam_policy, @@ -201,7 +213,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.set_iam_policy: gapic_v1.method.wrap_method( - self.set_iam_policy, default_timeout=20.0, client_info=client_info, + self.set_iam_policy, + default_timeout=20.0, + client_info=client_info, ), self.test_iam_permissions: gapic_v1.method.wrap_method( self.test_iam_permissions, @@ -249,7 +263,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.create_task: gapic_v1.method.wrap_method( - self.create_task, default_timeout=20.0, client_info=client_info, + self.create_task, + default_timeout=20.0, + client_info=client_info, ), self.delete_task: gapic_v1.method.wrap_method( self.delete_task, @@ -267,28 +283,38 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.lease_tasks: gapic_v1.method.wrap_method( - self.lease_tasks, default_timeout=20.0, client_info=client_info, + self.lease_tasks, + default_timeout=20.0, + client_info=client_info, ), self.acknowledge_task: gapic_v1.method.wrap_method( - self.acknowledge_task, default_timeout=20.0, client_info=client_info, + self.acknowledge_task, + default_timeout=20.0, + client_info=client_info, ), self.renew_lease: gapic_v1.method.wrap_method( - self.renew_lease, default_timeout=20.0, client_info=client_info, + self.renew_lease, + default_timeout=20.0, + client_info=client_info, ), self.cancel_lease: gapic_v1.method.wrap_method( - self.cancel_lease, default_timeout=20.0, client_info=client_info, + self.cancel_lease, + default_timeout=20.0, + client_info=client_info, ), self.run_task: gapic_v1.method.wrap_method( - self.run_task, default_timeout=20.0, client_info=client_info, + self.run_task, + default_timeout=20.0, + client_info=client_info, ), } def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() 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 bdefcda1..e754b001 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/grpc.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/grpc.py @@ -232,8 +232,7 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service. - """ + """Return the channel designed to connect to this service.""" return self._grpc_channel @property diff --git a/google/cloud/tasks_v2beta2/types/cloudtasks.py b/google/cloud/tasks_v2beta2/types/cloudtasks.py index 2c22e59c..087aa7cc 100644 --- a/google/cloud/tasks_v2beta2/types/cloudtasks.py +++ b/google/cloud/tasks_v2beta2/types/cloudtasks.py @@ -96,11 +96,27 @@ class ListQueuesRequest(proto.Message): returned only if it was explicitly specified in the mask. """ - parent = proto.Field(proto.STRING, number=1,) - filter = proto.Field(proto.STRING, number=2,) - page_size = proto.Field(proto.INT32, number=3,) - page_token = proto.Field(proto.STRING, number=4,) - read_mask = proto.Field(proto.MESSAGE, number=5, message=field_mask_pb2.FieldMask,) + parent = proto.Field( + proto.STRING, + number=1, + ) + filter = proto.Field( + proto.STRING, + number=2, + ) + page_size = proto.Field( + proto.INT32, + number=3, + ) + page_token = proto.Field( + proto.STRING, + number=4, + ) + read_mask = proto.Field( + proto.MESSAGE, + number=5, + message=field_mask_pb2.FieldMask, + ) class ListQueuesResponse(proto.Message): @@ -127,8 +143,15 @@ class ListQueuesResponse(proto.Message): def raw_page(self): return self - queues = proto.RepeatedField(proto.MESSAGE, number=1, message=gct_queue.Queue,) - next_page_token = proto.Field(proto.STRING, number=2,) + queues = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=gct_queue.Queue, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) class GetQueueRequest(proto.Message): @@ -146,8 +169,15 @@ class GetQueueRequest(proto.Message): returned only if it was explicitly specified in the mask. """ - name = proto.Field(proto.STRING, number=1,) - read_mask = proto.Field(proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask,) + name = proto.Field( + proto.STRING, + number=1, + ) + read_mask = proto.Field( + proto.MESSAGE, + number=2, + message=field_mask_pb2.FieldMask, + ) class CreateQueueRequest(proto.Message): @@ -170,8 +200,15 @@ class CreateQueueRequest(proto.Message): be the same as an existing queue. """ - parent = proto.Field(proto.STRING, number=1,) - queue = proto.Field(proto.MESSAGE, number=2, message=gct_queue.Queue,) + parent = proto.Field( + proto.STRING, + number=1, + ) + queue = proto.Field( + proto.MESSAGE, + number=2, + message=gct_queue.Queue, + ) class UpdateQueueRequest(proto.Message): @@ -195,9 +232,15 @@ class UpdateQueueRequest(proto.Message): If empty, then all fields will be updated. """ - queue = proto.Field(proto.MESSAGE, number=1, message=gct_queue.Queue,) + queue = proto.Field( + proto.MESSAGE, + number=1, + message=gct_queue.Queue, + ) update_mask = proto.Field( - proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=2, + message=field_mask_pb2.FieldMask, ) @@ -211,7 +254,10 @@ class DeleteQueueRequest(proto.Message): ``projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class PurgeQueueRequest(proto.Message): @@ -224,7 +270,10 @@ class PurgeQueueRequest(proto.Message): ``projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class PauseQueueRequest(proto.Message): @@ -237,7 +286,10 @@ class PauseQueueRequest(proto.Message): ``projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class ResumeQueueRequest(proto.Message): @@ -250,7 +302,10 @@ class ResumeQueueRequest(proto.Message): ``projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class ListTasksRequest(proto.Message): @@ -301,10 +356,23 @@ class ListTasksRequest(proto.Message): The page token is valid for only 2 hours. """ - parent = proto.Field(proto.STRING, number=1,) - response_view = proto.Field(proto.ENUM, number=2, enum=gct_task.Task.View,) - page_size = proto.Field(proto.INT32, number=4,) - page_token = proto.Field(proto.STRING, number=5,) + parent = proto.Field( + proto.STRING, + number=1, + ) + response_view = proto.Field( + proto.ENUM, + number=2, + enum=gct_task.Task.View, + ) + page_size = proto.Field( + proto.INT32, + number=4, + ) + page_token = proto.Field( + proto.STRING, + number=5, + ) class ListTasksResponse(proto.Message): @@ -329,8 +397,15 @@ class ListTasksResponse(proto.Message): def raw_page(self): return self - tasks = proto.RepeatedField(proto.MESSAGE, number=1, message=gct_task.Task,) - next_page_token = proto.Field(proto.STRING, number=2,) + tasks = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=gct_task.Task, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) class GetTaskRequest(proto.Message): @@ -359,8 +434,15 @@ class GetTaskRequest(proto.Message): [Task][google.cloud.tasks.v2beta2.Task] resource. """ - name = proto.Field(proto.STRING, number=1,) - response_view = proto.Field(proto.ENUM, number=2, enum=gct_task.Task.View,) + name = proto.Field( + proto.STRING, + number=1, + ) + response_view = proto.Field( + proto.ENUM, + number=2, + enum=gct_task.Task.View, + ) class CreateTaskRequest(proto.Message): @@ -432,9 +514,20 @@ class CreateTaskRequest(proto.Message): [Task][google.cloud.tasks.v2beta2.Task] resource. """ - parent = proto.Field(proto.STRING, number=1,) - task = proto.Field(proto.MESSAGE, number=2, message=gct_task.Task,) - response_view = proto.Field(proto.ENUM, number=3, enum=gct_task.Task.View,) + parent = proto.Field( + proto.STRING, + number=1, + ) + task = proto.Field( + proto.MESSAGE, + number=2, + message=gct_task.Task, + ) + response_view = proto.Field( + proto.ENUM, + number=3, + enum=gct_task.Task.View, + ) class DeleteTaskRequest(proto.Message): @@ -447,7 +540,10 @@ class DeleteTaskRequest(proto.Message): ``projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class LeaseTasksRequest(proto.Message): @@ -551,13 +647,28 @@ class LeaseTasksRequest(proto.Message): displayed as empty in Cloud Tasks. """ - parent = proto.Field(proto.STRING, number=1,) - max_tasks = proto.Field(proto.INT32, number=2,) + parent = proto.Field( + proto.STRING, + number=1, + ) + max_tasks = proto.Field( + proto.INT32, + number=2, + ) lease_duration = proto.Field( - proto.MESSAGE, number=3, message=duration_pb2.Duration, + proto.MESSAGE, + number=3, + message=duration_pb2.Duration, + ) + response_view = proto.Field( + proto.ENUM, + number=4, + enum=gct_task.Task.View, + ) + filter = proto.Field( + proto.STRING, + number=5, ) - response_view = proto.Field(proto.ENUM, number=4, enum=gct_task.Task.View,) - filter = proto.Field(proto.STRING, number=5,) class LeaseTasksResponse(proto.Message): @@ -569,7 +680,11 @@ class LeaseTasksResponse(proto.Message): The leased tasks. """ - tasks = proto.RepeatedField(proto.MESSAGE, number=1, message=gct_task.Task,) + tasks = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=gct_task.Task, + ) class AcknowledgeTaskRequest(proto.Message): @@ -591,9 +706,14 @@ class AcknowledgeTaskRequest(proto.Message): currently holds the lease. """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) schedule_time = proto.Field( - proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, ) @@ -637,14 +757,25 @@ class RenewLeaseRequest(proto.Message): [Task][google.cloud.tasks.v2beta2.Task] resource. """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) schedule_time = proto.Field( - proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, ) lease_duration = proto.Field( - proto.MESSAGE, number=3, message=duration_pb2.Duration, + proto.MESSAGE, + number=3, + message=duration_pb2.Duration, + ) + response_view = proto.Field( + proto.ENUM, + number=4, + enum=gct_task.Task.View, ) - response_view = proto.Field(proto.ENUM, number=4, enum=gct_task.Task.View,) class CancelLeaseRequest(proto.Message): @@ -682,11 +813,20 @@ class CancelLeaseRequest(proto.Message): [Task][google.cloud.tasks.v2beta2.Task] resource. """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) schedule_time = proto.Field( - proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + response_view = proto.Field( + proto.ENUM, + number=3, + enum=gct_task.Task.View, ) - response_view = proto.Field(proto.ENUM, number=3, enum=gct_task.Task.View,) class RunTaskRequest(proto.Message): @@ -715,8 +855,15 @@ class RunTaskRequest(proto.Message): [Task][google.cloud.tasks.v2beta2.Task] resource. """ - name = proto.Field(proto.STRING, number=1,) - response_view = proto.Field(proto.ENUM, number=2, enum=gct_task.Task.View,) + name = proto.Field( + proto.STRING, + number=1, + ) + response_view = proto.Field( + proto.ENUM, + number=2, + enum=gct_task.Task.View, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/tasks_v2beta2/types/queue.py b/google/cloud/tasks_v2beta2/types/queue.py index 59db08cc..da665292 100644 --- a/google/cloud/tasks_v2beta2/types/queue.py +++ b/google/cloud/tasks_v2beta2/types/queue.py @@ -22,7 +22,12 @@ __protobuf__ = proto.module( package="google.cloud.tasks.v2beta2", - manifest={"Queue", "RateLimits", "RetryConfig", "QueueStats",}, + manifest={ + "Queue", + "RateLimits", + "RetryConfig", + "QueueStats", + }, ) @@ -175,7 +180,10 @@ class State(proto.Enum): PAUSED = 2 DISABLED = 3 - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) app_engine_http_target = proto.Field( proto.MESSAGE, number=3, @@ -183,17 +191,46 @@ class State(proto.Enum): message=target.AppEngineHttpTarget, ) pull_target = proto.Field( - proto.MESSAGE, number=4, oneof="target_type", message=target.PullTarget, + proto.MESSAGE, + number=4, + oneof="target_type", + message=target.PullTarget, + ) + rate_limits = proto.Field( + proto.MESSAGE, + number=5, + message="RateLimits", + ) + retry_config = proto.Field( + proto.MESSAGE, + number=6, + message="RetryConfig", + ) + state = proto.Field( + proto.ENUM, + number=7, + enum=State, + ) + purge_time = proto.Field( + proto.MESSAGE, + number=8, + message=timestamp_pb2.Timestamp, + ) + task_ttl = proto.Field( + proto.MESSAGE, + number=9, + message=duration_pb2.Duration, ) - rate_limits = proto.Field(proto.MESSAGE, number=5, message="RateLimits",) - retry_config = proto.Field(proto.MESSAGE, number=6, message="RetryConfig",) - state = proto.Field(proto.ENUM, number=7, enum=State,) - purge_time = proto.Field(proto.MESSAGE, number=8, message=timestamp_pb2.Timestamp,) - task_ttl = proto.Field(proto.MESSAGE, number=9, message=duration_pb2.Duration,) tombstone_ttl = proto.Field( - proto.MESSAGE, number=10, message=duration_pb2.Duration, + proto.MESSAGE, + number=10, + message=duration_pb2.Duration, + ) + stats = proto.Field( + proto.MESSAGE, + number=16, + message="QueueStats", ) - stats = proto.Field(proto.MESSAGE, number=16, message="QueueStats",) class RateLimits(proto.Message): @@ -287,9 +324,18 @@ class RateLimits(proto.Message): queue.yaml/xml `__. """ - max_tasks_dispatched_per_second = proto.Field(proto.DOUBLE, number=1,) - max_burst_size = proto.Field(proto.INT32, number=2,) - max_concurrent_tasks = proto.Field(proto.INT32, number=3,) + max_tasks_dispatched_per_second = proto.Field( + proto.DOUBLE, + number=1, + ) + max_burst_size = proto.Field( + proto.INT32, + number=2, + ) + max_concurrent_tasks = proto.Field( + proto.INT32, + number=3, + ) class RetryConfig(proto.Message): @@ -418,14 +464,35 @@ class RetryConfig(proto.Message): queue.yaml/xml `__. """ - max_attempts = proto.Field(proto.INT32, number=1, oneof="num_attempts",) - unlimited_attempts = proto.Field(proto.BOOL, number=2, oneof="num_attempts",) + max_attempts = proto.Field( + proto.INT32, + number=1, + oneof="num_attempts", + ) + unlimited_attempts = proto.Field( + proto.BOOL, + number=2, + oneof="num_attempts", + ) max_retry_duration = proto.Field( - proto.MESSAGE, number=3, message=duration_pb2.Duration, + proto.MESSAGE, + number=3, + message=duration_pb2.Duration, + ) + min_backoff = proto.Field( + proto.MESSAGE, + number=4, + message=duration_pb2.Duration, + ) + max_backoff = proto.Field( + proto.MESSAGE, + number=5, + message=duration_pb2.Duration, + ) + max_doublings = proto.Field( + proto.INT32, + number=6, ) - min_backoff = proto.Field(proto.MESSAGE, number=4, message=duration_pb2.Duration,) - max_backoff = proto.Field(proto.MESSAGE, number=5, message=duration_pb2.Duration,) - max_doublings = proto.Field(proto.INT32, number=6,) class QueueStats(proto.Message): @@ -461,13 +528,27 @@ class QueueStats(proto.Message): tasks in the queue are targeting. """ - tasks_count = proto.Field(proto.INT64, number=1,) + tasks_count = proto.Field( + proto.INT64, + number=1, + ) oldest_estimated_arrival_time = proto.Field( - proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + executed_last_minute_count = proto.Field( + proto.INT64, + number=3, + ) + concurrent_dispatches_count = proto.Field( + proto.INT64, + number=4, + ) + effective_execution_rate = proto.Field( + proto.DOUBLE, + number=5, ) - executed_last_minute_count = proto.Field(proto.INT64, number=3,) - concurrent_dispatches_count = proto.Field(proto.INT64, number=4,) - effective_execution_rate = proto.Field(proto.DOUBLE, number=5,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/tasks_v2beta2/types/target.py b/google/cloud/tasks_v2beta2/types/target.py index 73ffa97c..2b6f704a 100644 --- a/google/cloud/tasks_v2beta2/types/target.py +++ b/google/cloud/tasks_v2beta2/types/target.py @@ -40,8 +40,7 @@ class HttpMethod(proto.Enum): class PullTarget(proto.Message): - r"""Pull target. - """ + r"""Pull target.""" class PullMessage(proto.Message): @@ -81,8 +80,14 @@ class PullMessage(proto.Message): returned by Cloud Tasks. """ - payload = proto.Field(proto.BYTES, number=1,) - tag = proto.Field(proto.STRING, number=2,) + payload = proto.Field( + proto.BYTES, + number=1, + ) + tag = proto.Field( + proto.STRING, + number=2, + ) class AppEngineHttpTarget(proto.Message): @@ -117,7 +122,9 @@ class AppEngineHttpTarget(proto.Message): """ app_engine_routing_override = proto.Field( - proto.MESSAGE, number=1, message="AppEngineRouting", + proto.MESSAGE, + number=1, + message="AppEngineRouting", ) @@ -278,13 +285,29 @@ class AppEngineHttpRequest(proto.Message): [HttpMethod][google.cloud.tasks.v2beta2.HttpMethod]. """ - http_method = proto.Field(proto.ENUM, number=1, enum="HttpMethod",) + http_method = proto.Field( + proto.ENUM, + number=1, + enum="HttpMethod", + ) app_engine_routing = proto.Field( - proto.MESSAGE, number=2, message="AppEngineRouting", + proto.MESSAGE, + number=2, + message="AppEngineRouting", + ) + relative_url = proto.Field( + proto.STRING, + number=3, + ) + headers = proto.MapField( + proto.STRING, + proto.STRING, + number=4, + ) + payload = proto.Field( + proto.BYTES, + number=5, ) - relative_url = proto.Field(proto.STRING, number=3,) - headers = proto.MapField(proto.STRING, proto.STRING, number=4,) - payload = proto.Field(proto.BYTES, number=5,) class AppEngineRouting(proto.Message): @@ -443,10 +466,22 @@ class AppEngineRouting(proto.Message): version of the default service when the task is attempted. """ - service = proto.Field(proto.STRING, number=1,) - version = proto.Field(proto.STRING, number=2,) - instance = proto.Field(proto.STRING, number=3,) - host = proto.Field(proto.STRING, number=4,) + service = proto.Field( + proto.STRING, + number=1, + ) + version = proto.Field( + proto.STRING, + number=2, + ) + instance = proto.Field( + proto.STRING, + number=3, + ) + host = proto.Field( + proto.STRING, + number=4, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/tasks_v2beta2/types/task.py b/google/cloud/tasks_v2beta2/types/task.py index 8751b5a2..9b064903 100644 --- a/google/cloud/tasks_v2beta2/types/task.py +++ b/google/cloud/tasks_v2beta2/types/task.py @@ -22,7 +22,11 @@ __protobuf__ = proto.module( package="google.cloud.tasks.v2beta2", - manifest={"Task", "TaskStatus", "AttemptStatus",}, + manifest={ + "Task", + "TaskStatus", + "AttemptStatus", + }, ) @@ -121,7 +125,10 @@ class View(proto.Enum): BASIC = 1 FULL = 2 - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) app_engine_http_request = proto.Field( proto.MESSAGE, number=3, @@ -129,14 +136,31 @@ class View(proto.Enum): message=target.AppEngineHttpRequest, ) pull_message = proto.Field( - proto.MESSAGE, number=4, oneof="payload_type", message=target.PullMessage, + proto.MESSAGE, + number=4, + oneof="payload_type", + message=target.PullMessage, ) schedule_time = proto.Field( - proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=5, + message=timestamp_pb2.Timestamp, + ) + create_time = proto.Field( + proto.MESSAGE, + number=6, + message=timestamp_pb2.Timestamp, + ) + status = proto.Field( + proto.MESSAGE, + number=7, + message="TaskStatus", + ) + view = proto.Field( + proto.ENUM, + number=8, + enum=View, ) - create_time = proto.Field(proto.MESSAGE, number=6, message=timestamp_pb2.Timestamp,) - status = proto.Field(proto.MESSAGE, number=7, message="TaskStatus",) - view = proto.Field(proto.ENUM, number=8, enum=View,) class TaskStatus(proto.Message): @@ -172,12 +196,24 @@ class TaskStatus(proto.Message): tasks][google.cloud.tasks.v2beta2.PullMessage]. """ - attempt_dispatch_count = proto.Field(proto.INT32, number=1,) - attempt_response_count = proto.Field(proto.INT32, number=2,) + attempt_dispatch_count = proto.Field( + proto.INT32, + number=1, + ) + attempt_response_count = proto.Field( + proto.INT32, + number=2, + ) first_attempt_status = proto.Field( - proto.MESSAGE, number=3, message="AttemptStatus", + proto.MESSAGE, + number=3, + message="AttemptStatus", + ) + last_attempt_status = proto.Field( + proto.MESSAGE, + number=4, + message="AttemptStatus", ) - last_attempt_status = proto.Field(proto.MESSAGE, number=4, message="AttemptStatus",) class AttemptStatus(proto.Message): @@ -209,15 +245,25 @@ class AttemptStatus(proto.Message): """ schedule_time = proto.Field( - proto.MESSAGE, number=1, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=1, + message=timestamp_pb2.Timestamp, ) dispatch_time = proto.Field( - proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, ) response_time = proto.Field( - proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + response_status = proto.Field( + proto.MESSAGE, + number=4, + message=status_pb2.Status, ) - response_status = proto.Field(proto.MESSAGE, number=4, message=status_pb2.Status,) __all__ = tuple(sorted(__protobuf__.manifest)) 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 29b6688a..e5dd34a0 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py @@ -311,12 +311,20 @@ def sample_list_queues(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListQueuesAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -421,7 +429,12 @@ def sample_get_queue(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -543,7 +556,12 @@ def sample_create_queue(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -673,7 +691,12 @@ def sample_update_queue(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -777,7 +800,10 @@ def sample_delete_queue(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def purge_queue( @@ -875,7 +901,12 @@ def sample_purge_queue(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -977,7 +1008,12 @@ def sample_pause_queue(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1086,7 +1122,12 @@ def sample_resume_queue(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1223,7 +1264,9 @@ def sample_get_iam_policy(): if isinstance(request, dict): request = iam_policy_pb2.GetIamPolicyRequest(**request) elif not request: - request = iam_policy_pb2.GetIamPolicyRequest(resource=resource,) + request = iam_policy_pb2.GetIamPolicyRequest( + resource=resource, + ) # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. @@ -1250,7 +1293,12 @@ def sample_get_iam_policy(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1391,7 +1439,9 @@ def sample_set_iam_policy(): if isinstance(request, dict): request = iam_policy_pb2.SetIamPolicyRequest(**request) elif not request: - request = iam_policy_pb2.SetIamPolicyRequest(resource=resource,) + request = iam_policy_pb2.SetIamPolicyRequest( + resource=resource, + ) # Wrap the RPC method; this adds retry and timeout information, # and friendly error handling. @@ -1408,7 +1458,12 @@ def sample_set_iam_policy(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1502,7 +1557,8 @@ def sample_test_iam_permissions(): request = iam_policy_pb2.TestIamPermissionsRequest(**request) elif not request: request = iam_policy_pb2.TestIamPermissionsRequest( - resource=resource, permissions=permissions, + resource=resource, + permissions=permissions, ) # Wrap the RPC method; this adds retry and timeout information, @@ -1530,7 +1586,12 @@ def sample_test_iam_permissions(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1645,12 +1706,20 @@ def sample_list_tasks(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__aiter__` convenience method. response = pagers.ListTasksAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1750,7 +1819,12 @@ def sample_get_task(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1895,7 +1969,12 @@ def sample_create_task(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1992,7 +2071,10 @@ def sample_delete_task(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def run_task( @@ -2107,7 +2189,12 @@ def sample_run_task(): ) # Send the request. - response = await rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = await rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2121,7 +2208,9 @@ async def __aexit__(self, exc_type, exc, tb): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-tasks",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-tasks", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py b/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py index 6898e9f1..34e62762 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py @@ -63,7 +63,10 @@ class CloudTasksClientMeta(type): _transport_registry["grpc"] = CloudTasksGrpcTransport _transport_registry["grpc_asyncio"] = CloudTasksGrpcAsyncIOTransport - def get_transport_class(cls, label: str = None,) -> Type[CloudTasksTransport]: + def get_transport_class( + cls, + label: str = None, + ) -> Type[CloudTasksTransport]: """Returns an appropriate transport class. Args: @@ -170,10 +173,16 @@ def transport(self) -> CloudTasksTransport: return self._transport @staticmethod - def queue_path(project: str, location: str, queue: str,) -> str: + def queue_path( + project: str, + location: str, + queue: str, + ) -> str: """Returns a fully-qualified queue string.""" return "projects/{project}/locations/{location}/queues/{queue}".format( - project=project, location=location, queue=queue, + project=project, + location=location, + queue=queue, ) @staticmethod @@ -186,10 +195,18 @@ def parse_queue_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def task_path(project: str, location: str, queue: str, task: str,) -> str: + def task_path( + project: str, + location: str, + queue: str, + task: str, + ) -> str: """Returns a fully-qualified task string.""" return "projects/{project}/locations/{location}/queues/{queue}/tasks/{task}".format( - project=project, location=location, queue=queue, task=task, + project=project, + location=location, + queue=queue, + task=task, ) @staticmethod @@ -202,7 +219,9 @@ def parse_task_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_billing_account_path(billing_account: str,) -> str: + def common_billing_account_path( + billing_account: str, + ) -> str: """Returns a fully-qualified billing_account string.""" return "billingAccounts/{billing_account}".format( billing_account=billing_account, @@ -215,9 +234,13 @@ def parse_common_billing_account_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_folder_path(folder: str,) -> str: + def common_folder_path( + folder: str, + ) -> str: """Returns a fully-qualified folder string.""" - return "folders/{folder}".format(folder=folder,) + return "folders/{folder}".format( + folder=folder, + ) @staticmethod def parse_common_folder_path(path: str) -> Dict[str, str]: @@ -226,9 +249,13 @@ def parse_common_folder_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_organization_path(organization: str,) -> str: + def common_organization_path( + organization: str, + ) -> str: """Returns a fully-qualified organization string.""" - return "organizations/{organization}".format(organization=organization,) + return "organizations/{organization}".format( + organization=organization, + ) @staticmethod def parse_common_organization_path(path: str) -> Dict[str, str]: @@ -237,9 +264,13 @@ def parse_common_organization_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_project_path(project: str,) -> str: + def common_project_path( + project: str, + ) -> str: """Returns a fully-qualified project string.""" - return "projects/{project}".format(project=project,) + return "projects/{project}".format( + project=project, + ) @staticmethod def parse_common_project_path(path: str) -> Dict[str, str]: @@ -248,10 +279,14 @@ def parse_common_project_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def common_location_path(project: str, location: str,) -> str: + def common_location_path( + project: str, + location: str, + ) -> str: """Returns a fully-qualified location string.""" return "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) @staticmethod @@ -516,12 +551,20 @@ def sample_list_queues(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListQueuesPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -616,7 +659,12 @@ def sample_get_queue(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -738,7 +786,12 @@ def sample_create_queue(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -868,7 +921,12 @@ def sample_update_queue(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -962,7 +1020,10 @@ def sample_delete_queue(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def purge_queue( @@ -1060,7 +1121,12 @@ def sample_purge_queue(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1162,7 +1228,12 @@ def sample_pause_queue(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1271,7 +1342,12 @@ def sample_resume_queue(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1424,7 +1500,12 @@ def sample_get_iam_policy(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1581,7 +1662,12 @@ def sample_set_iam_policy(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1692,7 +1778,12 @@ def sample_test_iam_permissions(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -1797,12 +1888,20 @@ def sample_list_tasks(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # This method is paged; wrap the response in a pager, which provides # an `__iter__` convenience method. response = pagers.ListTasksPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1892,7 +1991,12 @@ def sample_get_task(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2037,7 +2141,12 @@ def sample_create_task(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2124,7 +2233,10 @@ def sample_delete_task(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def run_task( @@ -2239,7 +2351,12 @@ def sample_run_task(): ) # Send the request. - response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,) + response = rpc( + request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) # Done; return the response. return response @@ -2260,7 +2377,9 @@ def __exit__(self, type, value, traceback): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-tasks",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-tasks", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/base.py b/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/base.py index 6924af75..39eb8806 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/base.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/base.py @@ -36,7 +36,9 @@ try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-tasks",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-tasks", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() @@ -156,10 +158,14 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.create_queue: gapic_v1.method.wrap_method( - self.create_queue, default_timeout=20.0, client_info=client_info, + self.create_queue, + default_timeout=20.0, + client_info=client_info, ), self.update_queue: gapic_v1.method.wrap_method( - self.update_queue, default_timeout=20.0, client_info=client_info, + self.update_queue, + default_timeout=20.0, + client_info=client_info, ), self.delete_queue: gapic_v1.method.wrap_method( self.delete_queue, @@ -177,13 +183,19 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.purge_queue: gapic_v1.method.wrap_method( - self.purge_queue, default_timeout=20.0, client_info=client_info, + self.purge_queue, + default_timeout=20.0, + client_info=client_info, ), self.pause_queue: gapic_v1.method.wrap_method( - self.pause_queue, default_timeout=20.0, client_info=client_info, + self.pause_queue, + default_timeout=20.0, + client_info=client_info, ), self.resume_queue: gapic_v1.method.wrap_method( - self.resume_queue, default_timeout=20.0, client_info=client_info, + self.resume_queue, + default_timeout=20.0, + client_info=client_info, ), self.get_iam_policy: gapic_v1.method.wrap_method( self.get_iam_policy, @@ -201,7 +213,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.set_iam_policy: gapic_v1.method.wrap_method( - self.set_iam_policy, default_timeout=20.0, client_info=client_info, + self.set_iam_policy, + default_timeout=20.0, + client_info=client_info, ), self.test_iam_permissions: gapic_v1.method.wrap_method( self.test_iam_permissions, @@ -249,7 +263,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.create_task: gapic_v1.method.wrap_method( - self.create_task, default_timeout=20.0, client_info=client_info, + self.create_task, + default_timeout=20.0, + client_info=client_info, ), self.delete_task: gapic_v1.method.wrap_method( self.delete_task, @@ -267,16 +283,18 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.run_task: gapic_v1.method.wrap_method( - self.run_task, default_timeout=20.0, client_info=client_info, + self.run_task, + default_timeout=20.0, + client_info=client_info, ), } def close(self): """Closes resources associated with the transport. - .. warning:: - Only call this method if the transport is NOT shared - with other clients - this may cause errors in other clients! + .. warning:: + Only call this method if the transport is NOT shared + with other clients - this may cause errors in other clients! """ raise NotImplementedError() 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 712d8d9b..9789fc74 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/grpc.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/grpc.py @@ -232,8 +232,7 @@ def create_channel( @property def grpc_channel(self) -> grpc.Channel: - """Return the channel designed to connect to this service. - """ + """Return the channel designed to connect to this service.""" return self._grpc_channel @property diff --git a/google/cloud/tasks_v2beta3/types/cloudtasks.py b/google/cloud/tasks_v2beta3/types/cloudtasks.py index 90504fec..a6fcaf93 100644 --- a/google/cloud/tasks_v2beta3/types/cloudtasks.py +++ b/google/cloud/tasks_v2beta3/types/cloudtasks.py @@ -89,11 +89,27 @@ class ListQueuesRequest(proto.Message): returned only if it was explicitly specified in the mask. """ - parent = proto.Field(proto.STRING, number=1,) - filter = proto.Field(proto.STRING, number=2,) - page_size = proto.Field(proto.INT32, number=3,) - page_token = proto.Field(proto.STRING, number=4,) - read_mask = proto.Field(proto.MESSAGE, number=5, message=field_mask_pb2.FieldMask,) + parent = proto.Field( + proto.STRING, + number=1, + ) + filter = proto.Field( + proto.STRING, + number=2, + ) + page_size = proto.Field( + proto.INT32, + number=3, + ) + page_token = proto.Field( + proto.STRING, + number=4, + ) + read_mask = proto.Field( + proto.MESSAGE, + number=5, + message=field_mask_pb2.FieldMask, + ) class ListQueuesResponse(proto.Message): @@ -120,8 +136,15 @@ class ListQueuesResponse(proto.Message): def raw_page(self): return self - queues = proto.RepeatedField(proto.MESSAGE, number=1, message=gct_queue.Queue,) - next_page_token = proto.Field(proto.STRING, number=2,) + queues = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=gct_queue.Queue, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) class GetQueueRequest(proto.Message): @@ -139,8 +162,15 @@ class GetQueueRequest(proto.Message): returned only if it was explicitly specified in the mask. """ - name = proto.Field(proto.STRING, number=1,) - read_mask = proto.Field(proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask,) + name = proto.Field( + proto.STRING, + number=1, + ) + read_mask = proto.Field( + proto.MESSAGE, + number=2, + message=field_mask_pb2.FieldMask, + ) class CreateQueueRequest(proto.Message): @@ -163,8 +193,15 @@ class CreateQueueRequest(proto.Message): be the same as an existing queue. """ - parent = proto.Field(proto.STRING, number=1,) - queue = proto.Field(proto.MESSAGE, number=2, message=gct_queue.Queue,) + parent = proto.Field( + proto.STRING, + number=1, + ) + queue = proto.Field( + proto.MESSAGE, + number=2, + message=gct_queue.Queue, + ) class UpdateQueueRequest(proto.Message): @@ -188,9 +225,15 @@ class UpdateQueueRequest(proto.Message): If empty, then all fields will be updated. """ - queue = proto.Field(proto.MESSAGE, number=1, message=gct_queue.Queue,) + queue = proto.Field( + proto.MESSAGE, + number=1, + message=gct_queue.Queue, + ) update_mask = proto.Field( - proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=2, + message=field_mask_pb2.FieldMask, ) @@ -204,7 +247,10 @@ class DeleteQueueRequest(proto.Message): ``projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class PurgeQueueRequest(proto.Message): @@ -217,7 +263,10 @@ class PurgeQueueRequest(proto.Message): ``projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class PauseQueueRequest(proto.Message): @@ -230,7 +279,10 @@ class PauseQueueRequest(proto.Message): ``projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class ResumeQueueRequest(proto.Message): @@ -243,7 +295,10 @@ class ResumeQueueRequest(proto.Message): ``projects/PROJECT_ID/location/LOCATION_ID/queues/QUEUE_ID`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class ListTasksRequest(proto.Message): @@ -294,10 +349,23 @@ class ListTasksRequest(proto.Message): The page token is valid for only 2 hours. """ - parent = proto.Field(proto.STRING, number=1,) - response_view = proto.Field(proto.ENUM, number=2, enum=gct_task.Task.View,) - page_size = proto.Field(proto.INT32, number=3,) - page_token = proto.Field(proto.STRING, number=4,) + parent = proto.Field( + proto.STRING, + number=1, + ) + response_view = proto.Field( + proto.ENUM, + number=2, + enum=gct_task.Task.View, + ) + page_size = proto.Field( + proto.INT32, + number=3, + ) + page_token = proto.Field( + proto.STRING, + number=4, + ) class ListTasksResponse(proto.Message): @@ -322,8 +390,15 @@ class ListTasksResponse(proto.Message): def raw_page(self): return self - tasks = proto.RepeatedField(proto.MESSAGE, number=1, message=gct_task.Task,) - next_page_token = proto.Field(proto.STRING, number=2,) + tasks = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=gct_task.Task, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) class GetTaskRequest(proto.Message): @@ -352,8 +427,15 @@ class GetTaskRequest(proto.Message): [Task][google.cloud.tasks.v2beta3.Task] resource. """ - name = proto.Field(proto.STRING, number=1,) - response_view = proto.Field(proto.ENUM, number=2, enum=gct_task.Task.View,) + name = proto.Field( + proto.STRING, + number=1, + ) + response_view = proto.Field( + proto.ENUM, + number=2, + enum=gct_task.Task.View, + ) class CreateTaskRequest(proto.Message): @@ -425,9 +507,20 @@ class CreateTaskRequest(proto.Message): [Task][google.cloud.tasks.v2beta3.Task] resource. """ - parent = proto.Field(proto.STRING, number=1,) - task = proto.Field(proto.MESSAGE, number=2, message=gct_task.Task,) - response_view = proto.Field(proto.ENUM, number=3, enum=gct_task.Task.View,) + parent = proto.Field( + proto.STRING, + number=1, + ) + task = proto.Field( + proto.MESSAGE, + number=2, + message=gct_task.Task, + ) + response_view = proto.Field( + proto.ENUM, + number=3, + enum=gct_task.Task.View, + ) class DeleteTaskRequest(proto.Message): @@ -440,7 +533,10 @@ class DeleteTaskRequest(proto.Message): ``projects/PROJECT_ID/locations/LOCATION_ID/queues/QUEUE_ID/tasks/TASK_ID`` """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class RunTaskRequest(proto.Message): @@ -469,8 +565,15 @@ class RunTaskRequest(proto.Message): [Task][google.cloud.tasks.v2beta3.Task] resource. """ - name = proto.Field(proto.STRING, number=1,) - response_view = proto.Field(proto.ENUM, number=2, enum=gct_task.Task.View,) + name = proto.Field( + proto.STRING, + number=1, + ) + response_view = proto.Field( + proto.ENUM, + number=2, + enum=gct_task.Task.View, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/tasks_v2beta3/types/queue.py b/google/cloud/tasks_v2beta3/types/queue.py index 291902ca..620194b8 100644 --- a/google/cloud/tasks_v2beta3/types/queue.py +++ b/google/cloud/tasks_v2beta3/types/queue.py @@ -201,21 +201,61 @@ class Type(proto.Enum): PULL = 1 PUSH = 2 - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) app_engine_http_queue = proto.Field( - proto.MESSAGE, number=3, oneof="queue_type", message=target.AppEngineHttpQueue, + proto.MESSAGE, + number=3, + oneof="queue_type", + message=target.AppEngineHttpQueue, + ) + rate_limits = proto.Field( + proto.MESSAGE, + number=4, + message="RateLimits", + ) + retry_config = proto.Field( + proto.MESSAGE, + number=5, + message="RetryConfig", + ) + state = proto.Field( + proto.ENUM, + number=6, + enum=State, + ) + purge_time = proto.Field( + proto.MESSAGE, + number=7, + message=timestamp_pb2.Timestamp, + ) + task_ttl = proto.Field( + proto.MESSAGE, + number=8, + message=duration_pb2.Duration, + ) + tombstone_ttl = proto.Field( + proto.MESSAGE, + number=9, + message=duration_pb2.Duration, ) - rate_limits = proto.Field(proto.MESSAGE, number=4, message="RateLimits",) - retry_config = proto.Field(proto.MESSAGE, number=5, message="RetryConfig",) - state = proto.Field(proto.ENUM, number=6, enum=State,) - purge_time = proto.Field(proto.MESSAGE, number=7, message=timestamp_pb2.Timestamp,) - task_ttl = proto.Field(proto.MESSAGE, number=8, message=duration_pb2.Duration,) - tombstone_ttl = proto.Field(proto.MESSAGE, number=9, message=duration_pb2.Duration,) stackdriver_logging_config = proto.Field( - proto.MESSAGE, number=10, message="StackdriverLoggingConfig", + proto.MESSAGE, + number=10, + message="StackdriverLoggingConfig", + ) + type_ = proto.Field( + proto.ENUM, + number=11, + enum=Type, + ) + stats = proto.Field( + proto.MESSAGE, + number=12, + message="QueueStats", ) - type_ = proto.Field(proto.ENUM, number=11, enum=Type,) - stats = proto.Field(proto.MESSAGE, number=12, message="QueueStats",) class RateLimits(proto.Message): @@ -298,9 +338,18 @@ class RateLimits(proto.Message): queue.yaml/xml `__. """ - max_dispatches_per_second = proto.Field(proto.DOUBLE, number=1,) - max_burst_size = proto.Field(proto.INT32, number=2,) - max_concurrent_dispatches = proto.Field(proto.INT32, number=3,) + max_dispatches_per_second = proto.Field( + proto.DOUBLE, + number=1, + ) + max_burst_size = proto.Field( + proto.INT32, + number=2, + ) + max_concurrent_dispatches = proto.Field( + proto.INT32, + number=3, + ) class RetryConfig(proto.Message): @@ -411,13 +460,29 @@ class RetryConfig(proto.Message): queue.yaml/xml `__. """ - max_attempts = proto.Field(proto.INT32, number=1,) + max_attempts = proto.Field( + proto.INT32, + number=1, + ) max_retry_duration = proto.Field( - proto.MESSAGE, number=2, message=duration_pb2.Duration, + proto.MESSAGE, + number=2, + message=duration_pb2.Duration, + ) + min_backoff = proto.Field( + proto.MESSAGE, + number=3, + message=duration_pb2.Duration, + ) + max_backoff = proto.Field( + proto.MESSAGE, + number=4, + message=duration_pb2.Duration, + ) + max_doublings = proto.Field( + proto.INT32, + number=5, ) - min_backoff = proto.Field(proto.MESSAGE, number=3, message=duration_pb2.Duration,) - max_backoff = proto.Field(proto.MESSAGE, number=4, message=duration_pb2.Duration,) - max_doublings = proto.Field(proto.INT32, number=5,) class StackdriverLoggingConfig(proto.Message): @@ -433,7 +498,10 @@ class StackdriverLoggingConfig(proto.Message): 0.0 is the default and means that no operations are logged. """ - sampling_ratio = proto.Field(proto.DOUBLE, number=1,) + sampling_ratio = proto.Field( + proto.DOUBLE, + number=1, + ) class QueueStats(proto.Message): @@ -469,13 +537,27 @@ class QueueStats(proto.Message): tasks in the queue are targeting. """ - tasks_count = proto.Field(proto.INT64, number=1,) + tasks_count = proto.Field( + proto.INT64, + number=1, + ) oldest_estimated_arrival_time = proto.Field( - proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, + ) + executed_last_minute_count = proto.Field( + proto.INT64, + number=3, + ) + concurrent_dispatches_count = proto.Field( + proto.INT64, + number=4, + ) + effective_execution_rate = proto.Field( + proto.DOUBLE, + number=5, ) - executed_last_minute_count = proto.Field(proto.INT64, number=3,) - concurrent_dispatches_count = proto.Field(proto.INT64, number=4,) - effective_execution_rate = proto.Field(proto.DOUBLE, number=5,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/tasks_v2beta3/types/target.py b/google/cloud/tasks_v2beta3/types/target.py index 365f6016..c6b89ab9 100644 --- a/google/cloud/tasks_v2beta3/types/target.py +++ b/google/cloud/tasks_v2beta3/types/target.py @@ -71,8 +71,14 @@ class PullMessage(proto.Message): returned by Cloud Tasks. """ - payload = proto.Field(proto.BYTES, number=1,) - tag = proto.Field(proto.STRING, number=2,) + payload = proto.Field( + proto.BYTES, + number=1, + ) + tag = proto.Field( + proto.STRING, + number=2, + ) class HttpRequest(proto.Message): @@ -199,15 +205,35 @@ class HttpRequest(proto.Message): This field is a member of `oneof`_ ``authorization_header``. """ - url = proto.Field(proto.STRING, number=1,) - http_method = proto.Field(proto.ENUM, number=2, enum="HttpMethod",) - headers = proto.MapField(proto.STRING, proto.STRING, number=3,) - body = proto.Field(proto.BYTES, number=4,) + url = proto.Field( + proto.STRING, + number=1, + ) + http_method = proto.Field( + proto.ENUM, + number=2, + enum="HttpMethod", + ) + headers = proto.MapField( + proto.STRING, + proto.STRING, + number=3, + ) + body = proto.Field( + proto.BYTES, + number=4, + ) oauth_token = proto.Field( - proto.MESSAGE, number=5, oneof="authorization_header", message="OAuthToken", + proto.MESSAGE, + number=5, + oneof="authorization_header", + message="OAuthToken", ) oidc_token = proto.Field( - proto.MESSAGE, number=6, oneof="authorization_header", message="OidcToken", + proto.MESSAGE, + number=6, + oneof="authorization_header", + message="OidcToken", ) @@ -243,7 +269,9 @@ class AppEngineHttpQueue(proto.Message): """ app_engine_routing_override = proto.Field( - proto.MESSAGE, number=1, message="AppEngineRouting", + proto.MESSAGE, + number=1, + message="AppEngineRouting", ) @@ -399,13 +427,29 @@ class AppEngineHttpRequest(proto.Message): [HttpMethod][google.cloud.tasks.v2beta3.HttpMethod]. """ - http_method = proto.Field(proto.ENUM, number=1, enum="HttpMethod",) + http_method = proto.Field( + proto.ENUM, + number=1, + enum="HttpMethod", + ) app_engine_routing = proto.Field( - proto.MESSAGE, number=2, message="AppEngineRouting", + proto.MESSAGE, + number=2, + message="AppEngineRouting", + ) + relative_uri = proto.Field( + proto.STRING, + number=3, + ) + headers = proto.MapField( + proto.STRING, + proto.STRING, + number=4, + ) + body = proto.Field( + proto.BYTES, + number=5, ) - relative_uri = proto.Field(proto.STRING, number=3,) - headers = proto.MapField(proto.STRING, proto.STRING, number=4,) - body = proto.Field(proto.BYTES, number=5,) class AppEngineRouting(proto.Message): @@ -504,10 +548,22 @@ class AppEngineRouting(proto.Message): Routed `__. """ - service = proto.Field(proto.STRING, number=1,) - version = proto.Field(proto.STRING, number=2,) - instance = proto.Field(proto.STRING, number=3,) - host = proto.Field(proto.STRING, number=4,) + service = proto.Field( + proto.STRING, + number=1, + ) + version = proto.Field( + proto.STRING, + number=2, + ) + instance = proto.Field( + proto.STRING, + number=3, + ) + host = proto.Field( + proto.STRING, + number=4, + ) class OAuthToken(proto.Message): @@ -531,8 +587,14 @@ class OAuthToken(proto.Message): will be used. """ - service_account_email = proto.Field(proto.STRING, number=1,) - scope = proto.Field(proto.STRING, number=2,) + service_account_email = proto.Field( + proto.STRING, + number=1, + ) + scope = proto.Field( + proto.STRING, + number=2, + ) class OidcToken(proto.Message): @@ -556,8 +618,14 @@ class OidcToken(proto.Message): target will be used. """ - service_account_email = proto.Field(proto.STRING, number=1,) - audience = proto.Field(proto.STRING, number=2,) + service_account_email = proto.Field( + proto.STRING, + number=1, + ) + audience = proto.Field( + proto.STRING, + number=2, + ) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/tasks_v2beta3/types/task.py b/google/cloud/tasks_v2beta3/types/task.py index d5edc2e1..20930b51 100644 --- a/google/cloud/tasks_v2beta3/types/task.py +++ b/google/cloud/tasks_v2beta3/types/task.py @@ -22,7 +22,11 @@ __protobuf__ = proto.module( - package="google.cloud.tasks.v2beta3", manifest={"Task", "Attempt",}, + package="google.cloud.tasks.v2beta3", + manifest={ + "Task", + "Attempt", + }, ) @@ -177,7 +181,10 @@ class View(proto.Enum): BASIC = 1 FULL = 2 - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) app_engine_http_request = proto.Field( proto.MESSAGE, number=3, @@ -185,23 +192,55 @@ class View(proto.Enum): message=target.AppEngineHttpRequest, ) http_request = proto.Field( - proto.MESSAGE, number=11, oneof="payload_type", message=target.HttpRequest, + proto.MESSAGE, + number=11, + oneof="payload_type", + message=target.HttpRequest, ) pull_message = proto.Field( - proto.MESSAGE, number=13, oneof="payload_type", message=target.PullMessage, + proto.MESSAGE, + number=13, + oneof="payload_type", + message=target.PullMessage, ) schedule_time = proto.Field( - proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=4, + message=timestamp_pb2.Timestamp, + ) + create_time = proto.Field( + proto.MESSAGE, + number=5, + message=timestamp_pb2.Timestamp, ) - create_time = proto.Field(proto.MESSAGE, number=5, message=timestamp_pb2.Timestamp,) dispatch_deadline = proto.Field( - proto.MESSAGE, number=12, message=duration_pb2.Duration, + proto.MESSAGE, + number=12, + message=duration_pb2.Duration, + ) + dispatch_count = proto.Field( + proto.INT32, + number=6, + ) + response_count = proto.Field( + proto.INT32, + number=7, + ) + first_attempt = proto.Field( + proto.MESSAGE, + number=8, + message="Attempt", + ) + last_attempt = proto.Field( + proto.MESSAGE, + number=9, + message="Attempt", + ) + view = proto.Field( + proto.ENUM, + number=10, + enum=View, ) - dispatch_count = proto.Field(proto.INT32, number=6,) - response_count = proto.Field(proto.INT32, number=7,) - first_attempt = proto.Field(proto.MESSAGE, number=8, message="Attempt",) - last_attempt = proto.Field(proto.MESSAGE, number=9, message="Attempt",) - view = proto.Field(proto.ENUM, number=10, enum=View,) class Attempt(proto.Message): @@ -233,15 +272,25 @@ class Attempt(proto.Message): """ schedule_time = proto.Field( - proto.MESSAGE, number=1, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=1, + message=timestamp_pb2.Timestamp, ) dispatch_time = proto.Field( - proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, ) response_time = proto.Field( - proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + response_status = proto.Field( + proto.MESSAGE, + number=4, + message=status_pb2.Status, ) - response_status = proto.Field(proto.MESSAGE, number=4, message=status_pb2.Status,) __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/noxfile.py b/noxfile.py index 2a2001c4..3addb4ed 100644 --- a/noxfile.py +++ b/noxfile.py @@ -24,7 +24,7 @@ import nox -BLACK_VERSION = "black==19.10b0" +BLACK_VERSION = "black==22.3.0" BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" @@ -57,7 +57,9 @@ def lint(session): """ session.install("flake8", BLACK_VERSION) session.run( - "black", "--check", *BLACK_PATHS, + "black", + "--check", + *BLACK_PATHS, ) session.run("flake8", "google", "tests") @@ -67,7 +69,8 @@ def blacken(session): """Run black. Format code to uniform standard.""" session.install(BLACK_VERSION) session.run( - "black", *BLACK_PATHS, + "black", + *BLACK_PATHS, ) diff --git a/samples/snippets/create_http_task.py b/samples/snippets/create_http_task.py index 40e735b3..7bf75d41 100644 --- a/samples/snippets/create_http_task.py +++ b/samples/snippets/create_http_task.py @@ -106,7 +106,9 @@ def create_http_task( ) parser.add_argument( - "--project", help="Project of the queue to add the task to.", required=True, + "--project", + help="Project of the queue to add the task to.", + required=True, ) parser.add_argument( @@ -116,7 +118,9 @@ def create_http_task( ) parser.add_argument( - "--location", help="Location of the queue to add the task to.", required=True, + "--location", + help="Location of the queue to add the task to.", + required=True, ) parser.add_argument( diff --git a/samples/snippets/create_http_task_with_token.py b/samples/snippets/create_http_task_with_token.py index 88888bcd..0e157eb9 100644 --- a/samples/snippets/create_http_task_with_token.py +++ b/samples/snippets/create_http_task_with_token.py @@ -16,7 +16,13 @@ def create_http_task( - project, queue, location, url, service_account_email, audience=None, payload=None, + project, + queue, + location, + url, + service_account_email, + audience=None, + payload=None, ): # [START cloud_tasks_create_http_task_with_token] """Create a task for a given queue with an arbitrary payload.""" diff --git a/samples/snippets/noxfile.py b/samples/snippets/noxfile.py index 85f5836d..25f87a21 100644 --- a/samples/snippets/noxfile.py +++ b/samples/snippets/noxfile.py @@ -29,7 +29,7 @@ # WARNING - WARNING - WARNING - WARNING - WARNING # WARNING - WARNING - WARNING - WARNING - WARNING -BLACK_VERSION = "black==19.10b0" +BLACK_VERSION = "black==22.3.0" # Copy `noxfile_config.py` to your directory and modify it instead. @@ -253,7 +253,7 @@ def py(session: nox.sessions.Session) -> None: def _get_repo_root() -> Optional[str]: - """ Returns the root folder of the project. """ + """Returns the root folder of the project.""" # Get root of this repository. Assume we don't have directories nested deeper than 10 items. p = Path(os.getcwd()) for i in range(10): diff --git a/tests/unit/gapic/tasks_v2/test_cloud_tasks.py b/tests/unit/gapic/tasks_v2/test_cloud_tasks.py index b38f272d..499f1c1e 100644 --- a/tests/unit/gapic/tasks_v2/test_cloud_tasks.py +++ b/tests/unit/gapic/tasks_v2/test_cloud_tasks.py @@ -95,7 +95,13 @@ def test__get_default_mtls_endpoint(): assert CloudTasksClient._get_default_mtls_endpoint(non_googleapi) == non_googleapi -@pytest.mark.parametrize("client_class", [CloudTasksClient, CloudTasksAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + CloudTasksClient, + CloudTasksAsyncClient, + ], +) def test_cloud_tasks_client_from_service_account_info(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -135,7 +141,13 @@ def test_cloud_tasks_client_service_account_always_use_jwt( use_jwt.assert_not_called() -@pytest.mark.parametrize("client_class", [CloudTasksClient, CloudTasksAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + CloudTasksClient, + CloudTasksAsyncClient, + ], +) def test_cloud_tasks_client_from_service_account_file(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -490,7 +502,9 @@ def test_cloud_tasks_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -618,10 +632,17 @@ def test_cloud_tasks_client_create_channel_credentials_file( ) -@pytest.mark.parametrize("request_type", [cloudtasks.ListQueuesRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.ListQueuesRequest, + dict, + ], +) def test_list_queues(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -650,7 +671,8 @@ def test_list_queues_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -666,7 +688,8 @@ async def test_list_queues_async( transport: str = "grpc_asyncio", request_type=cloudtasks.ListQueuesRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -677,7 +700,9 @@ async def test_list_queues_async( with mock.patch.object(type(client.transport.list_queues), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - cloudtasks.ListQueuesResponse(next_page_token="next_page_token_value",) + cloudtasks.ListQueuesResponse( + next_page_token="next_page_token_value", + ) ) response = await client.list_queues(request) @@ -697,7 +722,9 @@ async def test_list_queues_async_from_dict(): def test_list_queues_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -717,12 +744,17 @@ def test_list_queues_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_queues_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -744,11 +776,16 @@ async def test_list_queues_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_queues_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_queues), "__call__") as call: @@ -756,7 +793,9 @@ def test_list_queues_flattened(): call.return_value = cloudtasks.ListQueuesResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_queues(parent="parent_value",) + client.list_queues( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -768,19 +807,24 @@ def test_list_queues_flattened(): def test_list_queues_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_queues( - cloudtasks.ListQueuesRequest(), parent="parent_value", + cloudtasks.ListQueuesRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_queues_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_queues), "__call__") as call: @@ -792,7 +836,9 @@ async def test_list_queues_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_queues(parent="parent_value",) + response = await client.list_queues( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -805,19 +851,23 @@ async def test_list_queues_flattened_async(): @pytest.mark.asyncio async def test_list_queues_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_queues( - cloudtasks.ListQueuesRequest(), parent="parent_value", + cloudtasks.ListQueuesRequest(), + parent="parent_value", ) def test_list_queues_pager(transport_name: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -825,14 +875,29 @@ def test_list_queues_pager(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListQueuesResponse( - queues=[queue.Queue(), queue.Queue(), queue.Queue(),], + queues=[ + queue.Queue(), + queue.Queue(), + queue.Queue(), + ], next_page_token="abc", ), - cloudtasks.ListQueuesResponse(queues=[], next_page_token="def",), cloudtasks.ListQueuesResponse( - queues=[queue.Queue(),], next_page_token="ghi", + queues=[], + next_page_token="def", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + ], + next_page_token="ghi", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + queue.Queue(), + ], ), - cloudtasks.ListQueuesResponse(queues=[queue.Queue(), queue.Queue(),],), RuntimeError, ) @@ -851,7 +916,8 @@ def test_list_queues_pager(transport_name: str = "grpc"): def test_list_queues_pages(transport_name: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -859,14 +925,29 @@ def test_list_queues_pages(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListQueuesResponse( - queues=[queue.Queue(), queue.Queue(), queue.Queue(),], + queues=[ + queue.Queue(), + queue.Queue(), + queue.Queue(), + ], next_page_token="abc", ), - cloudtasks.ListQueuesResponse(queues=[], next_page_token="def",), cloudtasks.ListQueuesResponse( - queues=[queue.Queue(),], next_page_token="ghi", + queues=[], + next_page_token="def", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + ], + next_page_token="ghi", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + queue.Queue(), + ], ), - cloudtasks.ListQueuesResponse(queues=[queue.Queue(), queue.Queue(),],), RuntimeError, ) pages = list(client.list_queues(request={}).pages) @@ -876,7 +957,9 @@ def test_list_queues_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_queues_async_pager(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -885,17 +968,34 @@ async def test_list_queues_async_pager(): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListQueuesResponse( - queues=[queue.Queue(), queue.Queue(), queue.Queue(),], + queues=[ + queue.Queue(), + queue.Queue(), + queue.Queue(), + ], next_page_token="abc", ), - cloudtasks.ListQueuesResponse(queues=[], next_page_token="def",), cloudtasks.ListQueuesResponse( - queues=[queue.Queue(),], next_page_token="ghi", + queues=[], + next_page_token="def", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + ], + next_page_token="ghi", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + queue.Queue(), + ], ), - cloudtasks.ListQueuesResponse(queues=[queue.Queue(), queue.Queue(),],), RuntimeError, ) - async_pager = await client.list_queues(request={},) + async_pager = await client.list_queues( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -907,7 +1007,9 @@ async def test_list_queues_async_pager(): @pytest.mark.asyncio async def test_list_queues_async_pages(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -916,14 +1018,29 @@ async def test_list_queues_async_pages(): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListQueuesResponse( - queues=[queue.Queue(), queue.Queue(), queue.Queue(),], + queues=[ + queue.Queue(), + queue.Queue(), + queue.Queue(), + ], next_page_token="abc", ), - cloudtasks.ListQueuesResponse(queues=[], next_page_token="def",), cloudtasks.ListQueuesResponse( - queues=[queue.Queue(),], next_page_token="ghi", + queues=[], + next_page_token="def", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + ], + next_page_token="ghi", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + queue.Queue(), + ], ), - cloudtasks.ListQueuesResponse(queues=[queue.Queue(), queue.Queue(),],), RuntimeError, ) pages = [] @@ -933,10 +1050,17 @@ async def test_list_queues_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [cloudtasks.GetQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.GetQueueRequest, + dict, + ], +) def test_get_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -947,7 +1071,8 @@ def test_get_queue(request_type, transport: str = "grpc"): with mock.patch.object(type(client.transport.get_queue), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = queue.Queue( - name="name_value", state=queue.Queue.State.RUNNING, + name="name_value", + state=queue.Queue.State.RUNNING, ) response = client.get_queue(request) @@ -966,7 +1091,8 @@ def test_get_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -982,7 +1108,8 @@ async def test_get_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.GetQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -993,7 +1120,10 @@ async def test_get_queue_async( with mock.patch.object(type(client.transport.get_queue), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - queue.Queue(name="name_value", state=queue.Queue.State.RUNNING,) + queue.Queue( + name="name_value", + state=queue.Queue.State.RUNNING, + ) ) response = await client.get_queue(request) @@ -1014,7 +1144,9 @@ async def test_get_queue_async_from_dict(): def test_get_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1034,12 +1166,17 @@ def test_get_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1059,11 +1196,16 @@ async def test_get_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_queue), "__call__") as call: @@ -1071,7 +1213,9 @@ def test_get_queue_flattened(): call.return_value = queue.Queue() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_queue(name="name_value",) + client.get_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1083,19 +1227,24 @@ def test_get_queue_flattened(): def test_get_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_queue( - cloudtasks.GetQueueRequest(), name="name_value", + cloudtasks.GetQueueRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_queue), "__call__") as call: @@ -1105,7 +1254,9 @@ async def test_get_queue_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(queue.Queue()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_queue(name="name_value",) + response = await client.get_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1118,20 +1269,30 @@ async def test_get_queue_flattened_async(): @pytest.mark.asyncio async def test_get_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_queue( - cloudtasks.GetQueueRequest(), name="name_value", + cloudtasks.GetQueueRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [cloudtasks.CreateQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.CreateQueueRequest, + dict, + ], +) def test_create_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1142,7 +1303,8 @@ def test_create_queue(request_type, transport: str = "grpc"): with mock.patch.object(type(client.transport.create_queue), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = gct_queue.Queue( - name="name_value", state=gct_queue.Queue.State.RUNNING, + name="name_value", + state=gct_queue.Queue.State.RUNNING, ) response = client.create_queue(request) @@ -1161,7 +1323,8 @@ def test_create_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1177,7 +1340,8 @@ async def test_create_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.CreateQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1188,7 +1352,10 @@ async def test_create_queue_async( with mock.patch.object(type(client.transport.create_queue), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - gct_queue.Queue(name="name_value", state=gct_queue.Queue.State.RUNNING,) + gct_queue.Queue( + name="name_value", + state=gct_queue.Queue.State.RUNNING, + ) ) response = await client.create_queue(request) @@ -1209,7 +1376,9 @@ async def test_create_queue_async_from_dict(): def test_create_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1229,12 +1398,17 @@ def test_create_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1254,11 +1428,16 @@ async def test_create_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_queue), "__call__") as call: @@ -1267,7 +1446,8 @@ def test_create_queue_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.create_queue( - parent="parent_value", queue=gct_queue.Queue(name="name_value"), + parent="parent_value", + queue=gct_queue.Queue(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -1283,7 +1463,9 @@ def test_create_queue_flattened(): def test_create_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1297,7 +1479,9 @@ def test_create_queue_flattened_error(): @pytest.mark.asyncio async def test_create_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_queue), "__call__") as call: @@ -1308,7 +1492,8 @@ async def test_create_queue_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.create_queue( - parent="parent_value", queue=gct_queue.Queue(name="name_value"), + parent="parent_value", + queue=gct_queue.Queue(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -1325,7 +1510,9 @@ async def test_create_queue_flattened_async(): @pytest.mark.asyncio async def test_create_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1337,10 +1524,17 @@ async def test_create_queue_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [cloudtasks.UpdateQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.UpdateQueueRequest, + dict, + ], +) def test_update_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1351,7 +1545,8 @@ def test_update_queue(request_type, transport: str = "grpc"): with mock.patch.object(type(client.transport.update_queue), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = gct_queue.Queue( - name="name_value", state=gct_queue.Queue.State.RUNNING, + name="name_value", + state=gct_queue.Queue.State.RUNNING, ) response = client.update_queue(request) @@ -1370,7 +1565,8 @@ def test_update_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1386,7 +1582,8 @@ async def test_update_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.UpdateQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1397,7 +1594,10 @@ async def test_update_queue_async( with mock.patch.object(type(client.transport.update_queue), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - gct_queue.Queue(name="name_value", state=gct_queue.Queue.State.RUNNING,) + gct_queue.Queue( + name="name_value", + state=gct_queue.Queue.State.RUNNING, + ) ) response = await client.update_queue(request) @@ -1418,7 +1618,9 @@ async def test_update_queue_async_from_dict(): def test_update_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1438,12 +1640,17 @@ def test_update_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "queue.name=queue.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "queue.name=queue.name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_update_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1463,11 +1670,16 @@ async def test_update_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "queue.name=queue.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "queue.name=queue.name/value", + ) in kw["metadata"] def test_update_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_queue), "__call__") as call: @@ -1493,7 +1705,9 @@ def test_update_queue_flattened(): def test_update_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1507,7 +1721,9 @@ def test_update_queue_flattened_error(): @pytest.mark.asyncio async def test_update_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_queue), "__call__") as call: @@ -1536,7 +1752,9 @@ async def test_update_queue_flattened_async(): @pytest.mark.asyncio async def test_update_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1548,10 +1766,17 @@ async def test_update_queue_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [cloudtasks.DeleteQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.DeleteQueueRequest, + dict, + ], +) def test_delete_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1577,7 +1802,8 @@ def test_delete_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1593,7 +1819,8 @@ async def test_delete_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.DeleteQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1621,7 +1848,9 @@ async def test_delete_queue_async_from_dict(): def test_delete_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1641,12 +1870,17 @@ def test_delete_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1666,11 +1900,16 @@ async def test_delete_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_queue), "__call__") as call: @@ -1678,7 +1917,9 @@ def test_delete_queue_flattened(): call.return_value = None # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_queue(name="name_value",) + client.delete_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1690,19 +1931,24 @@ def test_delete_queue_flattened(): def test_delete_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_queue( - cloudtasks.DeleteQueueRequest(), name="name_value", + cloudtasks.DeleteQueueRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_queue), "__call__") as call: @@ -1712,7 +1958,9 @@ async def test_delete_queue_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_queue(name="name_value",) + response = await client.delete_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1725,20 +1973,30 @@ async def test_delete_queue_flattened_async(): @pytest.mark.asyncio async def test_delete_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_queue( - cloudtasks.DeleteQueueRequest(), name="name_value", + cloudtasks.DeleteQueueRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [cloudtasks.PurgeQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.PurgeQueueRequest, + dict, + ], +) def test_purge_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1749,7 +2007,8 @@ def test_purge_queue(request_type, transport: str = "grpc"): with mock.patch.object(type(client.transport.purge_queue), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = queue.Queue( - name="name_value", state=queue.Queue.State.RUNNING, + name="name_value", + state=queue.Queue.State.RUNNING, ) response = client.purge_queue(request) @@ -1768,7 +2027,8 @@ def test_purge_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1784,7 +2044,8 @@ async def test_purge_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.PurgeQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1795,7 +2056,10 @@ async def test_purge_queue_async( with mock.patch.object(type(client.transport.purge_queue), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - queue.Queue(name="name_value", state=queue.Queue.State.RUNNING,) + queue.Queue( + name="name_value", + state=queue.Queue.State.RUNNING, + ) ) response = await client.purge_queue(request) @@ -1816,7 +2080,9 @@ async def test_purge_queue_async_from_dict(): def test_purge_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1836,12 +2102,17 @@ def test_purge_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_purge_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1861,11 +2132,16 @@ async def test_purge_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_purge_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_queue), "__call__") as call: @@ -1873,7 +2149,9 @@ def test_purge_queue_flattened(): call.return_value = queue.Queue() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.purge_queue(name="name_value",) + client.purge_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1885,19 +2163,24 @@ def test_purge_queue_flattened(): def test_purge_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.purge_queue( - cloudtasks.PurgeQueueRequest(), name="name_value", + cloudtasks.PurgeQueueRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_purge_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_queue), "__call__") as call: @@ -1907,7 +2190,9 @@ async def test_purge_queue_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(queue.Queue()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.purge_queue(name="name_value",) + response = await client.purge_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1920,20 +2205,30 @@ async def test_purge_queue_flattened_async(): @pytest.mark.asyncio async def test_purge_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.purge_queue( - cloudtasks.PurgeQueueRequest(), name="name_value", + cloudtasks.PurgeQueueRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [cloudtasks.PauseQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.PauseQueueRequest, + dict, + ], +) def test_pause_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1944,7 +2239,8 @@ def test_pause_queue(request_type, transport: str = "grpc"): with mock.patch.object(type(client.transport.pause_queue), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = queue.Queue( - name="name_value", state=queue.Queue.State.RUNNING, + name="name_value", + state=queue.Queue.State.RUNNING, ) response = client.pause_queue(request) @@ -1963,7 +2259,8 @@ def test_pause_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1979,7 +2276,8 @@ async def test_pause_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.PauseQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1990,7 +2288,10 @@ async def test_pause_queue_async( with mock.patch.object(type(client.transport.pause_queue), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - queue.Queue(name="name_value", state=queue.Queue.State.RUNNING,) + queue.Queue( + name="name_value", + state=queue.Queue.State.RUNNING, + ) ) response = await client.pause_queue(request) @@ -2011,7 +2312,9 @@ async def test_pause_queue_async_from_dict(): def test_pause_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2031,12 +2334,17 @@ def test_pause_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_pause_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2056,11 +2364,16 @@ async def test_pause_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_pause_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.pause_queue), "__call__") as call: @@ -2068,7 +2381,9 @@ def test_pause_queue_flattened(): call.return_value = queue.Queue() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.pause_queue(name="name_value",) + client.pause_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2080,19 +2395,24 @@ def test_pause_queue_flattened(): def test_pause_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.pause_queue( - cloudtasks.PauseQueueRequest(), name="name_value", + cloudtasks.PauseQueueRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_pause_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.pause_queue), "__call__") as call: @@ -2102,7 +2422,9 @@ async def test_pause_queue_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(queue.Queue()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.pause_queue(name="name_value",) + response = await client.pause_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2115,20 +2437,30 @@ async def test_pause_queue_flattened_async(): @pytest.mark.asyncio async def test_pause_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.pause_queue( - cloudtasks.PauseQueueRequest(), name="name_value", + cloudtasks.PauseQueueRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [cloudtasks.ResumeQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.ResumeQueueRequest, + dict, + ], +) def test_resume_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2139,7 +2471,8 @@ def test_resume_queue(request_type, transport: str = "grpc"): with mock.patch.object(type(client.transport.resume_queue), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = queue.Queue( - name="name_value", state=queue.Queue.State.RUNNING, + name="name_value", + state=queue.Queue.State.RUNNING, ) response = client.resume_queue(request) @@ -2158,7 +2491,8 @@ def test_resume_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2174,7 +2508,8 @@ async def test_resume_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.ResumeQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2185,7 +2520,10 @@ async def test_resume_queue_async( with mock.patch.object(type(client.transport.resume_queue), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - queue.Queue(name="name_value", state=queue.Queue.State.RUNNING,) + queue.Queue( + name="name_value", + state=queue.Queue.State.RUNNING, + ) ) response = await client.resume_queue(request) @@ -2206,7 +2544,9 @@ async def test_resume_queue_async_from_dict(): def test_resume_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2226,12 +2566,17 @@ def test_resume_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_resume_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2251,11 +2596,16 @@ async def test_resume_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_resume_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.resume_queue), "__call__") as call: @@ -2263,7 +2613,9 @@ def test_resume_queue_flattened(): call.return_value = queue.Queue() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.resume_queue(name="name_value",) + client.resume_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2275,19 +2627,24 @@ def test_resume_queue_flattened(): def test_resume_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.resume_queue( - cloudtasks.ResumeQueueRequest(), name="name_value", + cloudtasks.ResumeQueueRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_resume_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.resume_queue), "__call__") as call: @@ -2297,7 +2654,9 @@ async def test_resume_queue_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(queue.Queue()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.resume_queue(name="name_value",) + response = await client.resume_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2310,20 +2669,30 @@ async def test_resume_queue_flattened_async(): @pytest.mark.asyncio async def test_resume_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.resume_queue( - cloudtasks.ResumeQueueRequest(), name="name_value", + cloudtasks.ResumeQueueRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [iam_policy_pb2.GetIamPolicyRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + iam_policy_pb2.GetIamPolicyRequest, + dict, + ], +) def test_get_iam_policy(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2333,7 +2702,10 @@ def test_get_iam_policy(request_type, transport: str = "grpc"): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. - call.return_value = policy_pb2.Policy(version=774, etag=b"etag_blob",) + call.return_value = policy_pb2.Policy( + version=774, + etag=b"etag_blob", + ) response = client.get_iam_policy(request) # Establish that the underlying gRPC stub method was called. @@ -2351,7 +2723,8 @@ def test_get_iam_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2367,7 +2740,8 @@ async def test_get_iam_policy_async( transport: str = "grpc_asyncio", request_type=iam_policy_pb2.GetIamPolicyRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2378,7 +2752,10 @@ async def test_get_iam_policy_async( with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - policy_pb2.Policy(version=774, etag=b"etag_blob",) + policy_pb2.Policy( + version=774, + etag=b"etag_blob", + ) ) response = await client.get_iam_policy(request) @@ -2399,7 +2776,9 @@ async def test_get_iam_policy_async_from_dict(): def test_get_iam_policy_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2419,12 +2798,17 @@ def test_get_iam_policy_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_iam_policy_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2444,11 +2828,16 @@ async def test_get_iam_policy_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] def test_get_iam_policy_from_dict_foreign(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. @@ -2463,7 +2852,9 @@ def test_get_iam_policy_from_dict_foreign(): def test_get_iam_policy_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -2471,7 +2862,9 @@ def test_get_iam_policy_flattened(): call.return_value = policy_pb2.Policy() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_iam_policy(resource="resource_value",) + client.get_iam_policy( + resource="resource_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2483,19 +2876,24 @@ def test_get_iam_policy_flattened(): def test_get_iam_policy_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_iam_policy( - iam_policy_pb2.GetIamPolicyRequest(), resource="resource_value", + iam_policy_pb2.GetIamPolicyRequest(), + resource="resource_value", ) @pytest.mark.asyncio async def test_get_iam_policy_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -2505,7 +2903,9 @@ async def test_get_iam_policy_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy_pb2.Policy()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_iam_policy(resource="resource_value",) + response = await client.get_iam_policy( + resource="resource_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2518,20 +2918,30 @@ async def test_get_iam_policy_flattened_async(): @pytest.mark.asyncio async def test_get_iam_policy_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_iam_policy( - iam_policy_pb2.GetIamPolicyRequest(), resource="resource_value", + iam_policy_pb2.GetIamPolicyRequest(), + resource="resource_value", ) -@pytest.mark.parametrize("request_type", [iam_policy_pb2.SetIamPolicyRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + iam_policy_pb2.SetIamPolicyRequest, + dict, + ], +) def test_set_iam_policy(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2541,7 +2951,10 @@ def test_set_iam_policy(request_type, transport: str = "grpc"): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. - call.return_value = policy_pb2.Policy(version=774, etag=b"etag_blob",) + call.return_value = policy_pb2.Policy( + version=774, + etag=b"etag_blob", + ) response = client.set_iam_policy(request) # Establish that the underlying gRPC stub method was called. @@ -2559,7 +2972,8 @@ def test_set_iam_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2575,7 +2989,8 @@ async def test_set_iam_policy_async( transport: str = "grpc_asyncio", request_type=iam_policy_pb2.SetIamPolicyRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2586,7 +3001,10 @@ async def test_set_iam_policy_async( with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - policy_pb2.Policy(version=774, etag=b"etag_blob",) + policy_pb2.Policy( + version=774, + etag=b"etag_blob", + ) ) response = await client.set_iam_policy(request) @@ -2607,7 +3025,9 @@ async def test_set_iam_policy_async_from_dict(): def test_set_iam_policy_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2627,12 +3047,17 @@ def test_set_iam_policy_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_set_iam_policy_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2652,11 +3077,16 @@ async def test_set_iam_policy_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] def test_set_iam_policy_from_dict_foreign(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. @@ -2671,7 +3101,9 @@ def test_set_iam_policy_from_dict_foreign(): def test_set_iam_policy_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -2679,7 +3111,9 @@ def test_set_iam_policy_flattened(): call.return_value = policy_pb2.Policy() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.set_iam_policy(resource="resource_value",) + client.set_iam_policy( + resource="resource_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2691,19 +3125,24 @@ def test_set_iam_policy_flattened(): def test_set_iam_policy_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.set_iam_policy( - iam_policy_pb2.SetIamPolicyRequest(), resource="resource_value", + iam_policy_pb2.SetIamPolicyRequest(), + resource="resource_value", ) @pytest.mark.asyncio async def test_set_iam_policy_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -2713,7 +3152,9 @@ async def test_set_iam_policy_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy_pb2.Policy()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.set_iam_policy(resource="resource_value",) + response = await client.set_iam_policy( + resource="resource_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2726,22 +3167,30 @@ async def test_set_iam_policy_flattened_async(): @pytest.mark.asyncio async def test_set_iam_policy_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.set_iam_policy( - iam_policy_pb2.SetIamPolicyRequest(), resource="resource_value", + iam_policy_pb2.SetIamPolicyRequest(), + resource="resource_value", ) @pytest.mark.parametrize( - "request_type", [iam_policy_pb2.TestIamPermissionsRequest, dict,] + "request_type", + [ + iam_policy_pb2.TestIamPermissionsRequest, + dict, + ], ) def test_test_iam_permissions(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2772,7 +3221,8 @@ def test_test_iam_permissions_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2791,7 +3241,8 @@ async def test_test_iam_permissions_async( request_type=iam_policy_pb2.TestIamPermissionsRequest, ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2826,7 +3277,9 @@ async def test_test_iam_permissions_async_from_dict(): def test_test_iam_permissions_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2848,12 +3301,17 @@ def test_test_iam_permissions_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_test_iam_permissions_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2877,11 +3335,16 @@ async def test_test_iam_permissions_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] def test_test_iam_permissions_from_dict_foreign(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.test_iam_permissions), "__call__" @@ -2898,7 +3361,9 @@ def test_test_iam_permissions_from_dict_foreign(): def test_test_iam_permissions_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2909,7 +3374,8 @@ def test_test_iam_permissions_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.test_iam_permissions( - resource="resource_value", permissions=["permissions_value"], + resource="resource_value", + permissions=["permissions_value"], ) # Establish that the underlying call was made with the expected @@ -2925,7 +3391,9 @@ def test_test_iam_permissions_flattened(): def test_test_iam_permissions_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2939,7 +3407,9 @@ def test_test_iam_permissions_flattened_error(): @pytest.mark.asyncio async def test_test_iam_permissions_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2954,7 +3424,8 @@ async def test_test_iam_permissions_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.test_iam_permissions( - resource="resource_value", permissions=["permissions_value"], + resource="resource_value", + permissions=["permissions_value"], ) # Establish that the underlying call was made with the expected @@ -2971,7 +3442,9 @@ async def test_test_iam_permissions_flattened_async(): @pytest.mark.asyncio async def test_test_iam_permissions_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2983,10 +3456,17 @@ async def test_test_iam_permissions_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [cloudtasks.ListTasksRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.ListTasksRequest, + dict, + ], +) def test_list_tasks(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3015,7 +3495,8 @@ def test_list_tasks_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3031,7 +3512,8 @@ async def test_list_tasks_async( transport: str = "grpc_asyncio", request_type=cloudtasks.ListTasksRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3042,7 +3524,9 @@ async def test_list_tasks_async( with mock.patch.object(type(client.transport.list_tasks), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - cloudtasks.ListTasksResponse(next_page_token="next_page_token_value",) + cloudtasks.ListTasksResponse( + next_page_token="next_page_token_value", + ) ) response = await client.list_tasks(request) @@ -3062,7 +3546,9 @@ async def test_list_tasks_async_from_dict(): def test_list_tasks_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3082,12 +3568,17 @@ def test_list_tasks_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_tasks_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3109,11 +3600,16 @@ async def test_list_tasks_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_tasks_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_tasks), "__call__") as call: @@ -3121,7 +3617,9 @@ def test_list_tasks_flattened(): call.return_value = cloudtasks.ListTasksResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_tasks(parent="parent_value",) + client.list_tasks( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3133,19 +3631,24 @@ def test_list_tasks_flattened(): def test_list_tasks_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_tasks( - cloudtasks.ListTasksRequest(), parent="parent_value", + cloudtasks.ListTasksRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_tasks_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_tasks), "__call__") as call: @@ -3157,7 +3660,9 @@ async def test_list_tasks_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_tasks(parent="parent_value",) + response = await client.list_tasks( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3170,19 +3675,23 @@ async def test_list_tasks_flattened_async(): @pytest.mark.asyncio async def test_list_tasks_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_tasks( - cloudtasks.ListTasksRequest(), parent="parent_value", + cloudtasks.ListTasksRequest(), + parent="parent_value", ) def test_list_tasks_pager(transport_name: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3190,11 +3699,29 @@ def test_list_tasks_pager(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListTasksResponse( - tasks=[task.Task(), task.Task(), task.Task(),], next_page_token="abc", + tasks=[ + task.Task(), + task.Task(), + task.Task(), + ], + next_page_token="abc", + ), + cloudtasks.ListTasksResponse( + tasks=[], + next_page_token="def", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + ], + next_page_token="ghi", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + task.Task(), + ], ), - cloudtasks.ListTasksResponse(tasks=[], next_page_token="def",), - cloudtasks.ListTasksResponse(tasks=[task.Task(),], next_page_token="ghi",), - cloudtasks.ListTasksResponse(tasks=[task.Task(), task.Task(),],), RuntimeError, ) @@ -3213,7 +3740,8 @@ def test_list_tasks_pager(transport_name: str = "grpc"): def test_list_tasks_pages(transport_name: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3221,11 +3749,29 @@ def test_list_tasks_pages(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListTasksResponse( - tasks=[task.Task(), task.Task(), task.Task(),], next_page_token="abc", + tasks=[ + task.Task(), + task.Task(), + task.Task(), + ], + next_page_token="abc", + ), + cloudtasks.ListTasksResponse( + tasks=[], + next_page_token="def", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + ], + next_page_token="ghi", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + task.Task(), + ], ), - cloudtasks.ListTasksResponse(tasks=[], next_page_token="def",), - cloudtasks.ListTasksResponse(tasks=[task.Task(),], next_page_token="ghi",), - cloudtasks.ListTasksResponse(tasks=[task.Task(), task.Task(),],), RuntimeError, ) pages = list(client.list_tasks(request={}).pages) @@ -3235,7 +3781,9 @@ def test_list_tasks_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_tasks_async_pager(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3244,14 +3792,34 @@ async def test_list_tasks_async_pager(): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListTasksResponse( - tasks=[task.Task(), task.Task(), task.Task(),], next_page_token="abc", + tasks=[ + task.Task(), + task.Task(), + task.Task(), + ], + next_page_token="abc", + ), + cloudtasks.ListTasksResponse( + tasks=[], + next_page_token="def", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + ], + next_page_token="ghi", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + task.Task(), + ], ), - cloudtasks.ListTasksResponse(tasks=[], next_page_token="def",), - cloudtasks.ListTasksResponse(tasks=[task.Task(),], next_page_token="ghi",), - cloudtasks.ListTasksResponse(tasks=[task.Task(), task.Task(),],), RuntimeError, ) - async_pager = await client.list_tasks(request={},) + async_pager = await client.list_tasks( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -3263,7 +3831,9 @@ async def test_list_tasks_async_pager(): @pytest.mark.asyncio async def test_list_tasks_async_pages(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3272,11 +3842,29 @@ async def test_list_tasks_async_pages(): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListTasksResponse( - tasks=[task.Task(), task.Task(), task.Task(),], next_page_token="abc", + tasks=[ + task.Task(), + task.Task(), + task.Task(), + ], + next_page_token="abc", + ), + cloudtasks.ListTasksResponse( + tasks=[], + next_page_token="def", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + ], + next_page_token="ghi", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + task.Task(), + ], ), - cloudtasks.ListTasksResponse(tasks=[], next_page_token="def",), - cloudtasks.ListTasksResponse(tasks=[task.Task(),], next_page_token="ghi",), - cloudtasks.ListTasksResponse(tasks=[task.Task(), task.Task(),],), RuntimeError, ) pages = [] @@ -3286,10 +3874,17 @@ async def test_list_tasks_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [cloudtasks.GetTaskRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.GetTaskRequest, + dict, + ], +) def test_get_task(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3327,7 +3922,8 @@ def test_get_task_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3343,7 +3939,8 @@ async def test_get_task_async( transport: str = "grpc_asyncio", request_type=cloudtasks.GetTaskRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3382,7 +3979,9 @@ async def test_get_task_async_from_dict(): def test_get_task_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3402,12 +4001,17 @@ def test_get_task_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_task_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3427,11 +4031,16 @@ async def test_get_task_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_task_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_task), "__call__") as call: @@ -3439,7 +4048,9 @@ def test_get_task_flattened(): call.return_value = task.Task() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_task(name="name_value",) + client.get_task( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3451,19 +4062,24 @@ def test_get_task_flattened(): def test_get_task_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_task( - cloudtasks.GetTaskRequest(), name="name_value", + cloudtasks.GetTaskRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_task_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_task), "__call__") as call: @@ -3473,7 +4089,9 @@ async def test_get_task_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(task.Task()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_task(name="name_value",) + response = await client.get_task( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3486,20 +4104,30 @@ async def test_get_task_flattened_async(): @pytest.mark.asyncio async def test_get_task_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_task( - cloudtasks.GetTaskRequest(), name="name_value", + cloudtasks.GetTaskRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [cloudtasks.CreateTaskRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.CreateTaskRequest, + dict, + ], +) def test_create_task(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3537,7 +4165,8 @@ def test_create_task_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3553,7 +4182,8 @@ async def test_create_task_async( transport: str = "grpc_asyncio", request_type=cloudtasks.CreateTaskRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3592,7 +4222,9 @@ async def test_create_task_async_from_dict(): def test_create_task_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3612,12 +4244,17 @@ def test_create_task_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_task_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3637,11 +4274,16 @@ async def test_create_task_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_task_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_task), "__call__") as call: @@ -3650,7 +4292,8 @@ def test_create_task_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.create_task( - parent="parent_value", task=gct_task.Task(name="name_value"), + parent="parent_value", + task=gct_task.Task(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -3666,7 +4309,9 @@ def test_create_task_flattened(): def test_create_task_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3680,7 +4325,9 @@ def test_create_task_flattened_error(): @pytest.mark.asyncio async def test_create_task_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_task), "__call__") as call: @@ -3691,7 +4338,8 @@ async def test_create_task_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.create_task( - parent="parent_value", task=gct_task.Task(name="name_value"), + parent="parent_value", + task=gct_task.Task(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -3708,7 +4356,9 @@ async def test_create_task_flattened_async(): @pytest.mark.asyncio async def test_create_task_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3720,10 +4370,17 @@ async def test_create_task_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [cloudtasks.DeleteTaskRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.DeleteTaskRequest, + dict, + ], +) def test_delete_task(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3749,7 +4406,8 @@ def test_delete_task_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3765,7 +4423,8 @@ async def test_delete_task_async( transport: str = "grpc_asyncio", request_type=cloudtasks.DeleteTaskRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3793,7 +4452,9 @@ async def test_delete_task_async_from_dict(): def test_delete_task_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3813,12 +4474,17 @@ def test_delete_task_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_task_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3838,11 +4504,16 @@ async def test_delete_task_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_task_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_task), "__call__") as call: @@ -3850,7 +4521,9 @@ def test_delete_task_flattened(): call.return_value = None # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_task(name="name_value",) + client.delete_task( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3862,19 +4535,24 @@ def test_delete_task_flattened(): def test_delete_task_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_task( - cloudtasks.DeleteTaskRequest(), name="name_value", + cloudtasks.DeleteTaskRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_task_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_task), "__call__") as call: @@ -3884,7 +4562,9 @@ async def test_delete_task_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_task(name="name_value",) + response = await client.delete_task( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3897,20 +4577,30 @@ async def test_delete_task_flattened_async(): @pytest.mark.asyncio async def test_delete_task_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_task( - cloudtasks.DeleteTaskRequest(), name="name_value", + cloudtasks.DeleteTaskRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [cloudtasks.RunTaskRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.RunTaskRequest, + dict, + ], +) def test_run_task(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3948,7 +4638,8 @@ def test_run_task_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3964,7 +4655,8 @@ async def test_run_task_async( transport: str = "grpc_asyncio", request_type=cloudtasks.RunTaskRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4003,7 +4695,9 @@ async def test_run_task_async_from_dict(): def test_run_task_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4023,12 +4717,17 @@ def test_run_task_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_run_task_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4048,11 +4747,16 @@ async def test_run_task_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_run_task_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.run_task), "__call__") as call: @@ -4060,7 +4764,9 @@ def test_run_task_flattened(): call.return_value = task.Task() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.run_task(name="name_value",) + client.run_task( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4072,19 +4778,24 @@ def test_run_task_flattened(): def test_run_task_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.run_task( - cloudtasks.RunTaskRequest(), name="name_value", + cloudtasks.RunTaskRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_run_task_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.run_task), "__call__") as call: @@ -4094,7 +4805,9 @@ async def test_run_task_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(task.Task()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.run_task(name="name_value",) + response = await client.run_task( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4107,13 +4820,16 @@ async def test_run_task_flattened_async(): @pytest.mark.asyncio async def test_run_task_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.run_task( - cloudtasks.RunTaskRequest(), name="name_value", + cloudtasks.RunTaskRequest(), + name="name_value", ) @@ -4124,7 +4840,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -4144,7 +4861,10 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = CloudTasksClient(client_options=options, transport=transport,) + client = CloudTasksClient( + client_options=options, + transport=transport, + ) # It is an error to provide an api_key and a credential. options = mock.Mock() @@ -4160,7 +4880,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = CloudTasksClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -4190,7 +4911,10 @@ def test_transport_get_channel(): @pytest.mark.parametrize( "transport_class", - [transports.CloudTasksGrpcTransport, transports.CloudTasksGrpcAsyncIOTransport,], + [ + transports.CloudTasksGrpcTransport, + transports.CloudTasksGrpcAsyncIOTransport, + ], ) def test_transport_adc(transport_class): # Test default credentials are used if not provided. @@ -4202,8 +4926,13 @@ def test_transport_adc(transport_class): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) - assert isinstance(client.transport, transports.CloudTasksGrpcTransport,) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.CloudTasksGrpcTransport, + ) def test_cloud_tasks_base_transport_error(): @@ -4263,7 +4992,8 @@ def test_cloud_tasks_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.CloudTasksTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -4298,7 +5028,10 @@ def test_cloud_tasks_auth_adc(): @pytest.mark.parametrize( "transport_class", - [transports.CloudTasksGrpcTransport, transports.CloudTasksGrpcAsyncIOTransport,], + [ + transports.CloudTasksGrpcTransport, + transports.CloudTasksGrpcAsyncIOTransport, + ], ) def test_cloud_tasks_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use @@ -4415,7 +5148,8 @@ def test_cloud_tasks_grpc_transport_channel(): # Check that channel is used if provided. transport = transports.CloudTasksGrpcTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -4427,7 +5161,8 @@ def test_cloud_tasks_grpc_asyncio_transport_channel(): # Check that channel is used if provided. transport = transports.CloudTasksGrpcAsyncIOTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -4531,7 +5266,9 @@ def test_queue_path(): location = "clam" queue = "whelk" expected = "projects/{project}/locations/{location}/queues/{queue}".format( - project=project, location=location, queue=queue, + project=project, + location=location, + queue=queue, ) actual = CloudTasksClient.queue_path(project, location, queue) assert expected == actual @@ -4555,8 +5292,13 @@ def test_task_path(): location = "mussel" queue = "winkle" task = "nautilus" - expected = "projects/{project}/locations/{location}/queues/{queue}/tasks/{task}".format( - project=project, location=location, queue=queue, task=task, + expected = ( + "projects/{project}/locations/{location}/queues/{queue}/tasks/{task}".format( + project=project, + location=location, + queue=queue, + task=task, + ) ) actual = CloudTasksClient.task_path(project, location, queue, task) assert expected == actual @@ -4598,7 +5340,9 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): folder = "oyster" - expected = "folders/{folder}".format(folder=folder,) + expected = "folders/{folder}".format( + folder=folder, + ) actual = CloudTasksClient.common_folder_path(folder) assert expected == actual @@ -4616,7 +5360,9 @@ def test_parse_common_folder_path(): def test_common_organization_path(): organization = "cuttlefish" - expected = "organizations/{organization}".format(organization=organization,) + expected = "organizations/{organization}".format( + organization=organization, + ) actual = CloudTasksClient.common_organization_path(organization) assert expected == actual @@ -4634,7 +5380,9 @@ def test_parse_common_organization_path(): def test_common_project_path(): project = "winkle" - expected = "projects/{project}".format(project=project,) + expected = "projects/{project}".format( + project=project, + ) actual = CloudTasksClient.common_project_path(project) assert expected == actual @@ -4654,7 +5402,8 @@ def test_common_location_path(): project = "scallop" location = "abalone" expected = "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) actual = CloudTasksClient.common_location_path(project, location) assert expected == actual @@ -4679,7 +5428,8 @@ def test_client_with_default_client_info(): transports.CloudTasksTransport, "_prep_wrapped_messages" ) as prep: client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4688,7 +5438,8 @@ def test_client_with_default_client_info(): ) as prep: transport_class = CloudTasksClient.get_transport_class() transport = transport_class( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4696,7 +5447,8 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) with mock.patch.object( type(getattr(client.transport, "grpc_channel")), "close" diff --git a/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py b/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py index 94a3841f..a8706cd3 100644 --- a/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py +++ b/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py @@ -95,7 +95,13 @@ def test__get_default_mtls_endpoint(): assert CloudTasksClient._get_default_mtls_endpoint(non_googleapi) == non_googleapi -@pytest.mark.parametrize("client_class", [CloudTasksClient, CloudTasksAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + CloudTasksClient, + CloudTasksAsyncClient, + ], +) def test_cloud_tasks_client_from_service_account_info(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -135,7 +141,13 @@ def test_cloud_tasks_client_service_account_always_use_jwt( use_jwt.assert_not_called() -@pytest.mark.parametrize("client_class", [CloudTasksClient, CloudTasksAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + CloudTasksClient, + CloudTasksAsyncClient, + ], +) def test_cloud_tasks_client_from_service_account_file(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -490,7 +502,9 @@ def test_cloud_tasks_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -618,10 +632,17 @@ def test_cloud_tasks_client_create_channel_credentials_file( ) -@pytest.mark.parametrize("request_type", [cloudtasks.ListQueuesRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.ListQueuesRequest, + dict, + ], +) def test_list_queues(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -650,7 +671,8 @@ def test_list_queues_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -666,7 +688,8 @@ async def test_list_queues_async( transport: str = "grpc_asyncio", request_type=cloudtasks.ListQueuesRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -677,7 +700,9 @@ async def test_list_queues_async( with mock.patch.object(type(client.transport.list_queues), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - cloudtasks.ListQueuesResponse(next_page_token="next_page_token_value",) + cloudtasks.ListQueuesResponse( + next_page_token="next_page_token_value", + ) ) response = await client.list_queues(request) @@ -697,7 +722,9 @@ async def test_list_queues_async_from_dict(): def test_list_queues_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -717,12 +744,17 @@ def test_list_queues_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_queues_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -744,11 +776,16 @@ async def test_list_queues_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_queues_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_queues), "__call__") as call: @@ -756,7 +793,9 @@ def test_list_queues_flattened(): call.return_value = cloudtasks.ListQueuesResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_queues(parent="parent_value",) + client.list_queues( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -768,19 +807,24 @@ def test_list_queues_flattened(): def test_list_queues_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_queues( - cloudtasks.ListQueuesRequest(), parent="parent_value", + cloudtasks.ListQueuesRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_queues_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_queues), "__call__") as call: @@ -792,7 +836,9 @@ async def test_list_queues_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_queues(parent="parent_value",) + response = await client.list_queues( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -805,19 +851,23 @@ async def test_list_queues_flattened_async(): @pytest.mark.asyncio async def test_list_queues_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_queues( - cloudtasks.ListQueuesRequest(), parent="parent_value", + cloudtasks.ListQueuesRequest(), + parent="parent_value", ) def test_list_queues_pager(transport_name: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -825,14 +875,29 @@ def test_list_queues_pager(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListQueuesResponse( - queues=[queue.Queue(), queue.Queue(), queue.Queue(),], + queues=[ + queue.Queue(), + queue.Queue(), + queue.Queue(), + ], next_page_token="abc", ), - cloudtasks.ListQueuesResponse(queues=[], next_page_token="def",), cloudtasks.ListQueuesResponse( - queues=[queue.Queue(),], next_page_token="ghi", + queues=[], + next_page_token="def", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + ], + next_page_token="ghi", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + queue.Queue(), + ], ), - cloudtasks.ListQueuesResponse(queues=[queue.Queue(), queue.Queue(),],), RuntimeError, ) @@ -851,7 +916,8 @@ def test_list_queues_pager(transport_name: str = "grpc"): def test_list_queues_pages(transport_name: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -859,14 +925,29 @@ def test_list_queues_pages(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListQueuesResponse( - queues=[queue.Queue(), queue.Queue(), queue.Queue(),], + queues=[ + queue.Queue(), + queue.Queue(), + queue.Queue(), + ], next_page_token="abc", ), - cloudtasks.ListQueuesResponse(queues=[], next_page_token="def",), cloudtasks.ListQueuesResponse( - queues=[queue.Queue(),], next_page_token="ghi", + queues=[], + next_page_token="def", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + ], + next_page_token="ghi", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + queue.Queue(), + ], ), - cloudtasks.ListQueuesResponse(queues=[queue.Queue(), queue.Queue(),],), RuntimeError, ) pages = list(client.list_queues(request={}).pages) @@ -876,7 +957,9 @@ def test_list_queues_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_queues_async_pager(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -885,17 +968,34 @@ async def test_list_queues_async_pager(): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListQueuesResponse( - queues=[queue.Queue(), queue.Queue(), queue.Queue(),], + queues=[ + queue.Queue(), + queue.Queue(), + queue.Queue(), + ], next_page_token="abc", ), - cloudtasks.ListQueuesResponse(queues=[], next_page_token="def",), cloudtasks.ListQueuesResponse( - queues=[queue.Queue(),], next_page_token="ghi", + queues=[], + next_page_token="def", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + ], + next_page_token="ghi", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + queue.Queue(), + ], ), - cloudtasks.ListQueuesResponse(queues=[queue.Queue(), queue.Queue(),],), RuntimeError, ) - async_pager = await client.list_queues(request={},) + async_pager = await client.list_queues( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -907,7 +1007,9 @@ async def test_list_queues_async_pager(): @pytest.mark.asyncio async def test_list_queues_async_pages(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -916,14 +1018,29 @@ async def test_list_queues_async_pages(): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListQueuesResponse( - queues=[queue.Queue(), queue.Queue(), queue.Queue(),], + queues=[ + queue.Queue(), + queue.Queue(), + queue.Queue(), + ], next_page_token="abc", ), - cloudtasks.ListQueuesResponse(queues=[], next_page_token="def",), cloudtasks.ListQueuesResponse( - queues=[queue.Queue(),], next_page_token="ghi", + queues=[], + next_page_token="def", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + ], + next_page_token="ghi", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + queue.Queue(), + ], ), - cloudtasks.ListQueuesResponse(queues=[queue.Queue(), queue.Queue(),],), RuntimeError, ) pages = [] @@ -933,10 +1050,17 @@ async def test_list_queues_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [cloudtasks.GetQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.GetQueueRequest, + dict, + ], +) def test_get_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -972,7 +1096,8 @@ def test_get_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -988,7 +1113,8 @@ async def test_get_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.GetQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -999,7 +1125,10 @@ async def test_get_queue_async( with mock.patch.object(type(client.transport.get_queue), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - queue.Queue(name="name_value", state=queue.Queue.State.RUNNING,) + queue.Queue( + name="name_value", + state=queue.Queue.State.RUNNING, + ) ) response = await client.get_queue(request) @@ -1020,7 +1149,9 @@ async def test_get_queue_async_from_dict(): def test_get_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1040,12 +1171,17 @@ def test_get_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1065,11 +1201,16 @@ async def test_get_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_queue), "__call__") as call: @@ -1077,7 +1218,9 @@ def test_get_queue_flattened(): call.return_value = queue.Queue() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_queue(name="name_value",) + client.get_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1089,19 +1232,24 @@ def test_get_queue_flattened(): def test_get_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_queue( - cloudtasks.GetQueueRequest(), name="name_value", + cloudtasks.GetQueueRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_queue), "__call__") as call: @@ -1111,7 +1259,9 @@ async def test_get_queue_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(queue.Queue()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_queue(name="name_value",) + response = await client.get_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1124,20 +1274,30 @@ async def test_get_queue_flattened_async(): @pytest.mark.asyncio async def test_get_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_queue( - cloudtasks.GetQueueRequest(), name="name_value", + cloudtasks.GetQueueRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [cloudtasks.CreateQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.CreateQueueRequest, + dict, + ], +) def test_create_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1173,7 +1333,8 @@ def test_create_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1189,7 +1350,8 @@ async def test_create_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.CreateQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1200,7 +1362,10 @@ async def test_create_queue_async( with mock.patch.object(type(client.transport.create_queue), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - gct_queue.Queue(name="name_value", state=gct_queue.Queue.State.RUNNING,) + gct_queue.Queue( + name="name_value", + state=gct_queue.Queue.State.RUNNING, + ) ) response = await client.create_queue(request) @@ -1221,7 +1386,9 @@ async def test_create_queue_async_from_dict(): def test_create_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1241,12 +1408,17 @@ def test_create_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1266,11 +1438,16 @@ async def test_create_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_queue), "__call__") as call: @@ -1279,7 +1456,8 @@ def test_create_queue_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.create_queue( - parent="parent_value", queue=gct_queue.Queue(name="name_value"), + parent="parent_value", + queue=gct_queue.Queue(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -1295,7 +1473,9 @@ def test_create_queue_flattened(): def test_create_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1309,7 +1489,9 @@ def test_create_queue_flattened_error(): @pytest.mark.asyncio async def test_create_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_queue), "__call__") as call: @@ -1320,7 +1502,8 @@ async def test_create_queue_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.create_queue( - parent="parent_value", queue=gct_queue.Queue(name="name_value"), + parent="parent_value", + queue=gct_queue.Queue(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -1337,7 +1520,9 @@ async def test_create_queue_flattened_async(): @pytest.mark.asyncio async def test_create_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1349,10 +1534,17 @@ async def test_create_queue_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [cloudtasks.UpdateQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.UpdateQueueRequest, + dict, + ], +) def test_update_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1388,7 +1580,8 @@ def test_update_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1404,7 +1597,8 @@ async def test_update_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.UpdateQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1415,7 +1609,10 @@ async def test_update_queue_async( with mock.patch.object(type(client.transport.update_queue), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - gct_queue.Queue(name="name_value", state=gct_queue.Queue.State.RUNNING,) + gct_queue.Queue( + name="name_value", + state=gct_queue.Queue.State.RUNNING, + ) ) response = await client.update_queue(request) @@ -1436,7 +1633,9 @@ async def test_update_queue_async_from_dict(): def test_update_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1456,12 +1655,17 @@ def test_update_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "queue.name=queue.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "queue.name=queue.name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_update_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1481,11 +1685,16 @@ async def test_update_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "queue.name=queue.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "queue.name=queue.name/value", + ) in kw["metadata"] def test_update_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_queue), "__call__") as call: @@ -1511,7 +1720,9 @@ def test_update_queue_flattened(): def test_update_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1525,7 +1736,9 @@ def test_update_queue_flattened_error(): @pytest.mark.asyncio async def test_update_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_queue), "__call__") as call: @@ -1554,7 +1767,9 @@ async def test_update_queue_flattened_async(): @pytest.mark.asyncio async def test_update_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1566,10 +1781,17 @@ async def test_update_queue_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [cloudtasks.DeleteQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.DeleteQueueRequest, + dict, + ], +) def test_delete_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1595,7 +1817,8 @@ def test_delete_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1611,7 +1834,8 @@ async def test_delete_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.DeleteQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1639,7 +1863,9 @@ async def test_delete_queue_async_from_dict(): def test_delete_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1659,12 +1885,17 @@ def test_delete_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1684,11 +1915,16 @@ async def test_delete_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_queue), "__call__") as call: @@ -1696,7 +1932,9 @@ def test_delete_queue_flattened(): call.return_value = None # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_queue(name="name_value",) + client.delete_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1708,19 +1946,24 @@ def test_delete_queue_flattened(): def test_delete_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_queue( - cloudtasks.DeleteQueueRequest(), name="name_value", + cloudtasks.DeleteQueueRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_queue), "__call__") as call: @@ -1730,7 +1973,9 @@ async def test_delete_queue_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_queue(name="name_value",) + response = await client.delete_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1743,20 +1988,30 @@ async def test_delete_queue_flattened_async(): @pytest.mark.asyncio async def test_delete_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_queue( - cloudtasks.DeleteQueueRequest(), name="name_value", + cloudtasks.DeleteQueueRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [cloudtasks.PurgeQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.PurgeQueueRequest, + dict, + ], +) def test_purge_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1792,7 +2047,8 @@ def test_purge_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1808,7 +2064,8 @@ async def test_purge_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.PurgeQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1819,7 +2076,10 @@ async def test_purge_queue_async( with mock.patch.object(type(client.transport.purge_queue), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - queue.Queue(name="name_value", state=queue.Queue.State.RUNNING,) + queue.Queue( + name="name_value", + state=queue.Queue.State.RUNNING, + ) ) response = await client.purge_queue(request) @@ -1840,7 +2100,9 @@ async def test_purge_queue_async_from_dict(): def test_purge_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1860,12 +2122,17 @@ def test_purge_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_purge_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1885,11 +2152,16 @@ async def test_purge_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_purge_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_queue), "__call__") as call: @@ -1897,7 +2169,9 @@ def test_purge_queue_flattened(): call.return_value = queue.Queue() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.purge_queue(name="name_value",) + client.purge_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1909,19 +2183,24 @@ def test_purge_queue_flattened(): def test_purge_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.purge_queue( - cloudtasks.PurgeQueueRequest(), name="name_value", + cloudtasks.PurgeQueueRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_purge_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_queue), "__call__") as call: @@ -1931,7 +2210,9 @@ async def test_purge_queue_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(queue.Queue()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.purge_queue(name="name_value",) + response = await client.purge_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1944,20 +2225,30 @@ async def test_purge_queue_flattened_async(): @pytest.mark.asyncio async def test_purge_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.purge_queue( - cloudtasks.PurgeQueueRequest(), name="name_value", + cloudtasks.PurgeQueueRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [cloudtasks.PauseQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.PauseQueueRequest, + dict, + ], +) def test_pause_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1993,7 +2284,8 @@ def test_pause_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2009,7 +2301,8 @@ async def test_pause_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.PauseQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2020,7 +2313,10 @@ async def test_pause_queue_async( with mock.patch.object(type(client.transport.pause_queue), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - queue.Queue(name="name_value", state=queue.Queue.State.RUNNING,) + queue.Queue( + name="name_value", + state=queue.Queue.State.RUNNING, + ) ) response = await client.pause_queue(request) @@ -2041,7 +2337,9 @@ async def test_pause_queue_async_from_dict(): def test_pause_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2061,14 +2359,19 @@ def test_pause_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_pause_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) - - # Any value that is part of the HTTP/1.1 URI should be sent as + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + + # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. request = cloudtasks.PauseQueueRequest() @@ -2086,11 +2389,16 @@ async def test_pause_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_pause_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.pause_queue), "__call__") as call: @@ -2098,7 +2406,9 @@ def test_pause_queue_flattened(): call.return_value = queue.Queue() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.pause_queue(name="name_value",) + client.pause_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2110,19 +2420,24 @@ def test_pause_queue_flattened(): def test_pause_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.pause_queue( - cloudtasks.PauseQueueRequest(), name="name_value", + cloudtasks.PauseQueueRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_pause_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.pause_queue), "__call__") as call: @@ -2132,7 +2447,9 @@ async def test_pause_queue_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(queue.Queue()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.pause_queue(name="name_value",) + response = await client.pause_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2145,20 +2462,30 @@ async def test_pause_queue_flattened_async(): @pytest.mark.asyncio async def test_pause_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.pause_queue( - cloudtasks.PauseQueueRequest(), name="name_value", + cloudtasks.PauseQueueRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [cloudtasks.ResumeQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.ResumeQueueRequest, + dict, + ], +) def test_resume_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2194,7 +2521,8 @@ def test_resume_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2210,7 +2538,8 @@ async def test_resume_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.ResumeQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2221,7 +2550,10 @@ async def test_resume_queue_async( with mock.patch.object(type(client.transport.resume_queue), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - queue.Queue(name="name_value", state=queue.Queue.State.RUNNING,) + queue.Queue( + name="name_value", + state=queue.Queue.State.RUNNING, + ) ) response = await client.resume_queue(request) @@ -2242,7 +2574,9 @@ async def test_resume_queue_async_from_dict(): def test_resume_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2262,12 +2596,17 @@ def test_resume_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_resume_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2287,11 +2626,16 @@ async def test_resume_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_resume_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.resume_queue), "__call__") as call: @@ -2299,7 +2643,9 @@ def test_resume_queue_flattened(): call.return_value = queue.Queue() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.resume_queue(name="name_value",) + client.resume_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2311,19 +2657,24 @@ def test_resume_queue_flattened(): def test_resume_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.resume_queue( - cloudtasks.ResumeQueueRequest(), name="name_value", + cloudtasks.ResumeQueueRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_resume_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.resume_queue), "__call__") as call: @@ -2333,7 +2684,9 @@ async def test_resume_queue_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(queue.Queue()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.resume_queue(name="name_value",) + response = await client.resume_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2346,20 +2699,30 @@ async def test_resume_queue_flattened_async(): @pytest.mark.asyncio async def test_resume_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.resume_queue( - cloudtasks.ResumeQueueRequest(), name="name_value", + cloudtasks.ResumeQueueRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [iam_policy_pb2.GetIamPolicyRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + iam_policy_pb2.GetIamPolicyRequest, + dict, + ], +) def test_get_iam_policy(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2369,7 +2732,10 @@ def test_get_iam_policy(request_type, transport: str = "grpc"): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. - call.return_value = policy_pb2.Policy(version=774, etag=b"etag_blob",) + call.return_value = policy_pb2.Policy( + version=774, + etag=b"etag_blob", + ) response = client.get_iam_policy(request) # Establish that the underlying gRPC stub method was called. @@ -2387,7 +2753,8 @@ def test_get_iam_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2403,7 +2770,8 @@ async def test_get_iam_policy_async( transport: str = "grpc_asyncio", request_type=iam_policy_pb2.GetIamPolicyRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2414,7 +2782,10 @@ async def test_get_iam_policy_async( with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - policy_pb2.Policy(version=774, etag=b"etag_blob",) + policy_pb2.Policy( + version=774, + etag=b"etag_blob", + ) ) response = await client.get_iam_policy(request) @@ -2435,7 +2806,9 @@ async def test_get_iam_policy_async_from_dict(): def test_get_iam_policy_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2455,12 +2828,17 @@ def test_get_iam_policy_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_iam_policy_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2480,11 +2858,16 @@ async def test_get_iam_policy_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] def test_get_iam_policy_from_dict_foreign(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. @@ -2499,7 +2882,9 @@ def test_get_iam_policy_from_dict_foreign(): def test_get_iam_policy_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -2507,7 +2892,9 @@ def test_get_iam_policy_flattened(): call.return_value = policy_pb2.Policy() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_iam_policy(resource="resource_value",) + client.get_iam_policy( + resource="resource_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2519,19 +2906,24 @@ def test_get_iam_policy_flattened(): def test_get_iam_policy_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_iam_policy( - iam_policy_pb2.GetIamPolicyRequest(), resource="resource_value", + iam_policy_pb2.GetIamPolicyRequest(), + resource="resource_value", ) @pytest.mark.asyncio async def test_get_iam_policy_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -2541,7 +2933,9 @@ async def test_get_iam_policy_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy_pb2.Policy()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_iam_policy(resource="resource_value",) + response = await client.get_iam_policy( + resource="resource_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2554,20 +2948,30 @@ async def test_get_iam_policy_flattened_async(): @pytest.mark.asyncio async def test_get_iam_policy_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_iam_policy( - iam_policy_pb2.GetIamPolicyRequest(), resource="resource_value", + iam_policy_pb2.GetIamPolicyRequest(), + resource="resource_value", ) -@pytest.mark.parametrize("request_type", [iam_policy_pb2.SetIamPolicyRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + iam_policy_pb2.SetIamPolicyRequest, + dict, + ], +) def test_set_iam_policy(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2577,7 +2981,10 @@ def test_set_iam_policy(request_type, transport: str = "grpc"): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. - call.return_value = policy_pb2.Policy(version=774, etag=b"etag_blob",) + call.return_value = policy_pb2.Policy( + version=774, + etag=b"etag_blob", + ) response = client.set_iam_policy(request) # Establish that the underlying gRPC stub method was called. @@ -2595,7 +3002,8 @@ def test_set_iam_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2611,7 +3019,8 @@ async def test_set_iam_policy_async( transport: str = "grpc_asyncio", request_type=iam_policy_pb2.SetIamPolicyRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2622,7 +3031,10 @@ async def test_set_iam_policy_async( with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - policy_pb2.Policy(version=774, etag=b"etag_blob",) + policy_pb2.Policy( + version=774, + etag=b"etag_blob", + ) ) response = await client.set_iam_policy(request) @@ -2643,7 +3055,9 @@ async def test_set_iam_policy_async_from_dict(): def test_set_iam_policy_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2663,12 +3077,17 @@ def test_set_iam_policy_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_set_iam_policy_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2688,11 +3107,16 @@ async def test_set_iam_policy_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] def test_set_iam_policy_from_dict_foreign(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. @@ -2707,7 +3131,9 @@ def test_set_iam_policy_from_dict_foreign(): def test_set_iam_policy_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -2715,7 +3141,9 @@ def test_set_iam_policy_flattened(): call.return_value = policy_pb2.Policy() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.set_iam_policy(resource="resource_value",) + client.set_iam_policy( + resource="resource_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2727,19 +3155,24 @@ def test_set_iam_policy_flattened(): def test_set_iam_policy_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.set_iam_policy( - iam_policy_pb2.SetIamPolicyRequest(), resource="resource_value", + iam_policy_pb2.SetIamPolicyRequest(), + resource="resource_value", ) @pytest.mark.asyncio async def test_set_iam_policy_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -2749,7 +3182,9 @@ async def test_set_iam_policy_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy_pb2.Policy()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.set_iam_policy(resource="resource_value",) + response = await client.set_iam_policy( + resource="resource_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2762,22 +3197,30 @@ async def test_set_iam_policy_flattened_async(): @pytest.mark.asyncio async def test_set_iam_policy_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.set_iam_policy( - iam_policy_pb2.SetIamPolicyRequest(), resource="resource_value", + iam_policy_pb2.SetIamPolicyRequest(), + resource="resource_value", ) @pytest.mark.parametrize( - "request_type", [iam_policy_pb2.TestIamPermissionsRequest, dict,] + "request_type", + [ + iam_policy_pb2.TestIamPermissionsRequest, + dict, + ], ) def test_test_iam_permissions(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2808,7 +3251,8 @@ def test_test_iam_permissions_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2827,7 +3271,8 @@ async def test_test_iam_permissions_async( request_type=iam_policy_pb2.TestIamPermissionsRequest, ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2862,7 +3307,9 @@ async def test_test_iam_permissions_async_from_dict(): def test_test_iam_permissions_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2884,12 +3331,17 @@ def test_test_iam_permissions_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_test_iam_permissions_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2913,11 +3365,16 @@ async def test_test_iam_permissions_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] def test_test_iam_permissions_from_dict_foreign(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.test_iam_permissions), "__call__" @@ -2934,7 +3391,9 @@ def test_test_iam_permissions_from_dict_foreign(): def test_test_iam_permissions_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2945,7 +3404,8 @@ def test_test_iam_permissions_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.test_iam_permissions( - resource="resource_value", permissions=["permissions_value"], + resource="resource_value", + permissions=["permissions_value"], ) # Establish that the underlying call was made with the expected @@ -2961,7 +3421,9 @@ def test_test_iam_permissions_flattened(): def test_test_iam_permissions_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2975,7 +3437,9 @@ def test_test_iam_permissions_flattened_error(): @pytest.mark.asyncio async def test_test_iam_permissions_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2990,7 +3454,8 @@ async def test_test_iam_permissions_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.test_iam_permissions( - resource="resource_value", permissions=["permissions_value"], + resource="resource_value", + permissions=["permissions_value"], ) # Establish that the underlying call was made with the expected @@ -3007,7 +3472,9 @@ async def test_test_iam_permissions_flattened_async(): @pytest.mark.asyncio async def test_test_iam_permissions_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3019,10 +3486,17 @@ async def test_test_iam_permissions_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [cloudtasks.ListTasksRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.ListTasksRequest, + dict, + ], +) def test_list_tasks(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3051,7 +3525,8 @@ def test_list_tasks_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3067,7 +3542,8 @@ async def test_list_tasks_async( transport: str = "grpc_asyncio", request_type=cloudtasks.ListTasksRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3078,7 +3554,9 @@ async def test_list_tasks_async( with mock.patch.object(type(client.transport.list_tasks), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - cloudtasks.ListTasksResponse(next_page_token="next_page_token_value",) + cloudtasks.ListTasksResponse( + next_page_token="next_page_token_value", + ) ) response = await client.list_tasks(request) @@ -3098,7 +3576,9 @@ async def test_list_tasks_async_from_dict(): def test_list_tasks_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3118,12 +3598,17 @@ def test_list_tasks_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_tasks_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3145,11 +3630,16 @@ async def test_list_tasks_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_tasks_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_tasks), "__call__") as call: @@ -3157,7 +3647,9 @@ def test_list_tasks_flattened(): call.return_value = cloudtasks.ListTasksResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_tasks(parent="parent_value",) + client.list_tasks( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3169,19 +3661,24 @@ def test_list_tasks_flattened(): def test_list_tasks_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_tasks( - cloudtasks.ListTasksRequest(), parent="parent_value", + cloudtasks.ListTasksRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_tasks_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_tasks), "__call__") as call: @@ -3193,7 +3690,9 @@ async def test_list_tasks_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_tasks(parent="parent_value",) + response = await client.list_tasks( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3206,19 +3705,23 @@ async def test_list_tasks_flattened_async(): @pytest.mark.asyncio async def test_list_tasks_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_tasks( - cloudtasks.ListTasksRequest(), parent="parent_value", + cloudtasks.ListTasksRequest(), + parent="parent_value", ) def test_list_tasks_pager(transport_name: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3226,11 +3729,29 @@ def test_list_tasks_pager(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListTasksResponse( - tasks=[task.Task(), task.Task(), task.Task(),], next_page_token="abc", + tasks=[ + task.Task(), + task.Task(), + task.Task(), + ], + next_page_token="abc", + ), + cloudtasks.ListTasksResponse( + tasks=[], + next_page_token="def", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + ], + next_page_token="ghi", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + task.Task(), + ], ), - cloudtasks.ListTasksResponse(tasks=[], next_page_token="def",), - cloudtasks.ListTasksResponse(tasks=[task.Task(),], next_page_token="ghi",), - cloudtasks.ListTasksResponse(tasks=[task.Task(), task.Task(),],), RuntimeError, ) @@ -3249,7 +3770,8 @@ def test_list_tasks_pager(transport_name: str = "grpc"): def test_list_tasks_pages(transport_name: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3257,11 +3779,29 @@ def test_list_tasks_pages(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListTasksResponse( - tasks=[task.Task(), task.Task(), task.Task(),], next_page_token="abc", + tasks=[ + task.Task(), + task.Task(), + task.Task(), + ], + next_page_token="abc", + ), + cloudtasks.ListTasksResponse( + tasks=[], + next_page_token="def", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + ], + next_page_token="ghi", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + task.Task(), + ], ), - cloudtasks.ListTasksResponse(tasks=[], next_page_token="def",), - cloudtasks.ListTasksResponse(tasks=[task.Task(),], next_page_token="ghi",), - cloudtasks.ListTasksResponse(tasks=[task.Task(), task.Task(),],), RuntimeError, ) pages = list(client.list_tasks(request={}).pages) @@ -3271,7 +3811,9 @@ def test_list_tasks_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_tasks_async_pager(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3280,14 +3822,34 @@ async def test_list_tasks_async_pager(): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListTasksResponse( - tasks=[task.Task(), task.Task(), task.Task(),], next_page_token="abc", + tasks=[ + task.Task(), + task.Task(), + task.Task(), + ], + next_page_token="abc", + ), + cloudtasks.ListTasksResponse( + tasks=[], + next_page_token="def", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + ], + next_page_token="ghi", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + task.Task(), + ], ), - cloudtasks.ListTasksResponse(tasks=[], next_page_token="def",), - cloudtasks.ListTasksResponse(tasks=[task.Task(),], next_page_token="ghi",), - cloudtasks.ListTasksResponse(tasks=[task.Task(), task.Task(),],), RuntimeError, ) - async_pager = await client.list_tasks(request={},) + async_pager = await client.list_tasks( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -3299,7 +3861,9 @@ async def test_list_tasks_async_pager(): @pytest.mark.asyncio async def test_list_tasks_async_pages(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3308,11 +3872,29 @@ async def test_list_tasks_async_pages(): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListTasksResponse( - tasks=[task.Task(), task.Task(), task.Task(),], next_page_token="abc", + tasks=[ + task.Task(), + task.Task(), + task.Task(), + ], + next_page_token="abc", + ), + cloudtasks.ListTasksResponse( + tasks=[], + next_page_token="def", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + ], + next_page_token="ghi", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + task.Task(), + ], ), - cloudtasks.ListTasksResponse(tasks=[], next_page_token="def",), - cloudtasks.ListTasksResponse(tasks=[task.Task(),], next_page_token="ghi",), - cloudtasks.ListTasksResponse(tasks=[task.Task(), task.Task(),],), RuntimeError, ) pages = [] @@ -3322,10 +3904,17 @@ async def test_list_tasks_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [cloudtasks.GetTaskRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.GetTaskRequest, + dict, + ], +) def test_get_task(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3359,7 +3948,8 @@ def test_get_task_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3375,7 +3965,8 @@ async def test_get_task_async( transport: str = "grpc_asyncio", request_type=cloudtasks.GetTaskRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3386,7 +3977,10 @@ async def test_get_task_async( with mock.patch.object(type(client.transport.get_task), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - task.Task(name="name_value", view=task.Task.View.BASIC,) + task.Task( + name="name_value", + view=task.Task.View.BASIC, + ) ) response = await client.get_task(request) @@ -3407,7 +4001,9 @@ async def test_get_task_async_from_dict(): def test_get_task_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3427,12 +4023,17 @@ def test_get_task_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_task_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3452,11 +4053,16 @@ async def test_get_task_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_task_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_task), "__call__") as call: @@ -3464,7 +4070,9 @@ def test_get_task_flattened(): call.return_value = task.Task() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_task(name="name_value",) + client.get_task( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3476,19 +4084,24 @@ def test_get_task_flattened(): def test_get_task_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_task( - cloudtasks.GetTaskRequest(), name="name_value", + cloudtasks.GetTaskRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_task_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_task), "__call__") as call: @@ -3498,7 +4111,9 @@ async def test_get_task_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(task.Task()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_task(name="name_value",) + response = await client.get_task( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3511,20 +4126,30 @@ async def test_get_task_flattened_async(): @pytest.mark.asyncio async def test_get_task_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_task( - cloudtasks.GetTaskRequest(), name="name_value", + cloudtasks.GetTaskRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [cloudtasks.CreateTaskRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.CreateTaskRequest, + dict, + ], +) def test_create_task(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3558,7 +4183,8 @@ def test_create_task_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3574,7 +4200,8 @@ async def test_create_task_async( transport: str = "grpc_asyncio", request_type=cloudtasks.CreateTaskRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3585,7 +4212,10 @@ async def test_create_task_async( with mock.patch.object(type(client.transport.create_task), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - gct_task.Task(name="name_value", view=gct_task.Task.View.BASIC,) + gct_task.Task( + name="name_value", + view=gct_task.Task.View.BASIC, + ) ) response = await client.create_task(request) @@ -3606,7 +4236,9 @@ async def test_create_task_async_from_dict(): def test_create_task_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3626,12 +4258,17 @@ def test_create_task_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_task_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3651,11 +4288,16 @@ async def test_create_task_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_task_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_task), "__call__") as call: @@ -3664,7 +4306,8 @@ def test_create_task_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.create_task( - parent="parent_value", task=gct_task.Task(name="name_value"), + parent="parent_value", + task=gct_task.Task(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -3680,7 +4323,9 @@ def test_create_task_flattened(): def test_create_task_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3694,7 +4339,9 @@ def test_create_task_flattened_error(): @pytest.mark.asyncio async def test_create_task_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_task), "__call__") as call: @@ -3705,7 +4352,8 @@ async def test_create_task_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.create_task( - parent="parent_value", task=gct_task.Task(name="name_value"), + parent="parent_value", + task=gct_task.Task(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -3722,7 +4370,9 @@ async def test_create_task_flattened_async(): @pytest.mark.asyncio async def test_create_task_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3734,10 +4384,17 @@ async def test_create_task_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [cloudtasks.DeleteTaskRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.DeleteTaskRequest, + dict, + ], +) def test_delete_task(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3763,7 +4420,8 @@ def test_delete_task_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3779,7 +4437,8 @@ async def test_delete_task_async( transport: str = "grpc_asyncio", request_type=cloudtasks.DeleteTaskRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3807,7 +4466,9 @@ async def test_delete_task_async_from_dict(): def test_delete_task_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3827,12 +4488,17 @@ def test_delete_task_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_task_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3852,11 +4518,16 @@ async def test_delete_task_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_task_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_task), "__call__") as call: @@ -3864,7 +4535,9 @@ def test_delete_task_flattened(): call.return_value = None # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_task(name="name_value",) + client.delete_task( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3876,19 +4549,24 @@ def test_delete_task_flattened(): def test_delete_task_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_task( - cloudtasks.DeleteTaskRequest(), name="name_value", + cloudtasks.DeleteTaskRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_task_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_task), "__call__") as call: @@ -3898,7 +4576,9 @@ async def test_delete_task_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_task(name="name_value",) + response = await client.delete_task( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3911,20 +4591,30 @@ async def test_delete_task_flattened_async(): @pytest.mark.asyncio async def test_delete_task_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_task( - cloudtasks.DeleteTaskRequest(), name="name_value", + cloudtasks.DeleteTaskRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [cloudtasks.LeaseTasksRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.LeaseTasksRequest, + dict, + ], +) def test_lease_tasks(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3950,7 +4640,8 @@ def test_lease_tasks_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3966,7 +4657,8 @@ async def test_lease_tasks_async( transport: str = "grpc_asyncio", request_type=cloudtasks.LeaseTasksRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3996,7 +4688,9 @@ async def test_lease_tasks_async_from_dict(): def test_lease_tasks_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4016,12 +4710,17 @@ def test_lease_tasks_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_lease_tasks_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4043,11 +4742,16 @@ async def test_lease_tasks_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_lease_tasks_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.lease_tasks), "__call__") as call: @@ -4056,7 +4760,8 @@ def test_lease_tasks_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.lease_tasks( - parent="parent_value", lease_duration=duration_pb2.Duration(seconds=751), + parent="parent_value", + lease_duration=duration_pb2.Duration(seconds=751), ) # Establish that the underlying call was made with the expected @@ -4072,7 +4777,9 @@ def test_lease_tasks_flattened(): def test_lease_tasks_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4086,7 +4793,9 @@ def test_lease_tasks_flattened_error(): @pytest.mark.asyncio async def test_lease_tasks_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.lease_tasks), "__call__") as call: @@ -4099,7 +4808,8 @@ async def test_lease_tasks_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.lease_tasks( - parent="parent_value", lease_duration=duration_pb2.Duration(seconds=751), + parent="parent_value", + lease_duration=duration_pb2.Duration(seconds=751), ) # Establish that the underlying call was made with the expected @@ -4116,7 +4826,9 @@ async def test_lease_tasks_flattened_async(): @pytest.mark.asyncio async def test_lease_tasks_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4128,10 +4840,17 @@ async def test_lease_tasks_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [cloudtasks.AcknowledgeTaskRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.AcknowledgeTaskRequest, + dict, + ], +) def test_acknowledge_task(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4157,7 +4876,8 @@ def test_acknowledge_task_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4173,7 +4893,8 @@ async def test_acknowledge_task_async( transport: str = "grpc_asyncio", request_type=cloudtasks.AcknowledgeTaskRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4201,7 +4922,9 @@ async def test_acknowledge_task_async_from_dict(): def test_acknowledge_task_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4221,12 +4944,17 @@ def test_acknowledge_task_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_acknowledge_task_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4246,11 +4974,16 @@ async def test_acknowledge_task_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_acknowledge_task_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.acknowledge_task), "__call__") as call: @@ -4259,7 +4992,8 @@ def test_acknowledge_task_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.acknowledge_task( - name="name_value", schedule_time=timestamp_pb2.Timestamp(seconds=751), + name="name_value", + schedule_time=timestamp_pb2.Timestamp(seconds=751), ) # Establish that the underlying call was made with the expected @@ -4275,7 +5009,9 @@ def test_acknowledge_task_flattened(): def test_acknowledge_task_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4289,7 +5025,9 @@ def test_acknowledge_task_flattened_error(): @pytest.mark.asyncio async def test_acknowledge_task_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.acknowledge_task), "__call__") as call: @@ -4300,7 +5038,8 @@ async def test_acknowledge_task_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.acknowledge_task( - name="name_value", schedule_time=timestamp_pb2.Timestamp(seconds=751), + name="name_value", + schedule_time=timestamp_pb2.Timestamp(seconds=751), ) # Establish that the underlying call was made with the expected @@ -4317,7 +5056,9 @@ async def test_acknowledge_task_flattened_async(): @pytest.mark.asyncio async def test_acknowledge_task_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4329,10 +5070,17 @@ async def test_acknowledge_task_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [cloudtasks.RenewLeaseRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.RenewLeaseRequest, + dict, + ], +) def test_renew_lease(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4366,7 +5114,8 @@ def test_renew_lease_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4382,7 +5131,8 @@ async def test_renew_lease_async( transport: str = "grpc_asyncio", request_type=cloudtasks.RenewLeaseRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4393,7 +5143,10 @@ async def test_renew_lease_async( with mock.patch.object(type(client.transport.renew_lease), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - task.Task(name="name_value", view=task.Task.View.BASIC,) + task.Task( + name="name_value", + view=task.Task.View.BASIC, + ) ) response = await client.renew_lease(request) @@ -4414,7 +5167,9 @@ async def test_renew_lease_async_from_dict(): def test_renew_lease_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4434,12 +5189,17 @@ def test_renew_lease_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_renew_lease_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4459,11 +5219,16 @@ async def test_renew_lease_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_renew_lease_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.renew_lease), "__call__") as call: @@ -4493,7 +5258,9 @@ def test_renew_lease_flattened(): def test_renew_lease_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4508,7 +5275,9 @@ def test_renew_lease_flattened_error(): @pytest.mark.asyncio async def test_renew_lease_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.renew_lease), "__call__") as call: @@ -4541,7 +5310,9 @@ async def test_renew_lease_flattened_async(): @pytest.mark.asyncio async def test_renew_lease_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4554,10 +5325,17 @@ async def test_renew_lease_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [cloudtasks.CancelLeaseRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.CancelLeaseRequest, + dict, + ], +) def test_cancel_lease(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4591,7 +5369,8 @@ def test_cancel_lease_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4607,7 +5386,8 @@ async def test_cancel_lease_async( transport: str = "grpc_asyncio", request_type=cloudtasks.CancelLeaseRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4618,7 +5398,10 @@ async def test_cancel_lease_async( with mock.patch.object(type(client.transport.cancel_lease), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - task.Task(name="name_value", view=task.Task.View.BASIC,) + task.Task( + name="name_value", + view=task.Task.View.BASIC, + ) ) response = await client.cancel_lease(request) @@ -4639,7 +5422,9 @@ async def test_cancel_lease_async_from_dict(): def test_cancel_lease_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4659,12 +5444,17 @@ def test_cancel_lease_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_cancel_lease_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4684,11 +5474,16 @@ async def test_cancel_lease_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_cancel_lease_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_lease), "__call__") as call: @@ -4697,7 +5492,8 @@ def test_cancel_lease_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.cancel_lease( - name="name_value", schedule_time=timestamp_pb2.Timestamp(seconds=751), + name="name_value", + schedule_time=timestamp_pb2.Timestamp(seconds=751), ) # Establish that the underlying call was made with the expected @@ -4713,7 +5509,9 @@ def test_cancel_lease_flattened(): def test_cancel_lease_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4727,7 +5525,9 @@ def test_cancel_lease_flattened_error(): @pytest.mark.asyncio async def test_cancel_lease_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_lease), "__call__") as call: @@ -4738,7 +5538,8 @@ async def test_cancel_lease_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.cancel_lease( - name="name_value", schedule_time=timestamp_pb2.Timestamp(seconds=751), + name="name_value", + schedule_time=timestamp_pb2.Timestamp(seconds=751), ) # Establish that the underlying call was made with the expected @@ -4755,7 +5556,9 @@ async def test_cancel_lease_flattened_async(): @pytest.mark.asyncio async def test_cancel_lease_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4767,10 +5570,17 @@ async def test_cancel_lease_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [cloudtasks.RunTaskRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.RunTaskRequest, + dict, + ], +) def test_run_task(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4804,7 +5614,8 @@ def test_run_task_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4820,7 +5631,8 @@ async def test_run_task_async( transport: str = "grpc_asyncio", request_type=cloudtasks.RunTaskRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4831,7 +5643,10 @@ async def test_run_task_async( with mock.patch.object(type(client.transport.run_task), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - task.Task(name="name_value", view=task.Task.View.BASIC,) + task.Task( + name="name_value", + view=task.Task.View.BASIC, + ) ) response = await client.run_task(request) @@ -4852,7 +5667,9 @@ async def test_run_task_async_from_dict(): def test_run_task_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4872,12 +5689,17 @@ def test_run_task_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_run_task_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4897,11 +5719,16 @@ async def test_run_task_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_run_task_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.run_task), "__call__") as call: @@ -4909,7 +5736,9 @@ def test_run_task_flattened(): call.return_value = task.Task() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.run_task(name="name_value",) + client.run_task( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4921,19 +5750,24 @@ def test_run_task_flattened(): def test_run_task_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.run_task( - cloudtasks.RunTaskRequest(), name="name_value", + cloudtasks.RunTaskRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_run_task_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.run_task), "__call__") as call: @@ -4943,7 +5777,9 @@ async def test_run_task_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(task.Task()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.run_task(name="name_value",) + response = await client.run_task( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4956,13 +5792,16 @@ async def test_run_task_flattened_async(): @pytest.mark.asyncio async def test_run_task_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.run_task( - cloudtasks.RunTaskRequest(), name="name_value", + cloudtasks.RunTaskRequest(), + name="name_value", ) @@ -4973,7 +5812,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -4993,7 +5833,10 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = CloudTasksClient(client_options=options, transport=transport,) + client = CloudTasksClient( + client_options=options, + transport=transport, + ) # It is an error to provide an api_key and a credential. options = mock.Mock() @@ -5009,7 +5852,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = CloudTasksClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -5039,7 +5883,10 @@ def test_transport_get_channel(): @pytest.mark.parametrize( "transport_class", - [transports.CloudTasksGrpcTransport, transports.CloudTasksGrpcAsyncIOTransport,], + [ + transports.CloudTasksGrpcTransport, + transports.CloudTasksGrpcAsyncIOTransport, + ], ) def test_transport_adc(transport_class): # Test default credentials are used if not provided. @@ -5051,8 +5898,13 @@ def test_transport_adc(transport_class): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) - assert isinstance(client.transport, transports.CloudTasksGrpcTransport,) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.CloudTasksGrpcTransport, + ) def test_cloud_tasks_base_transport_error(): @@ -5116,7 +5968,8 @@ def test_cloud_tasks_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.CloudTasksTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -5151,7 +6004,10 @@ def test_cloud_tasks_auth_adc(): @pytest.mark.parametrize( "transport_class", - [transports.CloudTasksGrpcTransport, transports.CloudTasksGrpcAsyncIOTransport,], + [ + transports.CloudTasksGrpcTransport, + transports.CloudTasksGrpcAsyncIOTransport, + ], ) def test_cloud_tasks_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use @@ -5268,7 +6124,8 @@ def test_cloud_tasks_grpc_transport_channel(): # Check that channel is used if provided. transport = transports.CloudTasksGrpcTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -5280,7 +6137,8 @@ def test_cloud_tasks_grpc_asyncio_transport_channel(): # Check that channel is used if provided. transport = transports.CloudTasksGrpcAsyncIOTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -5384,7 +6242,9 @@ def test_queue_path(): location = "clam" queue = "whelk" expected = "projects/{project}/locations/{location}/queues/{queue}".format( - project=project, location=location, queue=queue, + project=project, + location=location, + queue=queue, ) actual = CloudTasksClient.queue_path(project, location, queue) assert expected == actual @@ -5408,8 +6268,13 @@ def test_task_path(): location = "mussel" queue = "winkle" task = "nautilus" - expected = "projects/{project}/locations/{location}/queues/{queue}/tasks/{task}".format( - project=project, location=location, queue=queue, task=task, + expected = ( + "projects/{project}/locations/{location}/queues/{queue}/tasks/{task}".format( + project=project, + location=location, + queue=queue, + task=task, + ) ) actual = CloudTasksClient.task_path(project, location, queue, task) assert expected == actual @@ -5451,7 +6316,9 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): folder = "oyster" - expected = "folders/{folder}".format(folder=folder,) + expected = "folders/{folder}".format( + folder=folder, + ) actual = CloudTasksClient.common_folder_path(folder) assert expected == actual @@ -5469,7 +6336,9 @@ def test_parse_common_folder_path(): def test_common_organization_path(): organization = "cuttlefish" - expected = "organizations/{organization}".format(organization=organization,) + expected = "organizations/{organization}".format( + organization=organization, + ) actual = CloudTasksClient.common_organization_path(organization) assert expected == actual @@ -5487,7 +6356,9 @@ def test_parse_common_organization_path(): def test_common_project_path(): project = "winkle" - expected = "projects/{project}".format(project=project,) + expected = "projects/{project}".format( + project=project, + ) actual = CloudTasksClient.common_project_path(project) assert expected == actual @@ -5507,7 +6378,8 @@ def test_common_location_path(): project = "scallop" location = "abalone" expected = "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) actual = CloudTasksClient.common_location_path(project, location) assert expected == actual @@ -5532,7 +6404,8 @@ def test_client_with_default_client_info(): transports.CloudTasksTransport, "_prep_wrapped_messages" ) as prep: client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -5541,7 +6414,8 @@ def test_client_with_default_client_info(): ) as prep: transport_class = CloudTasksClient.get_transport_class() transport = transport_class( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -5549,7 +6423,8 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) with mock.patch.object( type(getattr(client.transport, "grpc_channel")), "close" diff --git a/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py b/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py index a2e9893f..27bf6b59 100644 --- a/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py +++ b/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py @@ -95,7 +95,13 @@ def test__get_default_mtls_endpoint(): assert CloudTasksClient._get_default_mtls_endpoint(non_googleapi) == non_googleapi -@pytest.mark.parametrize("client_class", [CloudTasksClient, CloudTasksAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + CloudTasksClient, + CloudTasksAsyncClient, + ], +) def test_cloud_tasks_client_from_service_account_info(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -135,7 +141,13 @@ def test_cloud_tasks_client_service_account_always_use_jwt( use_jwt.assert_not_called() -@pytest.mark.parametrize("client_class", [CloudTasksClient, CloudTasksAsyncClient,]) +@pytest.mark.parametrize( + "client_class", + [ + CloudTasksClient, + CloudTasksAsyncClient, + ], +) def test_cloud_tasks_client_from_service_account_file(client_class): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( @@ -490,7 +502,9 @@ def test_cloud_tasks_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. - options = client_options.ClientOptions(scopes=["1", "2"],) + options = client_options.ClientOptions( + scopes=["1", "2"], + ) with mock.patch.object(transport_class, "__init__") as patched: patched.return_value = None client = client_class(client_options=options, transport=transport_name) @@ -618,10 +632,17 @@ def test_cloud_tasks_client_create_channel_credentials_file( ) -@pytest.mark.parametrize("request_type", [cloudtasks.ListQueuesRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.ListQueuesRequest, + dict, + ], +) def test_list_queues(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -650,7 +671,8 @@ def test_list_queues_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -666,7 +688,8 @@ async def test_list_queues_async( transport: str = "grpc_asyncio", request_type=cloudtasks.ListQueuesRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -677,7 +700,9 @@ async def test_list_queues_async( with mock.patch.object(type(client.transport.list_queues), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - cloudtasks.ListQueuesResponse(next_page_token="next_page_token_value",) + cloudtasks.ListQueuesResponse( + next_page_token="next_page_token_value", + ) ) response = await client.list_queues(request) @@ -697,7 +722,9 @@ async def test_list_queues_async_from_dict(): def test_list_queues_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -717,12 +744,17 @@ def test_list_queues_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_queues_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -744,11 +776,16 @@ async def test_list_queues_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_queues_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_queues), "__call__") as call: @@ -756,7 +793,9 @@ def test_list_queues_flattened(): call.return_value = cloudtasks.ListQueuesResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_queues(parent="parent_value",) + client.list_queues( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -768,19 +807,24 @@ def test_list_queues_flattened(): def test_list_queues_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_queues( - cloudtasks.ListQueuesRequest(), parent="parent_value", + cloudtasks.ListQueuesRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_queues_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_queues), "__call__") as call: @@ -792,7 +836,9 @@ async def test_list_queues_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_queues(parent="parent_value",) + response = await client.list_queues( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -805,19 +851,23 @@ async def test_list_queues_flattened_async(): @pytest.mark.asyncio async def test_list_queues_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_queues( - cloudtasks.ListQueuesRequest(), parent="parent_value", + cloudtasks.ListQueuesRequest(), + parent="parent_value", ) def test_list_queues_pager(transport_name: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -825,14 +875,29 @@ def test_list_queues_pager(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListQueuesResponse( - queues=[queue.Queue(), queue.Queue(), queue.Queue(),], + queues=[ + queue.Queue(), + queue.Queue(), + queue.Queue(), + ], next_page_token="abc", ), - cloudtasks.ListQueuesResponse(queues=[], next_page_token="def",), cloudtasks.ListQueuesResponse( - queues=[queue.Queue(),], next_page_token="ghi", + queues=[], + next_page_token="def", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + ], + next_page_token="ghi", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + queue.Queue(), + ], ), - cloudtasks.ListQueuesResponse(queues=[queue.Queue(), queue.Queue(),],), RuntimeError, ) @@ -851,7 +916,8 @@ def test_list_queues_pager(transport_name: str = "grpc"): def test_list_queues_pages(transport_name: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -859,14 +925,29 @@ def test_list_queues_pages(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListQueuesResponse( - queues=[queue.Queue(), queue.Queue(), queue.Queue(),], + queues=[ + queue.Queue(), + queue.Queue(), + queue.Queue(), + ], next_page_token="abc", ), - cloudtasks.ListQueuesResponse(queues=[], next_page_token="def",), cloudtasks.ListQueuesResponse( - queues=[queue.Queue(),], next_page_token="ghi", + queues=[], + next_page_token="def", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + ], + next_page_token="ghi", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + queue.Queue(), + ], ), - cloudtasks.ListQueuesResponse(queues=[queue.Queue(), queue.Queue(),],), RuntimeError, ) pages = list(client.list_queues(request={}).pages) @@ -876,7 +957,9 @@ def test_list_queues_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_queues_async_pager(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -885,17 +968,34 @@ async def test_list_queues_async_pager(): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListQueuesResponse( - queues=[queue.Queue(), queue.Queue(), queue.Queue(),], + queues=[ + queue.Queue(), + queue.Queue(), + queue.Queue(), + ], next_page_token="abc", ), - cloudtasks.ListQueuesResponse(queues=[], next_page_token="def",), cloudtasks.ListQueuesResponse( - queues=[queue.Queue(),], next_page_token="ghi", + queues=[], + next_page_token="def", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + ], + next_page_token="ghi", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + queue.Queue(), + ], ), - cloudtasks.ListQueuesResponse(queues=[queue.Queue(), queue.Queue(),],), RuntimeError, ) - async_pager = await client.list_queues(request={},) + async_pager = await client.list_queues( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -907,7 +1007,9 @@ async def test_list_queues_async_pager(): @pytest.mark.asyncio async def test_list_queues_async_pages(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -916,14 +1018,29 @@ async def test_list_queues_async_pages(): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListQueuesResponse( - queues=[queue.Queue(), queue.Queue(), queue.Queue(),], + queues=[ + queue.Queue(), + queue.Queue(), + queue.Queue(), + ], next_page_token="abc", ), - cloudtasks.ListQueuesResponse(queues=[], next_page_token="def",), cloudtasks.ListQueuesResponse( - queues=[queue.Queue(),], next_page_token="ghi", + queues=[], + next_page_token="def", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + ], + next_page_token="ghi", + ), + cloudtasks.ListQueuesResponse( + queues=[ + queue.Queue(), + queue.Queue(), + ], ), - cloudtasks.ListQueuesResponse(queues=[queue.Queue(), queue.Queue(),],), RuntimeError, ) pages = [] @@ -933,10 +1050,17 @@ async def test_list_queues_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [cloudtasks.GetQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.GetQueueRequest, + dict, + ], +) def test_get_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -974,7 +1098,8 @@ def test_get_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -990,7 +1115,8 @@ async def test_get_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.GetQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1027,7 +1153,9 @@ async def test_get_queue_async_from_dict(): def test_get_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1047,12 +1175,17 @@ def test_get_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1072,11 +1205,16 @@ async def test_get_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_queue), "__call__") as call: @@ -1084,7 +1222,9 @@ def test_get_queue_flattened(): call.return_value = queue.Queue() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_queue(name="name_value",) + client.get_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1096,19 +1236,24 @@ def test_get_queue_flattened(): def test_get_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_queue( - cloudtasks.GetQueueRequest(), name="name_value", + cloudtasks.GetQueueRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_queue), "__call__") as call: @@ -1118,7 +1263,9 @@ async def test_get_queue_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(queue.Queue()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_queue(name="name_value",) + response = await client.get_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1131,20 +1278,30 @@ async def test_get_queue_flattened_async(): @pytest.mark.asyncio async def test_get_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_queue( - cloudtasks.GetQueueRequest(), name="name_value", + cloudtasks.GetQueueRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [cloudtasks.CreateQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.CreateQueueRequest, + dict, + ], +) def test_create_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1182,7 +1339,8 @@ def test_create_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1198,7 +1356,8 @@ async def test_create_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.CreateQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1235,7 +1394,9 @@ async def test_create_queue_async_from_dict(): def test_create_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1255,12 +1416,17 @@ def test_create_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1280,11 +1446,16 @@ async def test_create_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_queue), "__call__") as call: @@ -1293,7 +1464,8 @@ def test_create_queue_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.create_queue( - parent="parent_value", queue=gct_queue.Queue(name="name_value"), + parent="parent_value", + queue=gct_queue.Queue(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -1309,7 +1481,9 @@ def test_create_queue_flattened(): def test_create_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1323,7 +1497,9 @@ def test_create_queue_flattened_error(): @pytest.mark.asyncio async def test_create_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_queue), "__call__") as call: @@ -1334,7 +1510,8 @@ async def test_create_queue_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.create_queue( - parent="parent_value", queue=gct_queue.Queue(name="name_value"), + parent="parent_value", + queue=gct_queue.Queue(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -1351,7 +1528,9 @@ async def test_create_queue_flattened_async(): @pytest.mark.asyncio async def test_create_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1363,10 +1542,17 @@ async def test_create_queue_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [cloudtasks.UpdateQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.UpdateQueueRequest, + dict, + ], +) def test_update_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1404,7 +1590,8 @@ def test_update_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1420,7 +1607,8 @@ async def test_update_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.UpdateQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1457,7 +1645,9 @@ async def test_update_queue_async_from_dict(): def test_update_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1477,12 +1667,17 @@ def test_update_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "queue.name=queue.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "queue.name=queue.name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_update_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1502,11 +1697,16 @@ async def test_update_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "queue.name=queue.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "queue.name=queue.name/value", + ) in kw["metadata"] def test_update_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_queue), "__call__") as call: @@ -1532,7 +1732,9 @@ def test_update_queue_flattened(): def test_update_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1546,7 +1748,9 @@ def test_update_queue_flattened_error(): @pytest.mark.asyncio async def test_update_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_queue), "__call__") as call: @@ -1575,7 +1779,9 @@ async def test_update_queue_flattened_async(): @pytest.mark.asyncio async def test_update_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1587,10 +1793,17 @@ async def test_update_queue_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [cloudtasks.DeleteQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.DeleteQueueRequest, + dict, + ], +) def test_delete_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1616,7 +1829,8 @@ def test_delete_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1632,7 +1846,8 @@ async def test_delete_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.DeleteQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1660,7 +1875,9 @@ async def test_delete_queue_async_from_dict(): def test_delete_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1680,12 +1897,17 @@ def test_delete_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1705,11 +1927,16 @@ async def test_delete_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_queue), "__call__") as call: @@ -1717,7 +1944,9 @@ def test_delete_queue_flattened(): call.return_value = None # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_queue(name="name_value",) + client.delete_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1729,19 +1958,24 @@ def test_delete_queue_flattened(): def test_delete_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_queue( - cloudtasks.DeleteQueueRequest(), name="name_value", + cloudtasks.DeleteQueueRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_queue), "__call__") as call: @@ -1751,7 +1985,9 @@ async def test_delete_queue_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_queue(name="name_value",) + response = await client.delete_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1764,20 +2000,30 @@ async def test_delete_queue_flattened_async(): @pytest.mark.asyncio async def test_delete_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_queue( - cloudtasks.DeleteQueueRequest(), name="name_value", + cloudtasks.DeleteQueueRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [cloudtasks.PurgeQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.PurgeQueueRequest, + dict, + ], +) def test_purge_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1815,7 +2061,8 @@ def test_purge_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1831,7 +2078,8 @@ async def test_purge_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.PurgeQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1868,7 +2116,9 @@ async def test_purge_queue_async_from_dict(): def test_purge_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1888,12 +2138,17 @@ def test_purge_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_purge_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -1913,11 +2168,16 @@ async def test_purge_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_purge_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_queue), "__call__") as call: @@ -1925,7 +2185,9 @@ def test_purge_queue_flattened(): call.return_value = queue.Queue() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.purge_queue(name="name_value",) + client.purge_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1937,19 +2199,24 @@ def test_purge_queue_flattened(): def test_purge_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.purge_queue( - cloudtasks.PurgeQueueRequest(), name="name_value", + cloudtasks.PurgeQueueRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_purge_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_queue), "__call__") as call: @@ -1959,7 +2226,9 @@ async def test_purge_queue_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(queue.Queue()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.purge_queue(name="name_value",) + response = await client.purge_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1972,20 +2241,30 @@ async def test_purge_queue_flattened_async(): @pytest.mark.asyncio async def test_purge_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.purge_queue( - cloudtasks.PurgeQueueRequest(), name="name_value", + cloudtasks.PurgeQueueRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [cloudtasks.PauseQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.PauseQueueRequest, + dict, + ], +) def test_pause_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2023,7 +2302,8 @@ def test_pause_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2039,7 +2319,8 @@ async def test_pause_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.PauseQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2076,7 +2357,9 @@ async def test_pause_queue_async_from_dict(): def test_pause_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2096,12 +2379,17 @@ def test_pause_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_pause_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2121,11 +2409,16 @@ async def test_pause_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_pause_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.pause_queue), "__call__") as call: @@ -2133,7 +2426,9 @@ def test_pause_queue_flattened(): call.return_value = queue.Queue() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.pause_queue(name="name_value",) + client.pause_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2145,19 +2440,24 @@ def test_pause_queue_flattened(): def test_pause_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.pause_queue( - cloudtasks.PauseQueueRequest(), name="name_value", + cloudtasks.PauseQueueRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_pause_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.pause_queue), "__call__") as call: @@ -2167,7 +2467,9 @@ async def test_pause_queue_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(queue.Queue()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.pause_queue(name="name_value",) + response = await client.pause_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2180,20 +2482,30 @@ async def test_pause_queue_flattened_async(): @pytest.mark.asyncio async def test_pause_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.pause_queue( - cloudtasks.PauseQueueRequest(), name="name_value", + cloudtasks.PauseQueueRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [cloudtasks.ResumeQueueRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.ResumeQueueRequest, + dict, + ], +) def test_resume_queue(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2231,7 +2543,8 @@ def test_resume_queue_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2247,7 +2560,8 @@ async def test_resume_queue_async( transport: str = "grpc_asyncio", request_type=cloudtasks.ResumeQueueRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2284,7 +2598,9 @@ async def test_resume_queue_async_from_dict(): def test_resume_queue_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2304,12 +2620,17 @@ def test_resume_queue_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_resume_queue_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2329,11 +2650,16 @@ async def test_resume_queue_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_resume_queue_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.resume_queue), "__call__") as call: @@ -2341,7 +2667,9 @@ def test_resume_queue_flattened(): call.return_value = queue.Queue() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.resume_queue(name="name_value",) + client.resume_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2353,19 +2681,24 @@ def test_resume_queue_flattened(): def test_resume_queue_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.resume_queue( - cloudtasks.ResumeQueueRequest(), name="name_value", + cloudtasks.ResumeQueueRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_resume_queue_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.resume_queue), "__call__") as call: @@ -2375,7 +2708,9 @@ async def test_resume_queue_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(queue.Queue()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.resume_queue(name="name_value",) + response = await client.resume_queue( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2388,20 +2723,30 @@ async def test_resume_queue_flattened_async(): @pytest.mark.asyncio async def test_resume_queue_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.resume_queue( - cloudtasks.ResumeQueueRequest(), name="name_value", + cloudtasks.ResumeQueueRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [iam_policy_pb2.GetIamPolicyRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + iam_policy_pb2.GetIamPolicyRequest, + dict, + ], +) def test_get_iam_policy(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2411,7 +2756,10 @@ def test_get_iam_policy(request_type, transport: str = "grpc"): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. - call.return_value = policy_pb2.Policy(version=774, etag=b"etag_blob",) + call.return_value = policy_pb2.Policy( + version=774, + etag=b"etag_blob", + ) response = client.get_iam_policy(request) # Establish that the underlying gRPC stub method was called. @@ -2429,7 +2777,8 @@ def test_get_iam_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2445,7 +2794,8 @@ async def test_get_iam_policy_async( transport: str = "grpc_asyncio", request_type=iam_policy_pb2.GetIamPolicyRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2456,7 +2806,10 @@ async def test_get_iam_policy_async( with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - policy_pb2.Policy(version=774, etag=b"etag_blob",) + policy_pb2.Policy( + version=774, + etag=b"etag_blob", + ) ) response = await client.get_iam_policy(request) @@ -2477,7 +2830,9 @@ async def test_get_iam_policy_async_from_dict(): def test_get_iam_policy_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2497,12 +2852,17 @@ def test_get_iam_policy_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_iam_policy_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2522,11 +2882,16 @@ async def test_get_iam_policy_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] def test_get_iam_policy_from_dict_foreign(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. @@ -2541,7 +2906,9 @@ def test_get_iam_policy_from_dict_foreign(): def test_get_iam_policy_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -2549,7 +2916,9 @@ def test_get_iam_policy_flattened(): call.return_value = policy_pb2.Policy() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_iam_policy(resource="resource_value",) + client.get_iam_policy( + resource="resource_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2561,19 +2930,24 @@ def test_get_iam_policy_flattened(): def test_get_iam_policy_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_iam_policy( - iam_policy_pb2.GetIamPolicyRequest(), resource="resource_value", + iam_policy_pb2.GetIamPolicyRequest(), + resource="resource_value", ) @pytest.mark.asyncio async def test_get_iam_policy_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -2583,7 +2957,9 @@ async def test_get_iam_policy_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy_pb2.Policy()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_iam_policy(resource="resource_value",) + response = await client.get_iam_policy( + resource="resource_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2596,20 +2972,30 @@ async def test_get_iam_policy_flattened_async(): @pytest.mark.asyncio async def test_get_iam_policy_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_iam_policy( - iam_policy_pb2.GetIamPolicyRequest(), resource="resource_value", + iam_policy_pb2.GetIamPolicyRequest(), + resource="resource_value", ) -@pytest.mark.parametrize("request_type", [iam_policy_pb2.SetIamPolicyRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + iam_policy_pb2.SetIamPolicyRequest, + dict, + ], +) def test_set_iam_policy(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2619,7 +3005,10 @@ def test_set_iam_policy(request_type, transport: str = "grpc"): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. - call.return_value = policy_pb2.Policy(version=774, etag=b"etag_blob",) + call.return_value = policy_pb2.Policy( + version=774, + etag=b"etag_blob", + ) response = client.set_iam_policy(request) # Establish that the underlying gRPC stub method was called. @@ -2637,7 +3026,8 @@ def test_set_iam_policy_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2653,7 +3043,8 @@ async def test_set_iam_policy_async( transport: str = "grpc_asyncio", request_type=iam_policy_pb2.SetIamPolicyRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2664,7 +3055,10 @@ async def test_set_iam_policy_async( with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - policy_pb2.Policy(version=774, etag=b"etag_blob",) + policy_pb2.Policy( + version=774, + etag=b"etag_blob", + ) ) response = await client.set_iam_policy(request) @@ -2685,7 +3079,9 @@ async def test_set_iam_policy_async_from_dict(): def test_set_iam_policy_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2705,12 +3101,17 @@ def test_set_iam_policy_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_set_iam_policy_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2730,11 +3131,16 @@ async def test_set_iam_policy_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] def test_set_iam_policy_from_dict_foreign(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: # Designate an appropriate return value for the call. @@ -2749,7 +3155,9 @@ def test_set_iam_policy_from_dict_foreign(): def test_set_iam_policy_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -2757,7 +3165,9 @@ def test_set_iam_policy_flattened(): call.return_value = policy_pb2.Policy() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.set_iam_policy(resource="resource_value",) + client.set_iam_policy( + resource="resource_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2769,19 +3179,24 @@ def test_set_iam_policy_flattened(): def test_set_iam_policy_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.set_iam_policy( - iam_policy_pb2.SetIamPolicyRequest(), resource="resource_value", + iam_policy_pb2.SetIamPolicyRequest(), + resource="resource_value", ) @pytest.mark.asyncio async def test_set_iam_policy_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -2791,7 +3206,9 @@ async def test_set_iam_policy_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(policy_pb2.Policy()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.set_iam_policy(resource="resource_value",) + response = await client.set_iam_policy( + resource="resource_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2804,22 +3221,30 @@ async def test_set_iam_policy_flattened_async(): @pytest.mark.asyncio async def test_set_iam_policy_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.set_iam_policy( - iam_policy_pb2.SetIamPolicyRequest(), resource="resource_value", + iam_policy_pb2.SetIamPolicyRequest(), + resource="resource_value", ) @pytest.mark.parametrize( - "request_type", [iam_policy_pb2.TestIamPermissionsRequest, dict,] + "request_type", + [ + iam_policy_pb2.TestIamPermissionsRequest, + dict, + ], ) def test_test_iam_permissions(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2850,7 +3275,8 @@ def test_test_iam_permissions_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2869,7 +3295,8 @@ async def test_test_iam_permissions_async( request_type=iam_policy_pb2.TestIamPermissionsRequest, ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2904,7 +3331,9 @@ async def test_test_iam_permissions_async_from_dict(): def test_test_iam_permissions_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2926,12 +3355,17 @@ def test_test_iam_permissions_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_test_iam_permissions_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -2955,11 +3389,16 @@ async def test_test_iam_permissions_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "resource=resource/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "resource=resource/value", + ) in kw["metadata"] def test_test_iam_permissions_from_dict_foreign(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( type(client.transport.test_iam_permissions), "__call__" @@ -2976,7 +3415,9 @@ def test_test_iam_permissions_from_dict_foreign(): def test_test_iam_permissions_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -2987,7 +3428,8 @@ def test_test_iam_permissions_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.test_iam_permissions( - resource="resource_value", permissions=["permissions_value"], + resource="resource_value", + permissions=["permissions_value"], ) # Establish that the underlying call was made with the expected @@ -3003,7 +3445,9 @@ def test_test_iam_permissions_flattened(): def test_test_iam_permissions_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3017,7 +3461,9 @@ def test_test_iam_permissions_flattened_error(): @pytest.mark.asyncio async def test_test_iam_permissions_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3032,7 +3478,8 @@ async def test_test_iam_permissions_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.test_iam_permissions( - resource="resource_value", permissions=["permissions_value"], + resource="resource_value", + permissions=["permissions_value"], ) # Establish that the underlying call was made with the expected @@ -3049,7 +3496,9 @@ async def test_test_iam_permissions_flattened_async(): @pytest.mark.asyncio async def test_test_iam_permissions_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3061,10 +3510,17 @@ async def test_test_iam_permissions_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [cloudtasks.ListTasksRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.ListTasksRequest, + dict, + ], +) def test_list_tasks(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3093,7 +3549,8 @@ def test_list_tasks_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3109,7 +3566,8 @@ async def test_list_tasks_async( transport: str = "grpc_asyncio", request_type=cloudtasks.ListTasksRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3120,7 +3578,9 @@ async def test_list_tasks_async( with mock.patch.object(type(client.transport.list_tasks), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - cloudtasks.ListTasksResponse(next_page_token="next_page_token_value",) + cloudtasks.ListTasksResponse( + next_page_token="next_page_token_value", + ) ) response = await client.list_tasks(request) @@ -3140,7 +3600,9 @@ async def test_list_tasks_async_from_dict(): def test_list_tasks_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3160,12 +3622,17 @@ def test_list_tasks_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_list_tasks_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3187,11 +3654,16 @@ async def test_list_tasks_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_list_tasks_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_tasks), "__call__") as call: @@ -3199,7 +3671,9 @@ def test_list_tasks_flattened(): call.return_value = cloudtasks.ListTasksResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_tasks(parent="parent_value",) + client.list_tasks( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3211,19 +3685,24 @@ def test_list_tasks_flattened(): def test_list_tasks_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.list_tasks( - cloudtasks.ListTasksRequest(), parent="parent_value", + cloudtasks.ListTasksRequest(), + parent="parent_value", ) @pytest.mark.asyncio async def test_list_tasks_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_tasks), "__call__") as call: @@ -3235,7 +3714,9 @@ async def test_list_tasks_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_tasks(parent="parent_value",) + response = await client.list_tasks( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3248,19 +3729,23 @@ async def test_list_tasks_flattened_async(): @pytest.mark.asyncio async def test_list_tasks_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.list_tasks( - cloudtasks.ListTasksRequest(), parent="parent_value", + cloudtasks.ListTasksRequest(), + parent="parent_value", ) def test_list_tasks_pager(transport_name: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3268,11 +3753,29 @@ def test_list_tasks_pager(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListTasksResponse( - tasks=[task.Task(), task.Task(), task.Task(),], next_page_token="abc", + tasks=[ + task.Task(), + task.Task(), + task.Task(), + ], + next_page_token="abc", + ), + cloudtasks.ListTasksResponse( + tasks=[], + next_page_token="def", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + ], + next_page_token="ghi", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + task.Task(), + ], ), - cloudtasks.ListTasksResponse(tasks=[], next_page_token="def",), - cloudtasks.ListTasksResponse(tasks=[task.Task(),], next_page_token="ghi",), - cloudtasks.ListTasksResponse(tasks=[task.Task(), task.Task(),],), RuntimeError, ) @@ -3291,7 +3794,8 @@ def test_list_tasks_pager(transport_name: str = "grpc"): def test_list_tasks_pages(transport_name: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials, transport=transport_name, + credentials=ga_credentials.AnonymousCredentials, + transport=transport_name, ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3299,11 +3803,29 @@ def test_list_tasks_pages(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListTasksResponse( - tasks=[task.Task(), task.Task(), task.Task(),], next_page_token="abc", + tasks=[ + task.Task(), + task.Task(), + task.Task(), + ], + next_page_token="abc", + ), + cloudtasks.ListTasksResponse( + tasks=[], + next_page_token="def", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + ], + next_page_token="ghi", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + task.Task(), + ], ), - cloudtasks.ListTasksResponse(tasks=[], next_page_token="def",), - cloudtasks.ListTasksResponse(tasks=[task.Task(),], next_page_token="ghi",), - cloudtasks.ListTasksResponse(tasks=[task.Task(), task.Task(),],), RuntimeError, ) pages = list(client.list_tasks(request={}).pages) @@ -3313,7 +3835,9 @@ def test_list_tasks_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_tasks_async_pager(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3322,14 +3846,34 @@ async def test_list_tasks_async_pager(): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListTasksResponse( - tasks=[task.Task(), task.Task(), task.Task(),], next_page_token="abc", + tasks=[ + task.Task(), + task.Task(), + task.Task(), + ], + next_page_token="abc", + ), + cloudtasks.ListTasksResponse( + tasks=[], + next_page_token="def", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + ], + next_page_token="ghi", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + task.Task(), + ], ), - cloudtasks.ListTasksResponse(tasks=[], next_page_token="def",), - cloudtasks.ListTasksResponse(tasks=[task.Task(),], next_page_token="ghi",), - cloudtasks.ListTasksResponse(tasks=[task.Task(), task.Task(),],), RuntimeError, ) - async_pager = await client.list_tasks(request={},) + async_pager = await client.list_tasks( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -3341,7 +3885,9 @@ async def test_list_tasks_async_pager(): @pytest.mark.asyncio async def test_list_tasks_async_pages(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3350,11 +3896,29 @@ async def test_list_tasks_async_pages(): # Set the response to a series of pages. call.side_effect = ( cloudtasks.ListTasksResponse( - tasks=[task.Task(), task.Task(), task.Task(),], next_page_token="abc", + tasks=[ + task.Task(), + task.Task(), + task.Task(), + ], + next_page_token="abc", + ), + cloudtasks.ListTasksResponse( + tasks=[], + next_page_token="def", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + ], + next_page_token="ghi", + ), + cloudtasks.ListTasksResponse( + tasks=[ + task.Task(), + task.Task(), + ], ), - cloudtasks.ListTasksResponse(tasks=[], next_page_token="def",), - cloudtasks.ListTasksResponse(tasks=[task.Task(),], next_page_token="ghi",), - cloudtasks.ListTasksResponse(tasks=[task.Task(), task.Task(),],), RuntimeError, ) pages = [] @@ -3364,10 +3928,17 @@ async def test_list_tasks_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [cloudtasks.GetTaskRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.GetTaskRequest, + dict, + ], +) def test_get_task(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3405,7 +3976,8 @@ def test_get_task_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3421,7 +3993,8 @@ async def test_get_task_async( transport: str = "grpc_asyncio", request_type=cloudtasks.GetTaskRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3460,7 +4033,9 @@ async def test_get_task_async_from_dict(): def test_get_task_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3480,12 +4055,17 @@ def test_get_task_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_get_task_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3505,11 +4085,16 @@ async def test_get_task_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_get_task_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_task), "__call__") as call: @@ -3517,7 +4102,9 @@ def test_get_task_flattened(): call.return_value = task.Task() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_task(name="name_value",) + client.get_task( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3529,19 +4116,24 @@ def test_get_task_flattened(): def test_get_task_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.get_task( - cloudtasks.GetTaskRequest(), name="name_value", + cloudtasks.GetTaskRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_get_task_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_task), "__call__") as call: @@ -3551,7 +4143,9 @@ async def test_get_task_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(task.Task()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_task(name="name_value",) + response = await client.get_task( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3564,20 +4158,30 @@ async def test_get_task_flattened_async(): @pytest.mark.asyncio async def test_get_task_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.get_task( - cloudtasks.GetTaskRequest(), name="name_value", + cloudtasks.GetTaskRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [cloudtasks.CreateTaskRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.CreateTaskRequest, + dict, + ], +) def test_create_task(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3615,7 +4219,8 @@ def test_create_task_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3631,7 +4236,8 @@ async def test_create_task_async( transport: str = "grpc_asyncio", request_type=cloudtasks.CreateTaskRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3670,7 +4276,9 @@ async def test_create_task_async_from_dict(): def test_create_task_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3690,12 +4298,17 @@ def test_create_task_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_create_task_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3715,11 +4328,16 @@ async def test_create_task_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "parent=parent/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "parent=parent/value", + ) in kw["metadata"] def test_create_task_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_task), "__call__") as call: @@ -3728,7 +4346,8 @@ def test_create_task_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.create_task( - parent="parent_value", task=gct_task.Task(name="name_value"), + parent="parent_value", + task=gct_task.Task(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -3744,7 +4363,9 @@ def test_create_task_flattened(): def test_create_task_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3758,7 +4379,9 @@ def test_create_task_flattened_error(): @pytest.mark.asyncio async def test_create_task_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_task), "__call__") as call: @@ -3769,7 +4392,8 @@ async def test_create_task_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.create_task( - parent="parent_value", task=gct_task.Task(name="name_value"), + parent="parent_value", + task=gct_task.Task(name="name_value"), ) # Establish that the underlying call was made with the expected @@ -3786,7 +4410,9 @@ async def test_create_task_flattened_async(): @pytest.mark.asyncio async def test_create_task_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3798,10 +4424,17 @@ async def test_create_task_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [cloudtasks.DeleteTaskRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.DeleteTaskRequest, + dict, + ], +) def test_delete_task(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3827,7 +4460,8 @@ def test_delete_task_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3843,7 +4477,8 @@ async def test_delete_task_async( transport: str = "grpc_asyncio", request_type=cloudtasks.DeleteTaskRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3871,7 +4506,9 @@ async def test_delete_task_async_from_dict(): def test_delete_task_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3891,12 +4528,17 @@ def test_delete_task_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_delete_task_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -3916,11 +4558,16 @@ async def test_delete_task_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_delete_task_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_task), "__call__") as call: @@ -3928,7 +4575,9 @@ def test_delete_task_flattened(): call.return_value = None # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_task(name="name_value",) + client.delete_task( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3940,19 +4589,24 @@ def test_delete_task_flattened(): def test_delete_task_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.delete_task( - cloudtasks.DeleteTaskRequest(), name="name_value", + cloudtasks.DeleteTaskRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_delete_task_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_task), "__call__") as call: @@ -3962,7 +4616,9 @@ async def test_delete_task_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_task(name="name_value",) + response = await client.delete_task( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3975,20 +4631,30 @@ async def test_delete_task_flattened_async(): @pytest.mark.asyncio async def test_delete_task_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.delete_task( - cloudtasks.DeleteTaskRequest(), name="name_value", + cloudtasks.DeleteTaskRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [cloudtasks.RunTaskRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + cloudtasks.RunTaskRequest, + dict, + ], +) def test_run_task(request_type, transport: str = "grpc"): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4026,7 +4692,8 @@ def test_run_task_empty_call(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4042,7 +4709,8 @@ async def test_run_task_async( transport: str = "grpc_asyncio", request_type=cloudtasks.RunTaskRequest ): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4081,7 +4749,9 @@ async def test_run_task_async_from_dict(): def test_run_task_field_headers(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4101,12 +4771,17 @@ def test_run_task_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] @pytest.mark.asyncio async def test_run_task_field_headers_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Any value that is part of the HTTP/1.1 URI should be sent as # a field header. Set these to a non-empty value. @@ -4126,11 +4801,16 @@ async def test_run_task_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "name=name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "name=name/value", + ) in kw["metadata"] def test_run_task_flattened(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.run_task), "__call__") as call: @@ -4138,7 +4818,9 @@ def test_run_task_flattened(): call.return_value = task.Task() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.run_task(name="name_value",) + client.run_task( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4150,19 +4832,24 @@ def test_run_task_flattened(): def test_run_task_flattened_error(): - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): client.run_task( - cloudtasks.RunTaskRequest(), name="name_value", + cloudtasks.RunTaskRequest(), + name="name_value", ) @pytest.mark.asyncio async def test_run_task_flattened_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.run_task), "__call__") as call: @@ -4172,7 +4859,9 @@ async def test_run_task_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(task.Task()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.run_task(name="name_value",) + response = await client.run_task( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -4185,13 +4874,16 @@ async def test_run_task_flattened_async(): @pytest.mark.asyncio async def test_run_task_flattened_error_async(): - client = CloudTasksAsyncClient(credentials=ga_credentials.AnonymousCredentials(),) + client = CloudTasksAsyncClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): await client.run_task( - cloudtasks.RunTaskRequest(), name="name_value", + cloudtasks.RunTaskRequest(), + name="name_value", ) @@ -4202,7 +4894,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # It is an error to provide a credentials file and a transport instance. @@ -4222,7 +4915,10 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = CloudTasksClient(client_options=options, transport=transport,) + client = CloudTasksClient( + client_options=options, + transport=transport, + ) # It is an error to provide an api_key and a credential. options = mock.Mock() @@ -4238,7 +4934,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = CloudTasksClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -4268,7 +4965,10 @@ def test_transport_get_channel(): @pytest.mark.parametrize( "transport_class", - [transports.CloudTasksGrpcTransport, transports.CloudTasksGrpcAsyncIOTransport,], + [ + transports.CloudTasksGrpcTransport, + transports.CloudTasksGrpcAsyncIOTransport, + ], ) def test_transport_adc(transport_class): # Test default credentials are used if not provided. @@ -4280,8 +4980,13 @@ def test_transport_adc(transport_class): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = CloudTasksClient(credentials=ga_credentials.AnonymousCredentials(),) - assert isinstance(client.transport, transports.CloudTasksGrpcTransport,) + client = CloudTasksClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.CloudTasksGrpcTransport, + ) def test_cloud_tasks_base_transport_error(): @@ -4341,7 +5046,8 @@ def test_cloud_tasks_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.CloudTasksTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -4376,7 +5082,10 @@ def test_cloud_tasks_auth_adc(): @pytest.mark.parametrize( "transport_class", - [transports.CloudTasksGrpcTransport, transports.CloudTasksGrpcAsyncIOTransport,], + [ + transports.CloudTasksGrpcTransport, + transports.CloudTasksGrpcAsyncIOTransport, + ], ) def test_cloud_tasks_transport_auth_adc(transport_class): # If credentials and host are not provided, the transport class should use @@ -4493,7 +5202,8 @@ def test_cloud_tasks_grpc_transport_channel(): # Check that channel is used if provided. transport = transports.CloudTasksGrpcTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -4505,7 +5215,8 @@ def test_cloud_tasks_grpc_asyncio_transport_channel(): # Check that channel is used if provided. transport = transports.CloudTasksGrpcAsyncIOTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -4609,7 +5320,9 @@ def test_queue_path(): location = "clam" queue = "whelk" expected = "projects/{project}/locations/{location}/queues/{queue}".format( - project=project, location=location, queue=queue, + project=project, + location=location, + queue=queue, ) actual = CloudTasksClient.queue_path(project, location, queue) assert expected == actual @@ -4633,8 +5346,13 @@ def test_task_path(): location = "mussel" queue = "winkle" task = "nautilus" - expected = "projects/{project}/locations/{location}/queues/{queue}/tasks/{task}".format( - project=project, location=location, queue=queue, task=task, + expected = ( + "projects/{project}/locations/{location}/queues/{queue}/tasks/{task}".format( + project=project, + location=location, + queue=queue, + task=task, + ) ) actual = CloudTasksClient.task_path(project, location, queue, task) assert expected == actual @@ -4676,7 +5394,9 @@ def test_parse_common_billing_account_path(): def test_common_folder_path(): folder = "oyster" - expected = "folders/{folder}".format(folder=folder,) + expected = "folders/{folder}".format( + folder=folder, + ) actual = CloudTasksClient.common_folder_path(folder) assert expected == actual @@ -4694,7 +5414,9 @@ def test_parse_common_folder_path(): def test_common_organization_path(): organization = "cuttlefish" - expected = "organizations/{organization}".format(organization=organization,) + expected = "organizations/{organization}".format( + organization=organization, + ) actual = CloudTasksClient.common_organization_path(organization) assert expected == actual @@ -4712,7 +5434,9 @@ def test_parse_common_organization_path(): def test_common_project_path(): project = "winkle" - expected = "projects/{project}".format(project=project,) + expected = "projects/{project}".format( + project=project, + ) actual = CloudTasksClient.common_project_path(project) assert expected == actual @@ -4732,7 +5456,8 @@ def test_common_location_path(): project = "scallop" location = "abalone" expected = "projects/{project}/locations/{location}".format( - project=project, location=location, + project=project, + location=location, ) actual = CloudTasksClient.common_location_path(project, location) assert expected == actual @@ -4757,7 +5482,8 @@ def test_client_with_default_client_info(): transports.CloudTasksTransport, "_prep_wrapped_messages" ) as prep: client = CloudTasksClient( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4766,7 +5492,8 @@ def test_client_with_default_client_info(): ) as prep: transport_class = CloudTasksClient.get_transport_class() transport = transport_class( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -4774,7 +5501,8 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = CloudTasksAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc_asyncio", ) with mock.patch.object( type(getattr(client.transport, "grpc_channel")), "close" From 92805535df809e5c871f929616190893d427899b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 30 Mar 2022 16:56:25 +0000 Subject: [PATCH 06/17] chore(python): add E231 to .flake8 ignore list (#244) Source-Link: https://github.com/googleapis/synthtool/commit/7ff4aad2ec5af0380e8bd6da1fa06eaadf24ec81 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:462782b0b492346b2d9099aaff52206dd30bc8e031ea97082e6facecc2373244 --- .flake8 | 2 +- .github/.OwlBot.lock.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.flake8 b/.flake8 index 29227d4c..2e438749 100644 --- a/.flake8 +++ b/.flake8 @@ -16,7 +16,7 @@ # Generated by synthtool. DO NOT EDIT! [flake8] -ignore = E203, E266, E501, W503 +ignore = E203, E231, E266, E501, W503 exclude = # Exclude generated code. **/proto/** diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 87dd0061..9e0a9356 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,4 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe + digest: sha256:462782b0b492346b2d9099aaff52206dd30bc8e031ea97082e6facecc2373244 From 882faed421c4c6f3a18a22a443b1aec610890031 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 00:18:19 +0000 Subject: [PATCH 07/17] chore(python): update .pre-commit-config.yaml to use black==22.3.0 (#245) Source-Link: https://github.com/googleapis/synthtool/commit/7804ade3daae0d66649bee8df6c55484c6580b8d Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:eede5672562a32821444a8e803fb984a6f61f2237ea3de229d2de24453f4ae7d --- .github/.OwlBot.lock.yaml | 3 ++- .pre-commit-config.yaml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 9e0a9356..22cc254a 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,4 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:462782b0b492346b2d9099aaff52206dd30bc8e031ea97082e6facecc2373244 + digest: sha256:eede5672562a32821444a8e803fb984a6f61f2237ea3de229d2de24453f4ae7d +# created: 2022-03-30T23:44:26.560599165Z diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 62eb5a77..46d23716 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: end-of-file-fixer - id: check-yaml - repo: https://github.com/psf/black - rev: 19.10b0 + rev: 22.3.0 hooks: - id: black - repo: https://gitlab.com/pycqa/flake8 From da445ac4b8c8d6dfd6291030f1de80430a2f2c69 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 02:10:26 +0000 Subject: [PATCH 08/17] chore(python): Enable size-label bot (#246) Source-Link: https://github.com/googleapis/synthtool/commit/06e82790dd719a165ad32b8a06f8f6ec3e3cae0f Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:b3500c053313dc34e07b1632ba9e4e589f4f77036a7cf39e1fe8906811ae0fce --- .github/.OwlBot.lock.yaml | 4 ++-- .github/auto-label.yaml | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 .github/auto-label.yaml diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 22cc254a..58a0b153 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:eede5672562a32821444a8e803fb984a6f61f2237ea3de229d2de24453f4ae7d -# created: 2022-03-30T23:44:26.560599165Z + digest: sha256:b3500c053313dc34e07b1632ba9e4e589f4f77036a7cf39e1fe8906811ae0fce +# created: 2022-04-01T01:42:03.609279246Z diff --git a/.github/auto-label.yaml b/.github/auto-label.yaml new file mode 100644 index 00000000..09c8d735 --- /dev/null +++ b/.github/auto-label.yaml @@ -0,0 +1,2 @@ +requestsize: + enabled: true From 3ff18ff5f6b27a0cf61cd213a565a797ed6936e0 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Fri, 1 Apr 2022 19:40:17 +0000 Subject: [PATCH 09/17] chore(python): refactor unit / system test dependency install (#247) Source-Link: https://github.com/googleapis/synthtool/commit/993985f0fc4b37152e588f0549bcbdaf34666023 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:1894490910e891a385484514b22eb5133578897eb5b3c380e6d8ad475c6647cd --- .github/.OwlBot.lock.yaml | 4 +- noxfile.py | 105 ++++++++++++++++++++++++++++++-------- 2 files changed, 87 insertions(+), 22 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 58a0b153..fa576229 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:b3500c053313dc34e07b1632ba9e4e589f4f77036a7cf39e1fe8906811ae0fce -# created: 2022-04-01T01:42:03.609279246Z + digest: sha256:1894490910e891a385484514b22eb5133578897eb5b3c380e6d8ad475c6647cd +# created: 2022-04-01T15:48:07.524222836Z diff --git a/noxfile.py b/noxfile.py index 3addb4ed..6ee5e8ab 100644 --- a/noxfile.py +++ b/noxfile.py @@ -20,16 +20,40 @@ import os import pathlib import shutil +import warnings import nox - BLACK_VERSION = "black==22.3.0" BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" -SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] + UNIT_TEST_PYTHON_VERSIONS = ["3.6", "3.7", "3.8", "3.9", "3.10"] +UNIT_TEST_STANDARD_DEPENDENCIES = [ + "mock", + "asyncmock", + "pytest", + "pytest-cov", + "pytest-asyncio", +] +UNIT_TEST_EXTERNAL_DEPENDENCIES = [] +UNIT_TEST_LOCAL_DEPENDENCIES = [] +UNIT_TEST_DEPENDENCIES = [] +UNIT_TEST_EXTRAS = [] +UNIT_TEST_EXTRAS_BY_PYTHON = {} + +SYSTEM_TEST_PYTHON_VERSIONS = ["3.8"] +SYSTEM_TEST_STANDARD_DEPENDENCIES = [ + "mock", + "pytest", + "google-cloud-testutils", +] +SYSTEM_TEST_EXTERNAL_DEPENDENCIES = [] +SYSTEM_TEST_LOCAL_DEPENDENCIES = [] +SYSTEM_TEST_DEPENDENCIES = [] +SYSTEM_TEST_EXTRAS = [] +SYSTEM_TEST_EXTRAS_BY_PYTHON = {} CURRENT_DIRECTORY = pathlib.Path(__file__).parent.absolute() @@ -81,23 +105,41 @@ def lint_setup_py(session): session.run("python", "setup.py", "check", "--restructuredtext", "--strict") +def install_unittest_dependencies(session, *constraints): + standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES + session.install(*standard_deps, *constraints) + + if UNIT_TEST_EXTERNAL_DEPENDENCIES: + warnings.warn( + "'unit_test_external_dependencies' is deprecated. Instead, please " + "use 'unit_test_dependencies' or 'unit_test_local_dependencies'.", + DeprecationWarning, + ) + session.install(*UNIT_TEST_EXTERNAL_DEPENDENCIES, *constraints) + + if UNIT_TEST_LOCAL_DEPENDENCIES: + session.install(*UNIT_TEST_LOCAL_DEPENDENCIES, *constraints) + + if UNIT_TEST_EXTRAS_BY_PYTHON: + extras = UNIT_TEST_EXTRAS_BY_PYTHON.get(session.python, []) + elif UNIT_TEST_EXTRAS: + extras = UNIT_TEST_EXTRAS + else: + extras = [] + + if extras: + session.install("-e", f".[{','.join(extras)}]", *constraints) + else: + session.install("-e", ".", *constraints) + + def default(session): # Install all test dependencies, then install this package in-place. constraints_path = str( CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" ) - session.install( - "mock", - "asyncmock", - "pytest", - "pytest-cov", - "pytest-asyncio", - "-c", - constraints_path, - ) - - session.install("-e", ".", "-c", constraints_path) + install_unittest_dependencies(session, "-c", constraints_path) # Run py.test against the unit tests. session.run( @@ -121,6 +163,35 @@ def unit(session): default(session) +def install_systemtest_dependencies(session, *constraints): + + # Use pre-release gRPC for system tests. + session.install("--pre", "grpcio") + + session.install(*SYSTEM_TEST_STANDARD_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_EXTERNAL_DEPENDENCIES: + session.install(*SYSTEM_TEST_EXTERNAL_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_LOCAL_DEPENDENCIES: + session.install("-e", *SYSTEM_TEST_LOCAL_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_DEPENDENCIES: + session.install("-e", *SYSTEM_TEST_DEPENDENCIES, *constraints) + + if SYSTEM_TEST_EXTRAS_BY_PYTHON: + extras = SYSTEM_TEST_EXTRAS_BY_PYTHON.get(session.python, []) + elif SYSTEM_TEST_EXTRAS: + extras = SYSTEM_TEST_EXTRAS + else: + extras = [] + + if extras: + session.install("-e", f".[{','.join(extras)}]", *constraints) + else: + session.install("-e", ".", *constraints) + + @nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) def system(session): """Run the system test suite.""" @@ -143,13 +214,7 @@ def system(session): if not system_test_exists and not system_test_folder_exists: session.skip("System tests were not found") - # Use pre-release gRPC for system tests. - session.install("--pre", "grpcio") - - # Install all test dependencies, then install this package into the - # virtualenv's dist-packages. - session.install("mock", "pytest", "google-cloud-testutils", "-c", constraints_path) - session.install("-e", ".", "-c", constraints_path) + install_systemtest_dependencies(session, "-c", constraints_path) # Run py.test against the system tests. if system_test_exists: From fe4c4f9b3a80590ad9a5f89ab0e0cfe75146b60a Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 6 Apr 2022 06:57:34 -0400 Subject: [PATCH 10/17] chore(python): add license header to auto-label.yaml (#249) Source-Link: https://github.com/googleapis/synthtool/commit/eb78c980b52c7c6746d2edb77d9cf7aaa99a2aab Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- .github/auto-label.yaml | 13 +++++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index fa576229..bc893c97 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:1894490910e891a385484514b22eb5133578897eb5b3c380e6d8ad475c6647cd -# created: 2022-04-01T15:48:07.524222836Z + digest: sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163 +# created: 2022-04-06T10:30:21.687684602Z diff --git a/.github/auto-label.yaml b/.github/auto-label.yaml index 09c8d735..41bff0b5 100644 --- a/.github/auto-label.yaml +++ b/.github/auto-label.yaml @@ -1,2 +1,15 @@ +# Copyright 2022 Google LLC +# +# Licensed under the Apache License, Version 2.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. requestsize: enabled: true From 7b7a2946a8554a06d8fdc57b13c2726c5d8a443b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 14 Apr 2022 21:48:29 +0000 Subject: [PATCH 11/17] chore: use gapic-generator-python 0.65.1 (#252) - [ ] Regenerate this pull request now. PiperOrigin-RevId: 441524537 Source-Link: https://github.com/googleapis/googleapis/commit/2a273915b3f70fe86c9d2a75470a0b83e48d0abf Source-Link: https://github.com/googleapis/googleapis-gen/commit/ab6756a48c89b5bcb9fb73443cb8e55d574f4643 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWI2NzU2YTQ4Yzg5YjViY2I5ZmI3MzQ0M2NiOGU1NWQ1NzRmNDY0MyJ9 feat: AuditConfig for IAM v1 fix(deps): require grpc-google-iam-v1 >=0.12.4 docs: fix type in docstring for map fields --- .../services/cloud_tasks/async_client.py | 113 +- .../tasks_v2/services/cloud_tasks/client.py | 113 +- .../services/cloud_tasks/transports/base.py | 5 + .../services/cloud_tasks/transports/grpc.py | 4 + google/cloud/tasks_v2/types/target.py | 4 +- .../services/cloud_tasks/async_client.py | 117 +- .../services/cloud_tasks/client.py | 117 +- .../services/cloud_tasks/transports/base.py | 5 + .../services/cloud_tasks/transports/grpc.py | 4 + google/cloud/tasks_v2beta2/types/target.py | 2 +- .../services/cloud_tasks/async_client.py | 113 +- .../services/cloud_tasks/client.py | 113 +- .../services/cloud_tasks/transports/base.py | 5 + .../services/cloud_tasks/transports/grpc.py | 4 + google/cloud/tasks_v2beta3/types/target.py | 4 +- ...erated_cloud_tasks_get_iam_policy_async.py | 3 +- ...nerated_cloud_tasks_get_iam_policy_sync.py | 3 +- ...erated_cloud_tasks_set_iam_policy_async.py | 3 +- ...nerated_cloud_tasks_set_iam_policy_sync.py | 3 +- ..._cloud_tasks_test_iam_permissions_async.py | 3 +- ...d_cloud_tasks_test_iam_permissions_sync.py | 3 +- ...erated_cloud_tasks_get_iam_policy_async.py | 3 +- ...nerated_cloud_tasks_get_iam_policy_sync.py | 3 +- ...erated_cloud_tasks_set_iam_policy_async.py | 3 +- ...nerated_cloud_tasks_set_iam_policy_sync.py | 3 +- ..._cloud_tasks_test_iam_permissions_async.py | 3 +- ...d_cloud_tasks_test_iam_permissions_sync.py | 3 +- ...erated_cloud_tasks_get_iam_policy_async.py | 3 +- ...nerated_cloud_tasks_get_iam_policy_sync.py | 3 +- ...erated_cloud_tasks_set_iam_policy_async.py | 3 +- ...nerated_cloud_tasks_set_iam_policy_sync.py | 3 +- ..._cloud_tasks_test_iam_permissions_async.py | 3 +- ...d_cloud_tasks_test_iam_permissions_sync.py | 3 +- .../snippet_metadata_tasks_v2.json | 1438 +++++++++++-- .../snippet_metadata_tasks_v2beta2.json | 1796 +++++++++++++++-- .../snippet_metadata_tasks_v2beta3.json | 1438 +++++++++++-- scripts/fixup_tasks_v2_keywords.py | 2 +- scripts/fixup_tasks_v2beta2_keywords.py | 2 +- scripts/fixup_tasks_v2beta3_keywords.py | 2 +- setup.py | 2 +- testing/constraints-3.6.txt | 2 +- tests/unit/gapic/tasks_v2/test_cloud_tasks.py | 88 +- .../gapic/tasks_v2beta2/test_cloud_tasks.py | 88 +- .../gapic/tasks_v2beta3/test_cloud_tasks.py | 88 +- 44 files changed, 4900 insertions(+), 823 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 070459dd..d6907ec4 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, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core.client_options import ClientOptions @@ -222,7 +222,6 @@ async def list_queues( r"""Lists queues. Queues are returned in lexicographical order. - .. code-block:: python from google.cloud import tasks_v2 @@ -461,7 +460,6 @@ async def create_queue( queue.yaml `__ before using this method. - .. code-block:: python from google.cloud import tasks_v2 @@ -591,7 +589,6 @@ async def update_queue( queue.yaml `__ before using this method. - .. code-block:: python from google.cloud import tasks_v2 @@ -722,7 +719,6 @@ async def delete_queue( queue.yaml `__ before using this method. - .. code-block:: python from google.cloud import tasks_v2 @@ -821,7 +817,6 @@ async def purge_queue( effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible. - .. code-block:: python from google.cloud import tasks_v2 @@ -928,7 +923,6 @@ 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:: python from google.cloud import tasks_v2 @@ -1042,7 +1036,6 @@ async def resume_queue( Scaling Risks `__. - .. code-block:: python from google.cloud import tasks_v2 @@ -1150,17 +1143,17 @@ async def get_iam_policy( - ``cloudtasks.queues.getIamPolicy`` - .. code-block:: python from google.cloud import tasks_v2 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_get_iam_policy(): # Create a client client = tasks_v2.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2.GetIamPolicyRequest( + request = iam_policy_pb2.GetIamPolicyRequest( resource="resource_value", ) @@ -1191,21 +1184,26 @@ def sample_get_iam_policy(): Returns: google.iam.v1.policy_pb2.Policy: - Defines an Identity and Access Management (IAM) policy. It is used to - specify access control policies for Cloud Platform - resources. + An Identity and Access Management (IAM) policy, which specifies access + controls for Google Cloud resources. A Policy is a collection of bindings. A binding binds - one or more members to a single role. Members can be - user accounts, service accounts, Google groups, and - domains (such as G Suite). A role is a named list of - permissions (defined by IAM or configured by users). - A binding can optionally specify a condition, which - is a logic expression that further constrains the - role binding based on attributes about the request - and/or target resource. - - **JSON Example** + one or more members, or principals, to a single role. + Principals can be user accounts, service accounts, + Google groups, and domains (such as G Suite). A role + is a named list of permissions; each role can be an + IAM predefined role or a user-created custom role. + + For some types of Google Cloud resources, a binding + can also specify a condition, which is a logical + expression that allows access to a resource only if + the expression evaluates to true. A condition can add + constraints based on attributes of the request, the + resource, or both. To learn which resources support + conditions in their IAM policies, see the [IAM + documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + + **JSON example:** { "bindings": [ @@ -1220,17 +1218,17 @@ def sample_get_iam_policy(): }, { "role": "roles/resourcemanager.organizationViewer", - "members": ["user:eve@example.com"], + "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } - ] + ], "etag": "BwWWja0YfJA=", "version": 3 } - **YAML Example** + **YAML example:** bindings: - members: - user:\ mike@example.com - group:\ admins@example.com - domain:google.com - @@ -1241,11 +1239,12 @@ def sample_get_iam_policy(): condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < - timestamp('2020-10-01T00:00:00.000Z') + timestamp('2020-10-01T00:00:00.000Z') etag: + BwWWja0YfJA= version: 3 For a description of IAM and its features, see the - [IAM developer's - guide](\ https://cloud.google.com/iam/docs). + [IAM + documentation](\ https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -1325,17 +1324,17 @@ async def set_iam_policy( - ``cloudtasks.queues.setIamPolicy`` - .. code-block:: python from google.cloud import tasks_v2 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_set_iam_policy(): # Create a client client = tasks_v2.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2.SetIamPolicyRequest( + request = iam_policy_pb2.SetIamPolicyRequest( resource="resource_value", ) @@ -1366,21 +1365,26 @@ def sample_set_iam_policy(): Returns: google.iam.v1.policy_pb2.Policy: - Defines an Identity and Access Management (IAM) policy. It is used to - specify access control policies for Cloud Platform - resources. + An Identity and Access Management (IAM) policy, which specifies access + controls for Google Cloud resources. A Policy is a collection of bindings. A binding binds - one or more members to a single role. Members can be - user accounts, service accounts, Google groups, and - domains (such as G Suite). A role is a named list of - permissions (defined by IAM or configured by users). - A binding can optionally specify a condition, which - is a logic expression that further constrains the - role binding based on attributes about the request - and/or target resource. - - **JSON Example** + one or more members, or principals, to a single role. + Principals can be user accounts, service accounts, + Google groups, and domains (such as G Suite). A role + is a named list of permissions; each role can be an + IAM predefined role or a user-created custom role. + + For some types of Google Cloud resources, a binding + can also specify a condition, which is a logical + expression that allows access to a resource only if + the expression evaluates to true. A condition can add + constraints based on attributes of the request, the + resource, or both. To learn which resources support + conditions in their IAM policies, see the [IAM + documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + + **JSON example:** { "bindings": [ @@ -1395,17 +1399,17 @@ def sample_set_iam_policy(): }, { "role": "roles/resourcemanager.organizationViewer", - "members": ["user:eve@example.com"], + "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } - ] + ], "etag": "BwWWja0YfJA=", "version": 3 } - **YAML Example** + **YAML example:** bindings: - members: - user:\ mike@example.com - group:\ admins@example.com - domain:google.com - @@ -1416,11 +1420,12 @@ def sample_set_iam_policy(): condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < - timestamp('2020-10-01T00:00:00.000Z') + timestamp('2020-10-01T00:00:00.000Z') etag: + BwWWja0YfJA= version: 3 For a description of IAM and its features, see the - [IAM developer's - guide](\ https://cloud.google.com/iam/docs). + [IAM + documentation](\ https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -1487,17 +1492,17 @@ async def test_iam_permissions( authorization checking. This operation may "fail open" without warning. - .. code-block:: python from google.cloud import tasks_v2 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_test_iam_permissions(): # Create a client client = tasks_v2.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2.TestIamPermissionsRequest( + request = iam_policy_pb2.TestIamPermissionsRequest( resource="resource_value", permissions=['permissions_value_1', 'permissions_value_2'], ) @@ -1615,7 +1620,6 @@ async def list_tasks( The tasks may be returned in any order. The ordering may change at any time. - .. code-block:: python from google.cloud import tasks_v2 @@ -1845,7 +1849,6 @@ async def create_task( - The maximum task size is 100KB. - .. code-block:: python from google.cloud import tasks_v2 @@ -1992,7 +1995,6 @@ async def delete_task( A task cannot be deleted if it has executed successfully or permanently failed. - .. code-block:: python from google.cloud import tasks_v2 @@ -2113,7 +2115,6 @@ 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:: python from google.cloud import tasks_v2 diff --git a/google/cloud/tasks_v2/services/cloud_tasks/client.py b/google/cloud/tasks_v2/services/cloud_tasks/client.py index 96d9998a..4348f0af 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/client.py @@ -16,7 +16,7 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib @@ -472,7 +472,6 @@ def list_queues( r"""Lists queues. Queues are returned in lexicographical order. - .. code-block:: python from google.cloud import tasks_v2 @@ -691,7 +690,6 @@ def create_queue( queue.yaml `__ before using this method. - .. code-block:: python from google.cloud import tasks_v2 @@ -821,7 +819,6 @@ def update_queue( queue.yaml `__ before using this method. - .. code-block:: python from google.cloud import tasks_v2 @@ -952,7 +949,6 @@ def delete_queue( queue.yaml `__ before using this method. - .. code-block:: python from google.cloud import tasks_v2 @@ -1041,7 +1037,6 @@ def purge_queue( effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible. - .. code-block:: python from google.cloud import tasks_v2 @@ -1148,7 +1143,6 @@ def pause_queue( paused if its [state][google.cloud.tasks.v2.Queue.state] is [PAUSED][google.cloud.tasks.v2.Queue.State.PAUSED]. - .. code-block:: python from google.cloud import tasks_v2 @@ -1262,7 +1256,6 @@ def resume_queue( Scaling Risks `__. - .. code-block:: python from google.cloud import tasks_v2 @@ -1370,17 +1363,17 @@ def get_iam_policy( - ``cloudtasks.queues.getIamPolicy`` - .. code-block:: python from google.cloud import tasks_v2 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_get_iam_policy(): # Create a client client = tasks_v2.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2.GetIamPolicyRequest( + request = iam_policy_pb2.GetIamPolicyRequest( resource="resource_value", ) @@ -1411,21 +1404,26 @@ def sample_get_iam_policy(): Returns: google.iam.v1.policy_pb2.Policy: - Defines an Identity and Access Management (IAM) policy. It is used to - specify access control policies for Cloud Platform - resources. + An Identity and Access Management (IAM) policy, which specifies access + controls for Google Cloud resources. A Policy is a collection of bindings. A binding binds - one or more members to a single role. Members can be - user accounts, service accounts, Google groups, and - domains (such as G Suite). A role is a named list of - permissions (defined by IAM or configured by users). - A binding can optionally specify a condition, which - is a logic expression that further constrains the - role binding based on attributes about the request - and/or target resource. - - **JSON Example** + one or more members, or principals, to a single role. + Principals can be user accounts, service accounts, + Google groups, and domains (such as G Suite). A role + is a named list of permissions; each role can be an + IAM predefined role or a user-created custom role. + + For some types of Google Cloud resources, a binding + can also specify a condition, which is a logical + expression that allows access to a resource only if + the expression evaluates to true. A condition can add + constraints based on attributes of the request, the + resource, or both. To learn which resources support + conditions in their IAM policies, see the [IAM + documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + + **JSON example:** { "bindings": [ @@ -1440,17 +1438,17 @@ def sample_get_iam_policy(): }, { "role": "roles/resourcemanager.organizationViewer", - "members": ["user:eve@example.com"], + "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } - ] + ], "etag": "BwWWja0YfJA=", "version": 3 } - **YAML Example** + **YAML example:** bindings: - members: - user:\ mike@example.com - group:\ admins@example.com - domain:google.com - @@ -1461,11 +1459,12 @@ def sample_get_iam_policy(): condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < - timestamp('2020-10-01T00:00:00.000Z') + timestamp('2020-10-01T00:00:00.000Z') etag: + BwWWja0YfJA= version: 3 For a description of IAM and its features, see the - [IAM developer's - guide](\ https://cloud.google.com/iam/docs). + [IAM + documentation](\ https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -1532,17 +1531,17 @@ def set_iam_policy( - ``cloudtasks.queues.setIamPolicy`` - .. code-block:: python from google.cloud import tasks_v2 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_set_iam_policy(): # Create a client client = tasks_v2.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2.SetIamPolicyRequest( + request = iam_policy_pb2.SetIamPolicyRequest( resource="resource_value", ) @@ -1573,21 +1572,26 @@ def sample_set_iam_policy(): Returns: google.iam.v1.policy_pb2.Policy: - Defines an Identity and Access Management (IAM) policy. It is used to - specify access control policies for Cloud Platform - resources. + An Identity and Access Management (IAM) policy, which specifies access + controls for Google Cloud resources. A Policy is a collection of bindings. A binding binds - one or more members to a single role. Members can be - user accounts, service accounts, Google groups, and - domains (such as G Suite). A role is a named list of - permissions (defined by IAM or configured by users). - A binding can optionally specify a condition, which - is a logic expression that further constrains the - role binding based on attributes about the request - and/or target resource. - - **JSON Example** + one or more members, or principals, to a single role. + Principals can be user accounts, service accounts, + Google groups, and domains (such as G Suite). A role + is a named list of permissions; each role can be an + IAM predefined role or a user-created custom role. + + For some types of Google Cloud resources, a binding + can also specify a condition, which is a logical + expression that allows access to a resource only if + the expression evaluates to true. A condition can add + constraints based on attributes of the request, the + resource, or both. To learn which resources support + conditions in their IAM policies, see the [IAM + documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + + **JSON example:** { "bindings": [ @@ -1602,17 +1606,17 @@ def sample_set_iam_policy(): }, { "role": "roles/resourcemanager.organizationViewer", - "members": ["user:eve@example.com"], + "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } - ] + ], "etag": "BwWWja0YfJA=", "version": 3 } - **YAML Example** + **YAML example:** bindings: - members: - user:\ mike@example.com - group:\ admins@example.com - domain:google.com - @@ -1623,11 +1627,12 @@ def sample_set_iam_policy(): condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < - timestamp('2020-10-01T00:00:00.000Z') + timestamp('2020-10-01T00:00:00.000Z') etag: + BwWWja0YfJA= version: 3 For a description of IAM and its features, see the - [IAM developer's - guide](\ https://cloud.google.com/iam/docs). + [IAM + documentation](\ https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -1691,17 +1696,17 @@ def test_iam_permissions( authorization checking. This operation may "fail open" without warning. - .. code-block:: python from google.cloud import tasks_v2 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_test_iam_permissions(): # Create a client client = tasks_v2.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2.TestIamPermissionsRequest( + request = iam_policy_pb2.TestIamPermissionsRequest( resource="resource_value", permissions=['permissions_value_1', 'permissions_value_2'], ) @@ -1807,7 +1812,6 @@ def list_tasks( The tasks may be returned in any order. The ordering may change at any time. - .. code-block:: python from google.cloud import tasks_v2 @@ -2017,7 +2021,6 @@ def create_task( - The maximum task size is 100KB. - .. code-block:: python from google.cloud import tasks_v2 @@ -2164,7 +2167,6 @@ def delete_task( A task cannot be deleted if it has executed successfully or permanently failed. - .. code-block:: python from google.cloud import tasks_v2 @@ -2275,7 +2277,6 @@ 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:: python from google.cloud import tasks_v2 diff --git a/google/cloud/tasks_v2/services/cloud_tasks/transports/base.py b/google/cloud/tasks_v2/services/cloud_tasks/transports/base.py index 77a75271..babc01ee 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/transports/base.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/transports/base.py @@ -87,6 +87,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -434,5 +435,9 @@ def run_task( ) -> Callable[[cloudtasks.RunTaskRequest], Union[task.Task, Awaitable[task.Task]]]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("CloudTasksTransport",) 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 35e13bf7..98414a99 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/transports/grpc.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/transports/grpc.py @@ -773,5 +773,9 @@ def run_task(self) -> Callable[[cloudtasks.RunTaskRequest], task.Task]: def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("CloudTasksGrpcTransport",) diff --git a/google/cloud/tasks_v2/types/target.py b/google/cloud/tasks_v2/types/target.py index e66b324b..00edf096 100644 --- a/google/cloud/tasks_v2/types/target.py +++ b/google/cloud/tasks_v2/types/target.py @@ -101,7 +101,7 @@ class HttpRequest(proto.Message): http_method (google.cloud.tasks_v2.types.HttpMethod): The HTTP method to use for the request. The default is POST. - headers (Sequence[google.cloud.tasks_v2.types.HttpRequest.HeadersEntry]): + headers (Mapping[str, str]): HTTP request headers. This map contains the header field names and values. Headers @@ -289,7 +289,7 @@ class AppEngineHttpRequest(proto.Message): is empty, then the root path "/" will be used. No spaces are allowed, and the maximum length allowed is 2083 characters. - headers (Sequence[google.cloud.tasks_v2.types.AppEngineHttpRequest.HeadersEntry]): + headers (Mapping[str, str]): HTTP request headers. This map contains the header field names and values. Headers 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 ca826dd3..586edc75 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, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core.client_options import ClientOptions @@ -222,7 +222,6 @@ async def list_queues( r"""Lists queues. Queues are returned in lexicographical order. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -461,7 +460,6 @@ async def create_queue( queue.yaml `__ before using this method. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -591,7 +589,6 @@ async def update_queue( queue.yaml `__ before using this method. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -723,7 +720,6 @@ async def delete_queue( queue.yaml `__ before using this method. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -822,7 +818,6 @@ async def purge_queue( effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -929,7 +924,6 @@ 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:: python from google.cloud import tasks_v2beta2 @@ -1043,7 +1037,6 @@ async def resume_queue( Scaling Risks `__. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -1151,17 +1144,17 @@ async def get_iam_policy( - ``cloudtasks.queues.getIamPolicy`` - .. code-block:: python from google.cloud import tasks_v2beta2 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_get_iam_policy(): # Create a client client = tasks_v2beta2.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2beta2.GetIamPolicyRequest( + request = iam_policy_pb2.GetIamPolicyRequest( resource="resource_value", ) @@ -1192,21 +1185,26 @@ def sample_get_iam_policy(): Returns: google.iam.v1.policy_pb2.Policy: - Defines an Identity and Access Management (IAM) policy. It is used to - specify access control policies for Cloud Platform - resources. + An Identity and Access Management (IAM) policy, which specifies access + controls for Google Cloud resources. A Policy is a collection of bindings. A binding binds - one or more members to a single role. Members can be - user accounts, service accounts, Google groups, and - domains (such as G Suite). A role is a named list of - permissions (defined by IAM or configured by users). - A binding can optionally specify a condition, which - is a logic expression that further constrains the - role binding based on attributes about the request - and/or target resource. - - **JSON Example** + one or more members, or principals, to a single role. + Principals can be user accounts, service accounts, + Google groups, and domains (such as G Suite). A role + is a named list of permissions; each role can be an + IAM predefined role or a user-created custom role. + + For some types of Google Cloud resources, a binding + can also specify a condition, which is a logical + expression that allows access to a resource only if + the expression evaluates to true. A condition can add + constraints based on attributes of the request, the + resource, or both. To learn which resources support + conditions in their IAM policies, see the [IAM + documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + + **JSON example:** { "bindings": [ @@ -1221,17 +1219,17 @@ def sample_get_iam_policy(): }, { "role": "roles/resourcemanager.organizationViewer", - "members": ["user:eve@example.com"], + "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } - ] + ], "etag": "BwWWja0YfJA=", "version": 3 } - **YAML Example** + **YAML example:** bindings: - members: - user:\ mike@example.com - group:\ admins@example.com - domain:google.com - @@ -1242,11 +1240,12 @@ def sample_get_iam_policy(): condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < - timestamp('2020-10-01T00:00:00.000Z') + timestamp('2020-10-01T00:00:00.000Z') etag: + BwWWja0YfJA= version: 3 For a description of IAM and its features, see the - [IAM developer's - guide](\ https://cloud.google.com/iam/docs). + [IAM + documentation](\ https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -1326,17 +1325,17 @@ async def set_iam_policy( - ``cloudtasks.queues.setIamPolicy`` - .. code-block:: python from google.cloud import tasks_v2beta2 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_set_iam_policy(): # Create a client client = tasks_v2beta2.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2beta2.SetIamPolicyRequest( + request = iam_policy_pb2.SetIamPolicyRequest( resource="resource_value", ) @@ -1367,21 +1366,26 @@ def sample_set_iam_policy(): Returns: google.iam.v1.policy_pb2.Policy: - Defines an Identity and Access Management (IAM) policy. It is used to - specify access control policies for Cloud Platform - resources. + An Identity and Access Management (IAM) policy, which specifies access + controls for Google Cloud resources. A Policy is a collection of bindings. A binding binds - one or more members to a single role. Members can be - user accounts, service accounts, Google groups, and - domains (such as G Suite). A role is a named list of - permissions (defined by IAM or configured by users). - A binding can optionally specify a condition, which - is a logic expression that further constrains the - role binding based on attributes about the request - and/or target resource. - - **JSON Example** + one or more members, or principals, to a single role. + Principals can be user accounts, service accounts, + Google groups, and domains (such as G Suite). A role + is a named list of permissions; each role can be an + IAM predefined role or a user-created custom role. + + For some types of Google Cloud resources, a binding + can also specify a condition, which is a logical + expression that allows access to a resource only if + the expression evaluates to true. A condition can add + constraints based on attributes of the request, the + resource, or both. To learn which resources support + conditions in their IAM policies, see the [IAM + documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + + **JSON example:** { "bindings": [ @@ -1396,17 +1400,17 @@ def sample_set_iam_policy(): }, { "role": "roles/resourcemanager.organizationViewer", - "members": ["user:eve@example.com"], + "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } - ] + ], "etag": "BwWWja0YfJA=", "version": 3 } - **YAML Example** + **YAML example:** bindings: - members: - user:\ mike@example.com - group:\ admins@example.com - domain:google.com - @@ -1417,11 +1421,12 @@ def sample_set_iam_policy(): condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < - timestamp('2020-10-01T00:00:00.000Z') + timestamp('2020-10-01T00:00:00.000Z') etag: + BwWWja0YfJA= version: 3 For a description of IAM and its features, see the - [IAM developer's - guide](\ https://cloud.google.com/iam/docs). + [IAM + documentation](\ https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -1488,17 +1493,17 @@ async def test_iam_permissions( authorization checking. This operation may "fail open" without warning. - .. code-block:: python from google.cloud import tasks_v2beta2 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_test_iam_permissions(): # Create a client client = tasks_v2beta2.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2beta2.TestIamPermissionsRequest( + request = iam_policy_pb2.TestIamPermissionsRequest( resource="resource_value", permissions=['permissions_value_1', 'permissions_value_2'], ) @@ -1616,7 +1621,6 @@ async def list_tasks( The tasks may be returned in any order. The ordering may change at any time. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -1850,7 +1854,6 @@ async def create_task( - For [pull queues][google.cloud.tasks.v2beta2.PullTarget], the maximum task size is 1MB. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -1997,7 +2000,6 @@ async def delete_task( A task cannot be deleted if it has completed successfully or permanently failed. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -2116,7 +2118,6 @@ async def lease_tasks( [max_tasks_dispatched_per_second][google.cloud.tasks.v2beta2.RateLimits.max_tasks_dispatched_per_second] is exceeded. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -2260,7 +2261,6 @@ async def acknowledge_task( [GetTask][google.cloud.tasks.v2beta2.CloudTasks.GetTask], or [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks]. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -2368,7 +2368,6 @@ async def renew_lease( in the task's [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -2499,7 +2498,6 @@ async def cancel_lease( next caller of [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks]. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -2642,7 +2640,6 @@ async def run_task( be called on a [pull task][google.cloud.tasks.v2beta2.PullMessage]. - .. code-block:: python from google.cloud import tasks_v2beta2 diff --git a/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py b/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py index 1144de2e..c9c71258 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py @@ -16,7 +16,7 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib @@ -472,7 +472,6 @@ def list_queues( r"""Lists queues. Queues are returned in lexicographical order. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -691,7 +690,6 @@ def create_queue( queue.yaml `__ before using this method. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -821,7 +819,6 @@ def update_queue( queue.yaml `__ before using this method. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -953,7 +950,6 @@ def delete_queue( queue.yaml `__ before using this method. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -1042,7 +1038,6 @@ def purge_queue( effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -1149,7 +1144,6 @@ def pause_queue( paused if its [state][google.cloud.tasks.v2beta2.Queue.state] is [PAUSED][google.cloud.tasks.v2beta2.Queue.State.PAUSED]. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -1263,7 +1257,6 @@ def resume_queue( Scaling Risks `__. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -1371,17 +1364,17 @@ def get_iam_policy( - ``cloudtasks.queues.getIamPolicy`` - .. code-block:: python from google.cloud import tasks_v2beta2 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_get_iam_policy(): # Create a client client = tasks_v2beta2.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2beta2.GetIamPolicyRequest( + request = iam_policy_pb2.GetIamPolicyRequest( resource="resource_value", ) @@ -1412,21 +1405,26 @@ def sample_get_iam_policy(): Returns: google.iam.v1.policy_pb2.Policy: - Defines an Identity and Access Management (IAM) policy. It is used to - specify access control policies for Cloud Platform - resources. + An Identity and Access Management (IAM) policy, which specifies access + controls for Google Cloud resources. A Policy is a collection of bindings. A binding binds - one or more members to a single role. Members can be - user accounts, service accounts, Google groups, and - domains (such as G Suite). A role is a named list of - permissions (defined by IAM or configured by users). - A binding can optionally specify a condition, which - is a logic expression that further constrains the - role binding based on attributes about the request - and/or target resource. - - **JSON Example** + one or more members, or principals, to a single role. + Principals can be user accounts, service accounts, + Google groups, and domains (such as G Suite). A role + is a named list of permissions; each role can be an + IAM predefined role or a user-created custom role. + + For some types of Google Cloud resources, a binding + can also specify a condition, which is a logical + expression that allows access to a resource only if + the expression evaluates to true. A condition can add + constraints based on attributes of the request, the + resource, or both. To learn which resources support + conditions in their IAM policies, see the [IAM + documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + + **JSON example:** { "bindings": [ @@ -1441,17 +1439,17 @@ def sample_get_iam_policy(): }, { "role": "roles/resourcemanager.organizationViewer", - "members": ["user:eve@example.com"], + "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } - ] + ], "etag": "BwWWja0YfJA=", "version": 3 } - **YAML Example** + **YAML example:** bindings: - members: - user:\ mike@example.com - group:\ admins@example.com - domain:google.com - @@ -1462,11 +1460,12 @@ def sample_get_iam_policy(): condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < - timestamp('2020-10-01T00:00:00.000Z') + timestamp('2020-10-01T00:00:00.000Z') etag: + BwWWja0YfJA= version: 3 For a description of IAM and its features, see the - [IAM developer's - guide](\ https://cloud.google.com/iam/docs). + [IAM + documentation](\ https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -1533,17 +1532,17 @@ def set_iam_policy( - ``cloudtasks.queues.setIamPolicy`` - .. code-block:: python from google.cloud import tasks_v2beta2 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_set_iam_policy(): # Create a client client = tasks_v2beta2.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2beta2.SetIamPolicyRequest( + request = iam_policy_pb2.SetIamPolicyRequest( resource="resource_value", ) @@ -1574,21 +1573,26 @@ def sample_set_iam_policy(): Returns: google.iam.v1.policy_pb2.Policy: - Defines an Identity and Access Management (IAM) policy. It is used to - specify access control policies for Cloud Platform - resources. + An Identity and Access Management (IAM) policy, which specifies access + controls for Google Cloud resources. A Policy is a collection of bindings. A binding binds - one or more members to a single role. Members can be - user accounts, service accounts, Google groups, and - domains (such as G Suite). A role is a named list of - permissions (defined by IAM or configured by users). - A binding can optionally specify a condition, which - is a logic expression that further constrains the - role binding based on attributes about the request - and/or target resource. - - **JSON Example** + one or more members, or principals, to a single role. + Principals can be user accounts, service accounts, + Google groups, and domains (such as G Suite). A role + is a named list of permissions; each role can be an + IAM predefined role or a user-created custom role. + + For some types of Google Cloud resources, a binding + can also specify a condition, which is a logical + expression that allows access to a resource only if + the expression evaluates to true. A condition can add + constraints based on attributes of the request, the + resource, or both. To learn which resources support + conditions in their IAM policies, see the [IAM + documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + + **JSON example:** { "bindings": [ @@ -1603,17 +1607,17 @@ def sample_set_iam_policy(): }, { "role": "roles/resourcemanager.organizationViewer", - "members": ["user:eve@example.com"], + "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } - ] + ], "etag": "BwWWja0YfJA=", "version": 3 } - **YAML Example** + **YAML example:** bindings: - members: - user:\ mike@example.com - group:\ admins@example.com - domain:google.com - @@ -1624,11 +1628,12 @@ def sample_set_iam_policy(): condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < - timestamp('2020-10-01T00:00:00.000Z') + timestamp('2020-10-01T00:00:00.000Z') etag: + BwWWja0YfJA= version: 3 For a description of IAM and its features, see the - [IAM developer's - guide](\ https://cloud.google.com/iam/docs). + [IAM + documentation](\ https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -1692,17 +1697,17 @@ def test_iam_permissions( authorization checking. This operation may "fail open" without warning. - .. code-block:: python from google.cloud import tasks_v2beta2 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_test_iam_permissions(): # Create a client client = tasks_v2beta2.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2beta2.TestIamPermissionsRequest( + request = iam_policy_pb2.TestIamPermissionsRequest( resource="resource_value", permissions=['permissions_value_1', 'permissions_value_2'], ) @@ -1808,7 +1813,6 @@ def list_tasks( The tasks may be returned in any order. The ordering may change at any time. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -2022,7 +2026,6 @@ def create_task( - For [pull queues][google.cloud.tasks.v2beta2.PullTarget], the maximum task size is 1MB. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -2169,7 +2172,6 @@ def delete_task( A task cannot be deleted if it has completed successfully or permanently failed. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -2278,7 +2280,6 @@ def lease_tasks( [max_tasks_dispatched_per_second][google.cloud.tasks.v2beta2.RateLimits.max_tasks_dispatched_per_second] is exceeded. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -2422,7 +2423,6 @@ def acknowledge_task( [GetTask][google.cloud.tasks.v2beta2.CloudTasks.GetTask], or [ListTasks][google.cloud.tasks.v2beta2.CloudTasks.ListTasks]. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -2530,7 +2530,6 @@ def renew_lease( in the task's [schedule_time][google.cloud.tasks.v2beta2.Task.schedule_time]. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -2661,7 +2660,6 @@ def cancel_lease( next caller of [LeaseTasks][google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks]. - .. code-block:: python from google.cloud import tasks_v2beta2 @@ -2804,7 +2802,6 @@ def run_task( be called on a [pull task][google.cloud.tasks.v2beta2.PullMessage]. - .. code-block:: python from google.cloud import tasks_v2beta2 diff --git a/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/base.py b/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/base.py index 8c1904e4..f1303f9a 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/base.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/base.py @@ -87,6 +87,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -488,5 +489,9 @@ def run_task( ) -> Callable[[cloudtasks.RunTaskRequest], Union[task.Task, Awaitable[task.Task]]]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("CloudTasksTransport",) 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 e754b001..315b98e4 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/grpc.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/grpc.py @@ -932,5 +932,9 @@ def run_task(self) -> Callable[[cloudtasks.RunTaskRequest], task.Task]: def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("CloudTasksGrpcTransport",) diff --git a/google/cloud/tasks_v2beta2/types/target.py b/google/cloud/tasks_v2beta2/types/target.py index 2b6f704a..998aa254 100644 --- a/google/cloud/tasks_v2beta2/types/target.py +++ b/google/cloud/tasks_v2beta2/types/target.py @@ -224,7 +224,7 @@ class AppEngineHttpRequest(proto.Message): is empty, then the root path "/" will be used. No spaces are allowed, and the maximum length allowed is 2083 characters. - headers (Sequence[google.cloud.tasks_v2beta2.types.AppEngineHttpRequest.HeadersEntry]): + headers (Mapping[str, str]): HTTP request headers. This map contains the header field names and values. Headers 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 e5dd34a0..909d16f9 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, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core.client_options import ClientOptions @@ -222,7 +222,6 @@ async def list_queues( r"""Lists queues. Queues are returned in lexicographical order. - .. code-block:: python from google.cloud import tasks_v2beta3 @@ -461,7 +460,6 @@ async def create_queue( queue.yaml `__ before using this method. - .. code-block:: python from google.cloud import tasks_v2beta3 @@ -591,7 +589,6 @@ async def update_queue( queue.yaml `__ before using this method. - .. code-block:: python from google.cloud import tasks_v2beta3 @@ -723,7 +720,6 @@ async def delete_queue( queue.yaml `__ before using this method. - .. code-block:: python from google.cloud import tasks_v2beta3 @@ -822,7 +818,6 @@ async def purge_queue( effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible. - .. code-block:: python from google.cloud import tasks_v2beta3 @@ -929,7 +924,6 @@ 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:: python from google.cloud import tasks_v2beta3 @@ -1043,7 +1037,6 @@ async def resume_queue( Scaling Risks `__. - .. code-block:: python from google.cloud import tasks_v2beta3 @@ -1151,17 +1144,17 @@ async def get_iam_policy( - ``cloudtasks.queues.getIamPolicy`` - .. code-block:: python from google.cloud import tasks_v2beta3 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_get_iam_policy(): # Create a client client = tasks_v2beta3.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2beta3.GetIamPolicyRequest( + request = iam_policy_pb2.GetIamPolicyRequest( resource="resource_value", ) @@ -1192,21 +1185,26 @@ def sample_get_iam_policy(): Returns: google.iam.v1.policy_pb2.Policy: - Defines an Identity and Access Management (IAM) policy. It is used to - specify access control policies for Cloud Platform - resources. + An Identity and Access Management (IAM) policy, which specifies access + controls for Google Cloud resources. A Policy is a collection of bindings. A binding binds - one or more members to a single role. Members can be - user accounts, service accounts, Google groups, and - domains (such as G Suite). A role is a named list of - permissions (defined by IAM or configured by users). - A binding can optionally specify a condition, which - is a logic expression that further constrains the - role binding based on attributes about the request - and/or target resource. - - **JSON Example** + one or more members, or principals, to a single role. + Principals can be user accounts, service accounts, + Google groups, and domains (such as G Suite). A role + is a named list of permissions; each role can be an + IAM predefined role or a user-created custom role. + + For some types of Google Cloud resources, a binding + can also specify a condition, which is a logical + expression that allows access to a resource only if + the expression evaluates to true. A condition can add + constraints based on attributes of the request, the + resource, or both. To learn which resources support + conditions in their IAM policies, see the [IAM + documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + + **JSON example:** { "bindings": [ @@ -1221,17 +1219,17 @@ def sample_get_iam_policy(): }, { "role": "roles/resourcemanager.organizationViewer", - "members": ["user:eve@example.com"], + "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } - ] + ], "etag": "BwWWja0YfJA=", "version": 3 } - **YAML Example** + **YAML example:** bindings: - members: - user:\ mike@example.com - group:\ admins@example.com - domain:google.com - @@ -1242,11 +1240,12 @@ def sample_get_iam_policy(): condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < - timestamp('2020-10-01T00:00:00.000Z') + timestamp('2020-10-01T00:00:00.000Z') etag: + BwWWja0YfJA= version: 3 For a description of IAM and its features, see the - [IAM developer's - guide](\ https://cloud.google.com/iam/docs). + [IAM + documentation](\ https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -1326,17 +1325,17 @@ async def set_iam_policy( - ``cloudtasks.queues.setIamPolicy`` - .. code-block:: python from google.cloud import tasks_v2beta3 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_set_iam_policy(): # Create a client client = tasks_v2beta3.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2beta3.SetIamPolicyRequest( + request = iam_policy_pb2.SetIamPolicyRequest( resource="resource_value", ) @@ -1367,21 +1366,26 @@ def sample_set_iam_policy(): Returns: google.iam.v1.policy_pb2.Policy: - Defines an Identity and Access Management (IAM) policy. It is used to - specify access control policies for Cloud Platform - resources. + An Identity and Access Management (IAM) policy, which specifies access + controls for Google Cloud resources. A Policy is a collection of bindings. A binding binds - one or more members to a single role. Members can be - user accounts, service accounts, Google groups, and - domains (such as G Suite). A role is a named list of - permissions (defined by IAM or configured by users). - A binding can optionally specify a condition, which - is a logic expression that further constrains the - role binding based on attributes about the request - and/or target resource. - - **JSON Example** + one or more members, or principals, to a single role. + Principals can be user accounts, service accounts, + Google groups, and domains (such as G Suite). A role + is a named list of permissions; each role can be an + IAM predefined role or a user-created custom role. + + For some types of Google Cloud resources, a binding + can also specify a condition, which is a logical + expression that allows access to a resource only if + the expression evaluates to true. A condition can add + constraints based on attributes of the request, the + resource, or both. To learn which resources support + conditions in their IAM policies, see the [IAM + documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + + **JSON example:** { "bindings": [ @@ -1396,17 +1400,17 @@ def sample_set_iam_policy(): }, { "role": "roles/resourcemanager.organizationViewer", - "members": ["user:eve@example.com"], + "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } - ] + ], "etag": "BwWWja0YfJA=", "version": 3 } - **YAML Example** + **YAML example:** bindings: - members: - user:\ mike@example.com - group:\ admins@example.com - domain:google.com - @@ -1417,11 +1421,12 @@ def sample_set_iam_policy(): condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < - timestamp('2020-10-01T00:00:00.000Z') + timestamp('2020-10-01T00:00:00.000Z') etag: + BwWWja0YfJA= version: 3 For a description of IAM and its features, see the - [IAM developer's - guide](\ https://cloud.google.com/iam/docs). + [IAM + documentation](\ https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -1488,17 +1493,17 @@ async def test_iam_permissions( authorization checking. This operation may "fail open" without warning. - .. code-block:: python from google.cloud import tasks_v2beta3 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_test_iam_permissions(): # Create a client client = tasks_v2beta3.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2beta3.TestIamPermissionsRequest( + request = iam_policy_pb2.TestIamPermissionsRequest( resource="resource_value", permissions=['permissions_value_1', 'permissions_value_2'], ) @@ -1616,7 +1621,6 @@ async def list_tasks( The tasks may be returned in any order. The ordering may change at any time. - .. code-block:: python from google.cloud import tasks_v2beta3 @@ -1846,7 +1850,6 @@ async def create_task( - The maximum task size is 100KB. - .. code-block:: python from google.cloud import tasks_v2beta3 @@ -1993,7 +1996,6 @@ async def delete_task( A task cannot be deleted if it has executed successfully or permanently failed. - .. code-block:: python from google.cloud import tasks_v2beta3 @@ -2115,7 +2117,6 @@ 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:: python from google.cloud import tasks_v2beta3 diff --git a/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py b/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py index 34e62762..96c75e34 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py @@ -16,7 +16,7 @@ from collections import OrderedDict import os import re -from typing import Dict, Optional, Sequence, Tuple, Type, Union +from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union import pkg_resources from google.api_core import client_options as client_options_lib @@ -472,7 +472,6 @@ def list_queues( r"""Lists queues. Queues are returned in lexicographical order. - .. code-block:: python from google.cloud import tasks_v2beta3 @@ -691,7 +690,6 @@ def create_queue( queue.yaml `__ before using this method. - .. code-block:: python from google.cloud import tasks_v2beta3 @@ -821,7 +819,6 @@ def update_queue( queue.yaml `__ before using this method. - .. code-block:: python from google.cloud import tasks_v2beta3 @@ -953,7 +950,6 @@ def delete_queue( queue.yaml `__ before using this method. - .. code-block:: python from google.cloud import tasks_v2beta3 @@ -1042,7 +1038,6 @@ def purge_queue( effect. Tasks might be dispatched before the purge takes effect. A purge is irreversible. - .. code-block:: python from google.cloud import tasks_v2beta3 @@ -1149,7 +1144,6 @@ def pause_queue( paused if its [state][google.cloud.tasks.v2beta3.Queue.state] is [PAUSED][google.cloud.tasks.v2beta3.Queue.State.PAUSED]. - .. code-block:: python from google.cloud import tasks_v2beta3 @@ -1263,7 +1257,6 @@ def resume_queue( Scaling Risks `__. - .. code-block:: python from google.cloud import tasks_v2beta3 @@ -1371,17 +1364,17 @@ def get_iam_policy( - ``cloudtasks.queues.getIamPolicy`` - .. code-block:: python from google.cloud import tasks_v2beta3 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_get_iam_policy(): # Create a client client = tasks_v2beta3.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2beta3.GetIamPolicyRequest( + request = iam_policy_pb2.GetIamPolicyRequest( resource="resource_value", ) @@ -1412,21 +1405,26 @@ def sample_get_iam_policy(): Returns: google.iam.v1.policy_pb2.Policy: - Defines an Identity and Access Management (IAM) policy. It is used to - specify access control policies for Cloud Platform - resources. + An Identity and Access Management (IAM) policy, which specifies access + controls for Google Cloud resources. A Policy is a collection of bindings. A binding binds - one or more members to a single role. Members can be - user accounts, service accounts, Google groups, and - domains (such as G Suite). A role is a named list of - permissions (defined by IAM or configured by users). - A binding can optionally specify a condition, which - is a logic expression that further constrains the - role binding based on attributes about the request - and/or target resource. - - **JSON Example** + one or more members, or principals, to a single role. + Principals can be user accounts, service accounts, + Google groups, and domains (such as G Suite). A role + is a named list of permissions; each role can be an + IAM predefined role or a user-created custom role. + + For some types of Google Cloud resources, a binding + can also specify a condition, which is a logical + expression that allows access to a resource only if + the expression evaluates to true. A condition can add + constraints based on attributes of the request, the + resource, or both. To learn which resources support + conditions in their IAM policies, see the [IAM + documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + + **JSON example:** { "bindings": [ @@ -1441,17 +1439,17 @@ def sample_get_iam_policy(): }, { "role": "roles/resourcemanager.organizationViewer", - "members": ["user:eve@example.com"], + "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } - ] + ], "etag": "BwWWja0YfJA=", "version": 3 } - **YAML Example** + **YAML example:** bindings: - members: - user:\ mike@example.com - group:\ admins@example.com - domain:google.com - @@ -1462,11 +1460,12 @@ def sample_get_iam_policy(): condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < - timestamp('2020-10-01T00:00:00.000Z') + timestamp('2020-10-01T00:00:00.000Z') etag: + BwWWja0YfJA= version: 3 For a description of IAM and its features, see the - [IAM developer's - guide](\ https://cloud.google.com/iam/docs). + [IAM + documentation](\ https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -1533,17 +1532,17 @@ def set_iam_policy( - ``cloudtasks.queues.setIamPolicy`` - .. code-block:: python from google.cloud import tasks_v2beta3 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_set_iam_policy(): # Create a client client = tasks_v2beta3.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2beta3.SetIamPolicyRequest( + request = iam_policy_pb2.SetIamPolicyRequest( resource="resource_value", ) @@ -1574,21 +1573,26 @@ def sample_set_iam_policy(): Returns: google.iam.v1.policy_pb2.Policy: - Defines an Identity and Access Management (IAM) policy. It is used to - specify access control policies for Cloud Platform - resources. + An Identity and Access Management (IAM) policy, which specifies access + controls for Google Cloud resources. A Policy is a collection of bindings. A binding binds - one or more members to a single role. Members can be - user accounts, service accounts, Google groups, and - domains (such as G Suite). A role is a named list of - permissions (defined by IAM or configured by users). - A binding can optionally specify a condition, which - is a logic expression that further constrains the - role binding based on attributes about the request - and/or target resource. - - **JSON Example** + one or more members, or principals, to a single role. + Principals can be user accounts, service accounts, + Google groups, and domains (such as G Suite). A role + is a named list of permissions; each role can be an + IAM predefined role or a user-created custom role. + + For some types of Google Cloud resources, a binding + can also specify a condition, which is a logical + expression that allows access to a resource only if + the expression evaluates to true. A condition can add + constraints based on attributes of the request, the + resource, or both. To learn which resources support + conditions in their IAM policies, see the [IAM + documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies). + + **JSON example:** { "bindings": [ @@ -1603,17 +1607,17 @@ def sample_set_iam_policy(): }, { "role": "roles/resourcemanager.organizationViewer", - "members": ["user:eve@example.com"], + "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } - ] + ], "etag": "BwWWja0YfJA=", "version": 3 } - **YAML Example** + **YAML example:** bindings: - members: - user:\ mike@example.com - group:\ admins@example.com - domain:google.com - @@ -1624,11 +1628,12 @@ def sample_set_iam_policy(): condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < - timestamp('2020-10-01T00:00:00.000Z') + timestamp('2020-10-01T00:00:00.000Z') etag: + BwWWja0YfJA= version: 3 For a description of IAM and its features, see the - [IAM developer's - guide](\ https://cloud.google.com/iam/docs). + [IAM + documentation](\ https://cloud.google.com/iam/docs/). """ # Create or coerce a protobuf request object. @@ -1692,17 +1697,17 @@ def test_iam_permissions( authorization checking. This operation may "fail open" without warning. - .. code-block:: python from google.cloud import tasks_v2beta3 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_test_iam_permissions(): # Create a client client = tasks_v2beta3.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2beta3.TestIamPermissionsRequest( + request = iam_policy_pb2.TestIamPermissionsRequest( resource="resource_value", permissions=['permissions_value_1', 'permissions_value_2'], ) @@ -1808,7 +1813,6 @@ def list_tasks( The tasks may be returned in any order. The ordering may change at any time. - .. code-block:: python from google.cloud import tasks_v2beta3 @@ -2018,7 +2022,6 @@ def create_task( - The maximum task size is 100KB. - .. code-block:: python from google.cloud import tasks_v2beta3 @@ -2165,7 +2168,6 @@ def delete_task( A task cannot be deleted if it has executed successfully or permanently failed. - .. code-block:: python from google.cloud import tasks_v2beta3 @@ -2277,7 +2279,6 @@ 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:: python from google.cloud import tasks_v2beta3 diff --git a/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/base.py b/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/base.py index 39eb8806..08de66d2 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/base.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/base.py @@ -87,6 +87,7 @@ def __init__( always_use_jwt_access (Optional[bool]): Whether self signed JWT should be used for service account credentials. """ + # Save the hostname. Default to port 443 (HTTPS) if none is specified. if ":" not in host: host += ":443" @@ -434,5 +435,9 @@ def run_task( ) -> Callable[[cloudtasks.RunTaskRequest], Union[task.Task, Awaitable[task.Task]]]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("CloudTasksTransport",) 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 9789fc74..925c2696 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/grpc.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/grpc.py @@ -774,5 +774,9 @@ def run_task(self) -> Callable[[cloudtasks.RunTaskRequest], task.Task]: def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("CloudTasksGrpcTransport",) diff --git a/google/cloud/tasks_v2beta3/types/target.py b/google/cloud/tasks_v2beta3/types/target.py index c6b89ab9..e964eb0e 100644 --- a/google/cloud/tasks_v2beta3/types/target.py +++ b/google/cloud/tasks_v2beta3/types/target.py @@ -141,7 +141,7 @@ class HttpRequest(proto.Message): http_method (google.cloud.tasks_v2beta3.types.HttpMethod): The HTTP method to use for the request. The default is POST. - headers (Sequence[google.cloud.tasks_v2beta3.types.HttpRequest.HeadersEntry]): + headers (Mapping[str, str]): HTTP request headers. This map contains the header field names and values. Headers @@ -367,7 +367,7 @@ class AppEngineHttpRequest(proto.Message): is empty, then the root path "/" will be used. No spaces are allowed, and the maximum length allowed is 2083 characters. - headers (Sequence[google.cloud.tasks_v2beta3.types.AppEngineHttpRequest.HeadersEntry]): + headers (Mapping[str, str]): HTTP request headers. This map contains the header field names and values. Headers diff --git a/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_get_iam_policy_async.py b/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_get_iam_policy_async.py index 1306d56f..a84db3d1 100644 --- a/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_get_iam_policy_async.py +++ b/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_get_iam_policy_async.py @@ -25,6 +25,7 @@ # [START cloudtasks_v2_generated_CloudTasks_GetIamPolicy_async] from google.cloud import tasks_v2 +from google.iam.v1 import iam_policy_pb2 # type: ignore async def sample_get_iam_policy(): @@ -32,7 +33,7 @@ async def sample_get_iam_policy(): client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) - request = tasks_v2.GetIamPolicyRequest( + request = iam_policy_pb2.GetIamPolicyRequest( resource="resource_value", ) diff --git a/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_get_iam_policy_sync.py b/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_get_iam_policy_sync.py index 99b5f34f..c49cbd2b 100644 --- a/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_get_iam_policy_sync.py +++ b/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_get_iam_policy_sync.py @@ -25,6 +25,7 @@ # [START cloudtasks_v2_generated_CloudTasks_GetIamPolicy_sync] from google.cloud import tasks_v2 +from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_get_iam_policy(): @@ -32,7 +33,7 @@ def sample_get_iam_policy(): client = tasks_v2.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2.GetIamPolicyRequest( + request = iam_policy_pb2.GetIamPolicyRequest( resource="resource_value", ) diff --git a/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_set_iam_policy_async.py b/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_set_iam_policy_async.py index d6108a83..c52d4875 100644 --- a/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_set_iam_policy_async.py +++ b/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_set_iam_policy_async.py @@ -25,6 +25,7 @@ # [START cloudtasks_v2_generated_CloudTasks_SetIamPolicy_async] from google.cloud import tasks_v2 +from google.iam.v1 import iam_policy_pb2 # type: ignore async def sample_set_iam_policy(): @@ -32,7 +33,7 @@ async def sample_set_iam_policy(): client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) - request = tasks_v2.SetIamPolicyRequest( + request = iam_policy_pb2.SetIamPolicyRequest( resource="resource_value", ) diff --git a/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_set_iam_policy_sync.py b/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_set_iam_policy_sync.py index 5373e5b6..330daba0 100644 --- a/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_set_iam_policy_sync.py +++ b/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_set_iam_policy_sync.py @@ -25,6 +25,7 @@ # [START cloudtasks_v2_generated_CloudTasks_SetIamPolicy_sync] from google.cloud import tasks_v2 +from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_set_iam_policy(): @@ -32,7 +33,7 @@ def sample_set_iam_policy(): client = tasks_v2.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2.SetIamPolicyRequest( + request = iam_policy_pb2.SetIamPolicyRequest( resource="resource_value", ) diff --git a/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_test_iam_permissions_async.py b/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_test_iam_permissions_async.py index 1f273ebb..8409351e 100644 --- a/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_test_iam_permissions_async.py +++ b/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_test_iam_permissions_async.py @@ -25,6 +25,7 @@ # [START cloudtasks_v2_generated_CloudTasks_TestIamPermissions_async] from google.cloud import tasks_v2 +from google.iam.v1 import iam_policy_pb2 # type: ignore async def sample_test_iam_permissions(): @@ -32,7 +33,7 @@ async def sample_test_iam_permissions(): client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) - request = tasks_v2.TestIamPermissionsRequest( + request = iam_policy_pb2.TestIamPermissionsRequest( resource="resource_value", permissions=['permissions_value_1', 'permissions_value_2'], ) diff --git a/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_test_iam_permissions_sync.py b/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_test_iam_permissions_sync.py index 099c4f92..fcc97338 100644 --- a/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_test_iam_permissions_sync.py +++ b/samples/generated_samples/cloudtasks_v2_generated_cloud_tasks_test_iam_permissions_sync.py @@ -25,6 +25,7 @@ # [START cloudtasks_v2_generated_CloudTasks_TestIamPermissions_sync] from google.cloud import tasks_v2 +from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_test_iam_permissions(): @@ -32,7 +33,7 @@ def sample_test_iam_permissions(): client = tasks_v2.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2.TestIamPermissionsRequest( + request = iam_policy_pb2.TestIamPermissionsRequest( resource="resource_value", permissions=['permissions_value_1', 'permissions_value_2'], ) diff --git a/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_get_iam_policy_async.py b/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_get_iam_policy_async.py index 6a384194..5ae916f5 100644 --- a/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_get_iam_policy_async.py +++ b/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_get_iam_policy_async.py @@ -25,6 +25,7 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_GetIamPolicy_async] from google.cloud import tasks_v2beta2 +from google.iam.v1 import iam_policy_pb2 # type: ignore async def sample_get_iam_policy(): @@ -32,7 +33,7 @@ async def sample_get_iam_policy(): client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) - request = tasks_v2beta2.GetIamPolicyRequest( + request = iam_policy_pb2.GetIamPolicyRequest( resource="resource_value", ) diff --git a/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_get_iam_policy_sync.py b/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_get_iam_policy_sync.py index 1524945b..62830712 100644 --- a/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_get_iam_policy_sync.py +++ b/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_get_iam_policy_sync.py @@ -25,6 +25,7 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_GetIamPolicy_sync] from google.cloud import tasks_v2beta2 +from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_get_iam_policy(): @@ -32,7 +33,7 @@ def sample_get_iam_policy(): client = tasks_v2beta2.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2beta2.GetIamPolicyRequest( + request = iam_policy_pb2.GetIamPolicyRequest( resource="resource_value", ) diff --git a/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_set_iam_policy_async.py b/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_set_iam_policy_async.py index d803ce86..e34d6d29 100644 --- a/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_set_iam_policy_async.py +++ b/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_set_iam_policy_async.py @@ -25,6 +25,7 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_SetIamPolicy_async] from google.cloud import tasks_v2beta2 +from google.iam.v1 import iam_policy_pb2 # type: ignore async def sample_set_iam_policy(): @@ -32,7 +33,7 @@ async def sample_set_iam_policy(): client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) - request = tasks_v2beta2.SetIamPolicyRequest( + request = iam_policy_pb2.SetIamPolicyRequest( resource="resource_value", ) diff --git a/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_set_iam_policy_sync.py b/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_set_iam_policy_sync.py index e8005a23..e29f43e7 100644 --- a/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_set_iam_policy_sync.py +++ b/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_set_iam_policy_sync.py @@ -25,6 +25,7 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_SetIamPolicy_sync] from google.cloud import tasks_v2beta2 +from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_set_iam_policy(): @@ -32,7 +33,7 @@ def sample_set_iam_policy(): client = tasks_v2beta2.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2beta2.SetIamPolicyRequest( + request = iam_policy_pb2.SetIamPolicyRequest( resource="resource_value", ) diff --git a/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_test_iam_permissions_async.py b/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_test_iam_permissions_async.py index 73eb0ff1..45e195d9 100644 --- a/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_test_iam_permissions_async.py +++ b/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_test_iam_permissions_async.py @@ -25,6 +25,7 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_TestIamPermissions_async] from google.cloud import tasks_v2beta2 +from google.iam.v1 import iam_policy_pb2 # type: ignore async def sample_test_iam_permissions(): @@ -32,7 +33,7 @@ async def sample_test_iam_permissions(): client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) - request = tasks_v2beta2.TestIamPermissionsRequest( + request = iam_policy_pb2.TestIamPermissionsRequest( resource="resource_value", permissions=['permissions_value_1', 'permissions_value_2'], ) diff --git a/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_test_iam_permissions_sync.py b/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_test_iam_permissions_sync.py index 0661f4e2..7190f75d 100644 --- a/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_test_iam_permissions_sync.py +++ b/samples/generated_samples/cloudtasks_v2beta2_generated_cloud_tasks_test_iam_permissions_sync.py @@ -25,6 +25,7 @@ # [START cloudtasks_v2beta2_generated_CloudTasks_TestIamPermissions_sync] from google.cloud import tasks_v2beta2 +from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_test_iam_permissions(): @@ -32,7 +33,7 @@ def sample_test_iam_permissions(): client = tasks_v2beta2.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2beta2.TestIamPermissionsRequest( + request = iam_policy_pb2.TestIamPermissionsRequest( resource="resource_value", permissions=['permissions_value_1', 'permissions_value_2'], ) diff --git a/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_get_iam_policy_async.py b/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_get_iam_policy_async.py index d435519e..db9eac0c 100644 --- a/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_get_iam_policy_async.py +++ b/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_get_iam_policy_async.py @@ -25,6 +25,7 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_GetIamPolicy_async] from google.cloud import tasks_v2beta3 +from google.iam.v1 import iam_policy_pb2 # type: ignore async def sample_get_iam_policy(): @@ -32,7 +33,7 @@ async def sample_get_iam_policy(): client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) - request = tasks_v2beta3.GetIamPolicyRequest( + request = iam_policy_pb2.GetIamPolicyRequest( resource="resource_value", ) diff --git a/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_get_iam_policy_sync.py b/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_get_iam_policy_sync.py index f4e7df71..d968e9e7 100644 --- a/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_get_iam_policy_sync.py +++ b/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_get_iam_policy_sync.py @@ -25,6 +25,7 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_GetIamPolicy_sync] from google.cloud import tasks_v2beta3 +from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_get_iam_policy(): @@ -32,7 +33,7 @@ def sample_get_iam_policy(): client = tasks_v2beta3.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2beta3.GetIamPolicyRequest( + request = iam_policy_pb2.GetIamPolicyRequest( resource="resource_value", ) diff --git a/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_set_iam_policy_async.py b/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_set_iam_policy_async.py index 5ce31320..823611fe 100644 --- a/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_set_iam_policy_async.py +++ b/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_set_iam_policy_async.py @@ -25,6 +25,7 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_SetIamPolicy_async] from google.cloud import tasks_v2beta3 +from google.iam.v1 import iam_policy_pb2 # type: ignore async def sample_set_iam_policy(): @@ -32,7 +33,7 @@ async def sample_set_iam_policy(): client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) - request = tasks_v2beta3.SetIamPolicyRequest( + request = iam_policy_pb2.SetIamPolicyRequest( resource="resource_value", ) diff --git a/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_set_iam_policy_sync.py b/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_set_iam_policy_sync.py index 5c1fccd2..606c9ef5 100644 --- a/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_set_iam_policy_sync.py +++ b/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_set_iam_policy_sync.py @@ -25,6 +25,7 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_SetIamPolicy_sync] from google.cloud import tasks_v2beta3 +from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_set_iam_policy(): @@ -32,7 +33,7 @@ def sample_set_iam_policy(): client = tasks_v2beta3.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2beta3.SetIamPolicyRequest( + request = iam_policy_pb2.SetIamPolicyRequest( resource="resource_value", ) diff --git a/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_test_iam_permissions_async.py b/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_test_iam_permissions_async.py index ec24330c..b75d922e 100644 --- a/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_test_iam_permissions_async.py +++ b/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_test_iam_permissions_async.py @@ -25,6 +25,7 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_TestIamPermissions_async] from google.cloud import tasks_v2beta3 +from google.iam.v1 import iam_policy_pb2 # type: ignore async def sample_test_iam_permissions(): @@ -32,7 +33,7 @@ async def sample_test_iam_permissions(): client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) - request = tasks_v2beta3.TestIamPermissionsRequest( + request = iam_policy_pb2.TestIamPermissionsRequest( resource="resource_value", permissions=['permissions_value_1', 'permissions_value_2'], ) diff --git a/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_test_iam_permissions_sync.py b/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_test_iam_permissions_sync.py index c56bce7c..a6858325 100644 --- a/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_test_iam_permissions_sync.py +++ b/samples/generated_samples/cloudtasks_v2beta3_generated_cloud_tasks_test_iam_permissions_sync.py @@ -25,6 +25,7 @@ # [START cloudtasks_v2beta3_generated_CloudTasks_TestIamPermissions_sync] from google.cloud import tasks_v2beta3 +from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_test_iam_permissions(): @@ -32,7 +33,7 @@ def sample_test_iam_permissions(): client = tasks_v2beta3.CloudTasksClient() # Initialize request argument(s) - request = tasks_v2beta3.TestIamPermissionsRequest( + request = iam_policy_pb2.TestIamPermissionsRequest( resource="resource_value", permissions=['permissions_value_1', 'permissions_value_2'], ) diff --git a/samples/generated_samples/snippet_metadata_tasks_v2.json b/samples/generated_samples/snippet_metadata_tasks_v2.json index 28db6c6f..e18f50b8 100644 --- a/samples/generated_samples/snippet_metadata_tasks_v2.json +++ b/samples/generated_samples/snippet_metadata_tasks_v2.json @@ -1,16 +1,65 @@ { + "clientLibrary": { + "apis": [ + { + "id": "google.cloud.tasks.v2", + "version": "v2" + } + ], + "language": "PYTHON", + "name": "google-cloud-tasks" + }, "snippets": [ { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient.create_queue", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.CreateQueue", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "CreateQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.CreateQueueRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "queue", + "type": "google.cloud.tasks_v2.types.Queue" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.types.Queue", + "shortName": "create_queue" }, + "description": "Sample for CreateQueue", "file": "cloudtasks_v2_generated_cloud_tasks_create_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_CreateQueue_async", "segments": [ { @@ -43,18 +92,58 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_create_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksClient.create_queue", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.CreateQueue", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "CreateQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.CreateQueueRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "queue", + "type": "google.cloud.tasks_v2.types.Queue" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.types.Queue", + "shortName": "create_queue" }, + "description": "Sample for CreateQueue", "file": "cloudtasks_v2_generated_cloud_tasks_create_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_CreateQueue_sync", "segments": [ { @@ -87,19 +176,59 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_create_queue_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient.create_task", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.CreateTask", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "CreateTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.CreateTaskRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "task", + "type": "google.cloud.tasks_v2.types.Task" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.types.Task", + "shortName": "create_task" }, + "description": "Sample for CreateTask", "file": "cloudtasks_v2_generated_cloud_tasks_create_task_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_CreateTask_async", "segments": [ { @@ -132,18 +261,58 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_create_task_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksClient.create_task", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.CreateTask", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "CreateTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.CreateTaskRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "task", + "type": "google.cloud.tasks_v2.types.Task" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.types.Task", + "shortName": "create_task" }, + "description": "Sample for CreateTask", "file": "cloudtasks_v2_generated_cloud_tasks_create_task_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_CreateTask_sync", "segments": [ { @@ -176,19 +345,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_create_task_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient.delete_queue", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.DeleteQueue", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "DeleteQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.DeleteQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_queue" }, + "description": "Sample for DeleteQueue", "file": "cloudtasks_v2_generated_cloud_tasks_delete_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_DeleteQueue_async", "segments": [ { @@ -219,18 +423,53 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_delete_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksClient.delete_queue", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.DeleteQueue", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "DeleteQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.DeleteQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_queue" }, + "description": "Sample for DeleteQueue", "file": "cloudtasks_v2_generated_cloud_tasks_delete_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_DeleteQueue_sync", "segments": [ { @@ -261,19 +500,54 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_delete_queue_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient.delete_task", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.DeleteTask", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "DeleteTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.DeleteTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_task" }, + "description": "Sample for DeleteTask", "file": "cloudtasks_v2_generated_cloud_tasks_delete_task_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_DeleteTask_async", "segments": [ { @@ -304,18 +578,53 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_delete_task_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksClient.delete_task", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.DeleteTask", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "DeleteTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.DeleteTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_task" }, + "description": "Sample for DeleteTask", "file": "cloudtasks_v2_generated_cloud_tasks_delete_task_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_DeleteTask_sync", "segments": [ { @@ -346,108 +655,216 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_delete_task_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient.get_iam_policy", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.GetIamPolicy", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "GetIamPolicy" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.GetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "get_iam_policy" }, + "description": "Sample for GetIamPolicy", "file": "cloudtasks_v2_generated_cloud_tasks_get_iam_policy_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_GetIamPolicy_async", "segments": [ { - "end": 44, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 45, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 34, + "start": 32, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 39, + "start": 35, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 42, + "start": 40, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 46, + "start": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_get_iam_policy_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksClient.get_iam_policy", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.GetIamPolicy", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "GetIamPolicy" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.GetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "get_iam_policy" }, + "description": "Sample for GetIamPolicy", "file": "cloudtasks_v2_generated_cloud_tasks_get_iam_policy_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_GetIamPolicy_sync", "segments": [ { - "end": 44, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 45, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 34, + "start": 32, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 39, + "start": 35, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 42, + "start": 40, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 46, + "start": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_get_iam_policy_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient.get_queue", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.GetQueue", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "GetQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.GetQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.types.Queue", + "shortName": "get_queue" }, + "description": "Sample for GetQueue", "file": "cloudtasks_v2_generated_cloud_tasks_get_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_GetQueue_async", "segments": [ { @@ -480,18 +897,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_get_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksClient.get_queue", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.GetQueue", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "GetQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.GetQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.types.Queue", + "shortName": "get_queue" }, + "description": "Sample for GetQueue", "file": "cloudtasks_v2_generated_cloud_tasks_get_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_GetQueue_sync", "segments": [ { @@ -524,19 +977,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_get_queue_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient.get_task", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.GetTask", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "GetTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.GetTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.types.Task", + "shortName": "get_task" }, + "description": "Sample for GetTask", "file": "cloudtasks_v2_generated_cloud_tasks_get_task_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_GetTask_async", "segments": [ { @@ -569,18 +1058,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_get_task_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksClient.get_task", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.GetTask", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "GetTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.GetTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.types.Task", + "shortName": "get_task" }, + "description": "Sample for GetTask", "file": "cloudtasks_v2_generated_cloud_tasks_get_task_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_GetTask_sync", "segments": [ { @@ -613,19 +1138,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_get_task_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient.list_queues", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.ListQueues", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "ListQueues" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.ListQueuesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.services.cloud_tasks.pagers.ListQueuesAsyncPager", + "shortName": "list_queues" }, + "description": "Sample for ListQueues", "file": "cloudtasks_v2_generated_cloud_tasks_list_queues_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_ListQueues_async", "segments": [ { @@ -658,18 +1219,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_list_queues_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksClient.list_queues", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.ListQueues", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "ListQueues" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.ListQueuesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.services.cloud_tasks.pagers.ListQueuesPager", + "shortName": "list_queues" }, + "description": "Sample for ListQueues", "file": "cloudtasks_v2_generated_cloud_tasks_list_queues_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_ListQueues_sync", "segments": [ { @@ -702,19 +1299,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_list_queues_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient.list_tasks", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.ListTasks", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "ListTasks" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.ListTasksRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.services.cloud_tasks.pagers.ListTasksAsyncPager", + "shortName": "list_tasks" }, + "description": "Sample for ListTasks", "file": "cloudtasks_v2_generated_cloud_tasks_list_tasks_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_ListTasks_async", "segments": [ { @@ -747,18 +1380,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_list_tasks_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksClient.list_tasks", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.ListTasks", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "ListTasks" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.ListTasksRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.services.cloud_tasks.pagers.ListTasksPager", + "shortName": "list_tasks" }, + "description": "Sample for ListTasks", "file": "cloudtasks_v2_generated_cloud_tasks_list_tasks_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_ListTasks_sync", "segments": [ { @@ -791,19 +1460,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_list_tasks_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient.pause_queue", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.PauseQueue", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "PauseQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.PauseQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.types.Queue", + "shortName": "pause_queue" }, + "description": "Sample for PauseQueue", "file": "cloudtasks_v2_generated_cloud_tasks_pause_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_PauseQueue_async", "segments": [ { @@ -836,18 +1541,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_pause_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksClient.pause_queue", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.PauseQueue", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "PauseQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.PauseQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.types.Queue", + "shortName": "pause_queue" }, + "description": "Sample for PauseQueue", "file": "cloudtasks_v2_generated_cloud_tasks_pause_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_PauseQueue_sync", "segments": [ { @@ -880,19 +1621,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_pause_queue_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient.purge_queue", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.PurgeQueue", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "PurgeQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.PurgeQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.types.Queue", + "shortName": "purge_queue" }, + "description": "Sample for PurgeQueue", "file": "cloudtasks_v2_generated_cloud_tasks_purge_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_PurgeQueue_async", "segments": [ { @@ -925,18 +1702,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_purge_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksClient.purge_queue", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.PurgeQueue", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "PurgeQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.PurgeQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.types.Queue", + "shortName": "purge_queue" }, + "description": "Sample for PurgeQueue", "file": "cloudtasks_v2_generated_cloud_tasks_purge_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_PurgeQueue_sync", "segments": [ { @@ -969,19 +1782,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_purge_queue_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient.resume_queue", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.ResumeQueue", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "ResumeQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.ResumeQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.types.Queue", + "shortName": "resume_queue" }, + "description": "Sample for ResumeQueue", "file": "cloudtasks_v2_generated_cloud_tasks_resume_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_ResumeQueue_async", "segments": [ { @@ -1014,18 +1863,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_resume_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksClient.resume_queue", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.ResumeQueue", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "ResumeQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.ResumeQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.types.Queue", + "shortName": "resume_queue" }, + "description": "Sample for ResumeQueue", "file": "cloudtasks_v2_generated_cloud_tasks_resume_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_ResumeQueue_sync", "segments": [ { @@ -1058,19 +1943,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_resume_queue_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient.run_task", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.RunTask", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "RunTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.RunTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.types.Task", + "shortName": "run_task" }, + "description": "Sample for RunTask", "file": "cloudtasks_v2_generated_cloud_tasks_run_task_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_RunTask_async", "segments": [ { @@ -1103,18 +2024,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_run_task_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksClient.run_task", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.RunTask", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "RunTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.RunTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.types.Task", + "shortName": "run_task" }, + "description": "Sample for RunTask", "file": "cloudtasks_v2_generated_cloud_tasks_run_task_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_RunTask_sync", "segments": [ { @@ -1147,197 +2104,389 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_run_task_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient.set_iam_policy", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.SetIamPolicy", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "SetIamPolicy" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.SetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "set_iam_policy" }, + "description": "Sample for SetIamPolicy", "file": "cloudtasks_v2_generated_cloud_tasks_set_iam_policy_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_SetIamPolicy_async", "segments": [ { - "end": 44, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 45, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 34, + "start": 32, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 39, + "start": 35, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 42, + "start": 40, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 46, + "start": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_set_iam_policy_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksClient.set_iam_policy", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.SetIamPolicy", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "SetIamPolicy" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.SetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "set_iam_policy" }, + "description": "Sample for SetIamPolicy", "file": "cloudtasks_v2_generated_cloud_tasks_set_iam_policy_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_SetIamPolicy_sync", "segments": [ { - "end": 44, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 45, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 34, + "start": 32, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 39, + "start": 35, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 42, + "start": 40, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 46, + "start": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_set_iam_policy_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient.test_iam_permissions", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.TestIamPermissions", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "TestIamPermissions" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "permissions", + "type": "Sequence[str]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.iam_policy_pb2.TestIamPermissionsResponse", + "shortName": "test_iam_permissions" }, + "description": "Sample for TestIamPermissions", "file": "cloudtasks_v2_generated_cloud_tasks_test_iam_permissions_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_TestIamPermissions_async", "segments": [ { - "end": 45, + "end": 46, "start": 27, "type": "FULL" }, { - "end": 45, + "end": 46, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 34, + "start": 32, "type": "CLIENT_INITIALIZATION" }, { - "end": 39, - "start": 34, + "end": 40, + "start": 35, "type": "REQUEST_INITIALIZATION" }, { - "end": 42, - "start": 40, + "end": 43, + "start": 41, "type": "REQUEST_EXECUTION" }, { - "end": 46, - "start": 43, + "end": 47, + "start": 44, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_test_iam_permissions_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksClient.test_iam_permissions", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.TestIamPermissions", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "TestIamPermissions" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "permissions", + "type": "Sequence[str]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.iam_policy_pb2.TestIamPermissionsResponse", + "shortName": "test_iam_permissions" }, + "description": "Sample for TestIamPermissions", "file": "cloudtasks_v2_generated_cloud_tasks_test_iam_permissions_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_TestIamPermissions_sync", "segments": [ { - "end": 45, + "end": 46, "start": 27, "type": "FULL" }, { - "end": 45, + "end": 46, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 34, + "start": 32, "type": "CLIENT_INITIALIZATION" }, { - "end": 39, - "start": 34, + "end": 40, + "start": 35, "type": "REQUEST_INITIALIZATION" }, { - "end": 42, - "start": 40, + "end": 43, + "start": 41, "type": "REQUEST_EXECUTION" }, { - "end": 46, - "start": 43, + "end": 47, + "start": 44, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_test_iam_permissions_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksAsyncClient.update_queue", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.UpdateQueue", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "UpdateQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.UpdateQueueRequest" + }, + { + "name": "queue", + "type": "google.cloud.tasks_v2.types.Queue" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.types.Queue", + "shortName": "update_queue" }, + "description": "Sample for UpdateQueue", "file": "cloudtasks_v2_generated_cloud_tasks_update_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_UpdateQueue_async", "segments": [ { @@ -1370,18 +2519,58 @@ "start": 41, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_update_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2.CloudTasksClient.update_queue", "method": { + "fullName": "google.cloud.tasks.v2.CloudTasks.UpdateQueue", "service": { + "fullName": "google.cloud.tasks.v2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "UpdateQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2.types.UpdateQueueRequest" + }, + { + "name": "queue", + "type": "google.cloud.tasks_v2.types.Queue" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2.types.Queue", + "shortName": "update_queue" }, + "description": "Sample for UpdateQueue", "file": "cloudtasks_v2_generated_cloud_tasks_update_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2_generated_CloudTasks_UpdateQueue_sync", "segments": [ { @@ -1414,7 +2603,8 @@ "start": 41, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2_generated_cloud_tasks_update_queue_sync.py" } ] } diff --git a/samples/generated_samples/snippet_metadata_tasks_v2beta2.json b/samples/generated_samples/snippet_metadata_tasks_v2beta2.json index 6a9ecff7..d10feda0 100644 --- a/samples/generated_samples/snippet_metadata_tasks_v2beta2.json +++ b/samples/generated_samples/snippet_metadata_tasks_v2beta2.json @@ -1,16 +1,64 @@ { + "clientLibrary": { + "apis": [ + { + "id": "google.cloud.tasks.v2beta2", + "version": "v2beta2" + } + ], + "language": "PYTHON", + "name": "google-cloud-tasks" + }, "snippets": [ { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient.acknowledge_task", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "AcknowledgeTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.AcknowledgeTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "schedule_time", + "type": "google.protobuf.timestamp_pb2.Timestamp" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "acknowledge_task" }, + "description": "Sample for AcknowledgeTask", "file": "cloudtasks_v2beta2_generated_cloud_tasks_acknowledge_task_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_AcknowledgeTask_async", "segments": [ { @@ -41,18 +89,57 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_acknowledge_task_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient.acknowledge_task", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.AcknowledgeTask", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "AcknowledgeTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.AcknowledgeTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "schedule_time", + "type": "google.protobuf.timestamp_pb2.Timestamp" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "acknowledge_task" }, + "description": "Sample for AcknowledgeTask", "file": "cloudtasks_v2beta2_generated_cloud_tasks_acknowledge_task_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_AcknowledgeTask_sync", "segments": [ { @@ -83,19 +170,59 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_acknowledge_task_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient.cancel_lease", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.CancelLease", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "CancelLease" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.CancelLeaseRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "schedule_time", + "type": "google.protobuf.timestamp_pb2.Timestamp" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Task", + "shortName": "cancel_lease" }, + "description": "Sample for CancelLease", "file": "cloudtasks_v2beta2_generated_cloud_tasks_cancel_lease_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_CancelLease_async", "segments": [ { @@ -128,18 +255,58 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_cancel_lease_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient.cancel_lease", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.CancelLease", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "CancelLease" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.CancelLeaseRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "schedule_time", + "type": "google.protobuf.timestamp_pb2.Timestamp" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Task", + "shortName": "cancel_lease" }, + "description": "Sample for CancelLease", "file": "cloudtasks_v2beta2_generated_cloud_tasks_cancel_lease_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_CancelLease_sync", "segments": [ { @@ -172,19 +339,59 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_cancel_lease_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient.create_queue", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.CreateQueue", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "CreateQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.CreateQueueRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "queue", + "type": "google.cloud.tasks_v2beta2.types.Queue" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Queue", + "shortName": "create_queue" }, + "description": "Sample for CreateQueue", "file": "cloudtasks_v2beta2_generated_cloud_tasks_create_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_CreateQueue_async", "segments": [ { @@ -217,18 +424,58 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_create_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient.create_queue", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.CreateQueue", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "CreateQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.CreateQueueRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "queue", + "type": "google.cloud.tasks_v2beta2.types.Queue" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Queue", + "shortName": "create_queue" }, + "description": "Sample for CreateQueue", "file": "cloudtasks_v2beta2_generated_cloud_tasks_create_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_CreateQueue_sync", "segments": [ { @@ -261,19 +508,59 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_create_queue_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient.create_task", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.CreateTask", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "CreateTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.CreateTaskRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "task", + "type": "google.cloud.tasks_v2beta2.types.Task" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Task", + "shortName": "create_task" }, + "description": "Sample for CreateTask", "file": "cloudtasks_v2beta2_generated_cloud_tasks_create_task_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_CreateTask_async", "segments": [ { @@ -306,18 +593,58 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_create_task_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient.create_task", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.CreateTask", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "CreateTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.CreateTaskRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "task", + "type": "google.cloud.tasks_v2beta2.types.Task" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Task", + "shortName": "create_task" }, + "description": "Sample for CreateTask", "file": "cloudtasks_v2beta2_generated_cloud_tasks_create_task_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_CreateTask_sync", "segments": [ { @@ -350,19 +677,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_create_task_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient.delete_queue", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.DeleteQueue", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "DeleteQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.DeleteQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_queue" }, + "description": "Sample for DeleteQueue", "file": "cloudtasks_v2beta2_generated_cloud_tasks_delete_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_DeleteQueue_async", "segments": [ { @@ -393,18 +755,53 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_delete_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient.delete_queue", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.DeleteQueue", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "DeleteQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.DeleteQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_queue" }, + "description": "Sample for DeleteQueue", "file": "cloudtasks_v2beta2_generated_cloud_tasks_delete_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_DeleteQueue_sync", "segments": [ { @@ -435,19 +832,54 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_delete_queue_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient.delete_task", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.DeleteTask", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "DeleteTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.DeleteTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_task" }, + "description": "Sample for DeleteTask", "file": "cloudtasks_v2beta2_generated_cloud_tasks_delete_task_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_DeleteTask_async", "segments": [ { @@ -478,18 +910,53 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_delete_task_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient.delete_task", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.DeleteTask", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "DeleteTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.DeleteTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_task" }, + "description": "Sample for DeleteTask", "file": "cloudtasks_v2beta2_generated_cloud_tasks_delete_task_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_DeleteTask_sync", "segments": [ { @@ -520,108 +987,216 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_delete_task_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient.get_iam_policy", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.GetIamPolicy", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "GetIamPolicy" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.GetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "get_iam_policy" }, + "description": "Sample for GetIamPolicy", "file": "cloudtasks_v2beta2_generated_cloud_tasks_get_iam_policy_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_GetIamPolicy_async", "segments": [ { - "end": 44, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 45, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 34, + "start": 32, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 39, + "start": 35, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 42, + "start": 40, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 46, + "start": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_get_iam_policy_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient.get_iam_policy", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.GetIamPolicy", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "GetIamPolicy" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.GetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "get_iam_policy" }, + "description": "Sample for GetIamPolicy", "file": "cloudtasks_v2beta2_generated_cloud_tasks_get_iam_policy_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_GetIamPolicy_sync", "segments": [ { - "end": 44, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 45, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 34, + "start": 32, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 39, + "start": 35, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 42, + "start": 40, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 46, + "start": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_get_iam_policy_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient.get_queue", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.GetQueue", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "GetQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.GetQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Queue", + "shortName": "get_queue" }, + "description": "Sample for GetQueue", "file": "cloudtasks_v2beta2_generated_cloud_tasks_get_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_GetQueue_async", "segments": [ { @@ -654,18 +1229,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_get_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient.get_queue", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.GetQueue", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "GetQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.GetQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Queue", + "shortName": "get_queue" }, + "description": "Sample for GetQueue", "file": "cloudtasks_v2beta2_generated_cloud_tasks_get_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_GetQueue_sync", "segments": [ { @@ -698,19 +1309,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_get_queue_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient.get_task", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.GetTask", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "GetTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.GetTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Task", + "shortName": "get_task" }, + "description": "Sample for GetTask", "file": "cloudtasks_v2beta2_generated_cloud_tasks_get_task_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_GetTask_async", "segments": [ { @@ -743,18 +1390,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_get_task_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient.get_task", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.GetTask", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "GetTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.GetTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Task", + "shortName": "get_task" }, + "description": "Sample for GetTask", "file": "cloudtasks_v2beta2_generated_cloud_tasks_get_task_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_GetTask_sync", "segments": [ { @@ -787,19 +1470,59 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_get_task_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient.lease_tasks", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "LeaseTasks" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.LeaseTasksRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "lease_duration", + "type": "google.protobuf.duration_pb2.Duration" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.LeaseTasksResponse", + "shortName": "lease_tasks" }, + "description": "Sample for LeaseTasks", "file": "cloudtasks_v2beta2_generated_cloud_tasks_lease_tasks_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_LeaseTasks_async", "segments": [ { @@ -832,18 +1555,58 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_lease_tasks_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient.lease_tasks", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.LeaseTasks", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "LeaseTasks" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.LeaseTasksRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "lease_duration", + "type": "google.protobuf.duration_pb2.Duration" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.LeaseTasksResponse", + "shortName": "lease_tasks" }, + "description": "Sample for LeaseTasks", "file": "cloudtasks_v2beta2_generated_cloud_tasks_lease_tasks_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_LeaseTasks_sync", "segments": [ { @@ -876,19 +1639,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_lease_tasks_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient.list_queues", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.ListQueues", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "ListQueues" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.ListQueuesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.services.cloud_tasks.pagers.ListQueuesAsyncPager", + "shortName": "list_queues" }, + "description": "Sample for ListQueues", "file": "cloudtasks_v2beta2_generated_cloud_tasks_list_queues_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_ListQueues_async", "segments": [ { @@ -921,18 +1720,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_list_queues_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient.list_queues", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.ListQueues", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "ListQueues" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.ListQueuesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.services.cloud_tasks.pagers.ListQueuesPager", + "shortName": "list_queues" }, + "description": "Sample for ListQueues", "file": "cloudtasks_v2beta2_generated_cloud_tasks_list_queues_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_ListQueues_sync", "segments": [ { @@ -965,19 +1800,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_list_queues_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient.list_tasks", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.ListTasks", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "ListTasks" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.ListTasksRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.services.cloud_tasks.pagers.ListTasksAsyncPager", + "shortName": "list_tasks" }, + "description": "Sample for ListTasks", "file": "cloudtasks_v2beta2_generated_cloud_tasks_list_tasks_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_ListTasks_async", "segments": [ { @@ -1010,18 +1881,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_list_tasks_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient.list_tasks", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.ListTasks", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "ListTasks" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.ListTasksRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.services.cloud_tasks.pagers.ListTasksPager", + "shortName": "list_tasks" }, + "description": "Sample for ListTasks", "file": "cloudtasks_v2beta2_generated_cloud_tasks_list_tasks_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_ListTasks_sync", "segments": [ { @@ -1054,19 +1961,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_list_tasks_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient.pause_queue", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.PauseQueue", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "PauseQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.PauseQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Queue", + "shortName": "pause_queue" }, + "description": "Sample for PauseQueue", "file": "cloudtasks_v2beta2_generated_cloud_tasks_pause_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_PauseQueue_async", "segments": [ { @@ -1099,18 +2042,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_pause_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient.pause_queue", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.PauseQueue", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "PauseQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.PauseQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Queue", + "shortName": "pause_queue" }, + "description": "Sample for PauseQueue", "file": "cloudtasks_v2beta2_generated_cloud_tasks_pause_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_PauseQueue_sync", "segments": [ { @@ -1143,19 +2122,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_pause_queue_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient.purge_queue", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "PurgeQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.PurgeQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Queue", + "shortName": "purge_queue" }, + "description": "Sample for PurgeQueue", "file": "cloudtasks_v2beta2_generated_cloud_tasks_purge_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_PurgeQueue_async", "segments": [ { @@ -1188,18 +2203,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_purge_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient.purge_queue", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.PurgeQueue", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "PurgeQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.PurgeQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Queue", + "shortName": "purge_queue" }, + "description": "Sample for PurgeQueue", "file": "cloudtasks_v2beta2_generated_cloud_tasks_purge_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_PurgeQueue_sync", "segments": [ { @@ -1232,19 +2283,63 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_purge_queue_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient.renew_lease", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.RenewLease", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "RenewLease" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.RenewLeaseRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "schedule_time", + "type": "google.protobuf.timestamp_pb2.Timestamp" + }, + { + "name": "lease_duration", + "type": "google.protobuf.duration_pb2.Duration" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Task", + "shortName": "renew_lease" }, + "description": "Sample for RenewLease", "file": "cloudtasks_v2beta2_generated_cloud_tasks_renew_lease_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_RenewLease_async", "segments": [ { @@ -1277,18 +2372,62 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_renew_lease_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient.renew_lease", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.RenewLease", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "RenewLease" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.RenewLeaseRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "schedule_time", + "type": "google.protobuf.timestamp_pb2.Timestamp" + }, + { + "name": "lease_duration", + "type": "google.protobuf.duration_pb2.Duration" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Task", + "shortName": "renew_lease" }, + "description": "Sample for RenewLease", "file": "cloudtasks_v2beta2_generated_cloud_tasks_renew_lease_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_RenewLease_sync", "segments": [ { @@ -1321,19 +2460,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_renew_lease_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient.resume_queue", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "ResumeQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.ResumeQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Queue", + "shortName": "resume_queue" }, + "description": "Sample for ResumeQueue", "file": "cloudtasks_v2beta2_generated_cloud_tasks_resume_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_ResumeQueue_async", "segments": [ { @@ -1366,18 +2541,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_resume_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient.resume_queue", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.ResumeQueue", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "ResumeQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.ResumeQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Queue", + "shortName": "resume_queue" }, + "description": "Sample for ResumeQueue", "file": "cloudtasks_v2beta2_generated_cloud_tasks_resume_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_ResumeQueue_sync", "segments": [ { @@ -1410,19 +2621,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_resume_queue_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient.run_task", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.RunTask", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "RunTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.RunTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Task", + "shortName": "run_task" }, + "description": "Sample for RunTask", "file": "cloudtasks_v2beta2_generated_cloud_tasks_run_task_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_RunTask_async", "segments": [ { @@ -1455,18 +2702,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_run_task_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient.run_task", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.RunTask", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "RunTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.RunTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Task", + "shortName": "run_task" }, + "description": "Sample for RunTask", "file": "cloudtasks_v2beta2_generated_cloud_tasks_run_task_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_RunTask_sync", "segments": [ { @@ -1499,197 +2782,389 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_run_task_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient.set_iam_policy", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.SetIamPolicy", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "SetIamPolicy" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.SetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "set_iam_policy" }, + "description": "Sample for SetIamPolicy", "file": "cloudtasks_v2beta2_generated_cloud_tasks_set_iam_policy_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_SetIamPolicy_async", "segments": [ { - "end": 44, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 45, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 34, + "start": 32, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 39, + "start": 35, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 42, + "start": 40, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 46, + "start": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_set_iam_policy_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient.set_iam_policy", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.SetIamPolicy", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "SetIamPolicy" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.SetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "set_iam_policy" }, + "description": "Sample for SetIamPolicy", "file": "cloudtasks_v2beta2_generated_cloud_tasks_set_iam_policy_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_SetIamPolicy_sync", "segments": [ { - "end": 44, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 45, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 34, + "start": 32, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 39, + "start": 35, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 42, + "start": 40, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 46, + "start": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_set_iam_policy_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient.test_iam_permissions", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.TestIamPermissions", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "TestIamPermissions" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "permissions", + "type": "Sequence[str]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.iam_policy_pb2.TestIamPermissionsResponse", + "shortName": "test_iam_permissions" }, + "description": "Sample for TestIamPermissions", "file": "cloudtasks_v2beta2_generated_cloud_tasks_test_iam_permissions_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_TestIamPermissions_async", "segments": [ { - "end": 45, + "end": 46, "start": 27, "type": "FULL" }, { - "end": 45, + "end": 46, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 34, + "start": 32, "type": "CLIENT_INITIALIZATION" }, { - "end": 39, - "start": 34, + "end": 40, + "start": 35, "type": "REQUEST_INITIALIZATION" }, { - "end": 42, - "start": 40, + "end": 43, + "start": 41, "type": "REQUEST_EXECUTION" }, { - "end": 46, - "start": 43, + "end": 47, + "start": 44, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_test_iam_permissions_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient.test_iam_permissions", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.TestIamPermissions", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "TestIamPermissions" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "permissions", + "type": "Sequence[str]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.iam_policy_pb2.TestIamPermissionsResponse", + "shortName": "test_iam_permissions" }, + "description": "Sample for TestIamPermissions", "file": "cloudtasks_v2beta2_generated_cloud_tasks_test_iam_permissions_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_TestIamPermissions_sync", "segments": [ { - "end": 45, + "end": 46, "start": 27, "type": "FULL" }, { - "end": 45, + "end": 46, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 34, + "start": 32, "type": "CLIENT_INITIALIZATION" }, { - "end": 39, - "start": 34, + "end": 40, + "start": 35, "type": "REQUEST_INITIALIZATION" }, { - "end": 42, - "start": 40, + "end": 43, + "start": 41, "type": "REQUEST_EXECUTION" }, { - "end": 46, - "start": 43, + "end": 47, + "start": 44, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_test_iam_permissions_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksAsyncClient.update_queue", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "UpdateQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.UpdateQueueRequest" + }, + { + "name": "queue", + "type": "google.cloud.tasks_v2beta2.types.Queue" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Queue", + "shortName": "update_queue" }, + "description": "Sample for UpdateQueue", "file": "cloudtasks_v2beta2_generated_cloud_tasks_update_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_UpdateQueue_async", "segments": [ { @@ -1722,18 +3197,58 @@ "start": 41, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_update_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta2.CloudTasksClient.update_queue", "method": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks.UpdateQueue", "service": { + "fullName": "google.cloud.tasks.v2beta2.CloudTasks", "shortName": "CloudTasks" }, "shortName": "UpdateQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta2.types.UpdateQueueRequest" + }, + { + "name": "queue", + "type": "google.cloud.tasks_v2beta2.types.Queue" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta2.types.Queue", + "shortName": "update_queue" }, + "description": "Sample for UpdateQueue", "file": "cloudtasks_v2beta2_generated_cloud_tasks_update_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta2_generated_CloudTasks_UpdateQueue_sync", "segments": [ { @@ -1766,7 +3281,8 @@ "start": 41, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta2_generated_cloud_tasks_update_queue_sync.py" } ] } diff --git a/samples/generated_samples/snippet_metadata_tasks_v2beta3.json b/samples/generated_samples/snippet_metadata_tasks_v2beta3.json index bdf96c42..c84d1a51 100644 --- a/samples/generated_samples/snippet_metadata_tasks_v2beta3.json +++ b/samples/generated_samples/snippet_metadata_tasks_v2beta3.json @@ -1,16 +1,65 @@ { + "clientLibrary": { + "apis": [ + { + "id": "google.cloud.tasks.v2beta3", + "version": "v2beta3" + } + ], + "language": "PYTHON", + "name": "google-cloud-tasks" + }, "snippets": [ { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient.create_queue", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.CreateQueue", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "CreateQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.CreateQueueRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "queue", + "type": "google.cloud.tasks_v2beta3.types.Queue" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.types.Queue", + "shortName": "create_queue" }, + "description": "Sample for CreateQueue", "file": "cloudtasks_v2beta3_generated_cloud_tasks_create_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_CreateQueue_async", "segments": [ { @@ -43,18 +92,58 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_create_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient.create_queue", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.CreateQueue", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "CreateQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.CreateQueueRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "queue", + "type": "google.cloud.tasks_v2beta3.types.Queue" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.types.Queue", + "shortName": "create_queue" }, + "description": "Sample for CreateQueue", "file": "cloudtasks_v2beta3_generated_cloud_tasks_create_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_CreateQueue_sync", "segments": [ { @@ -87,19 +176,59 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_create_queue_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient.create_task", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.CreateTask", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "CreateTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.CreateTaskRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "task", + "type": "google.cloud.tasks_v2beta3.types.Task" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.types.Task", + "shortName": "create_task" }, + "description": "Sample for CreateTask", "file": "cloudtasks_v2beta3_generated_cloud_tasks_create_task_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_CreateTask_async", "segments": [ { @@ -132,18 +261,58 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_create_task_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient.create_task", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.CreateTask", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "CreateTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.CreateTaskRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "task", + "type": "google.cloud.tasks_v2beta3.types.Task" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.types.Task", + "shortName": "create_task" }, + "description": "Sample for CreateTask", "file": "cloudtasks_v2beta3_generated_cloud_tasks_create_task_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_CreateTask_sync", "segments": [ { @@ -176,19 +345,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_create_task_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient.delete_queue", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.DeleteQueue", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "DeleteQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.DeleteQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_queue" }, + "description": "Sample for DeleteQueue", "file": "cloudtasks_v2beta3_generated_cloud_tasks_delete_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_DeleteQueue_async", "segments": [ { @@ -219,18 +423,53 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_delete_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient.delete_queue", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.DeleteQueue", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "DeleteQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.DeleteQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_queue" }, + "description": "Sample for DeleteQueue", "file": "cloudtasks_v2beta3_generated_cloud_tasks_delete_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_DeleteQueue_sync", "segments": [ { @@ -261,19 +500,54 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_delete_queue_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient.delete_task", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.DeleteTask", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "DeleteTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.DeleteTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_task" }, + "description": "Sample for DeleteTask", "file": "cloudtasks_v2beta3_generated_cloud_tasks_delete_task_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_DeleteTask_async", "segments": [ { @@ -304,18 +578,53 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_delete_task_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient.delete_task", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.DeleteTask", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "DeleteTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.DeleteTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "shortName": "delete_task" }, + "description": "Sample for DeleteTask", "file": "cloudtasks_v2beta3_generated_cloud_tasks_delete_task_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_DeleteTask_sync", "segments": [ { @@ -346,108 +655,216 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_delete_task_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient.get_iam_policy", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.GetIamPolicy", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "GetIamPolicy" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.GetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "get_iam_policy" }, + "description": "Sample for GetIamPolicy", "file": "cloudtasks_v2beta3_generated_cloud_tasks_get_iam_policy_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_GetIamPolicy_async", "segments": [ { - "end": 44, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 45, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 34, + "start": 32, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 39, + "start": 35, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 42, + "start": 40, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 46, + "start": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_get_iam_policy_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient.get_iam_policy", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.GetIamPolicy", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "GetIamPolicy" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.GetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "get_iam_policy" }, + "description": "Sample for GetIamPolicy", "file": "cloudtasks_v2beta3_generated_cloud_tasks_get_iam_policy_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_GetIamPolicy_sync", "segments": [ { - "end": 44, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 45, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 34, + "start": 32, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 39, + "start": 35, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 42, + "start": 40, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 46, + "start": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_get_iam_policy_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient.get_queue", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.GetQueue", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "GetQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.GetQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.types.Queue", + "shortName": "get_queue" }, + "description": "Sample for GetQueue", "file": "cloudtasks_v2beta3_generated_cloud_tasks_get_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_GetQueue_async", "segments": [ { @@ -480,18 +897,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_get_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient.get_queue", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.GetQueue", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "GetQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.GetQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.types.Queue", + "shortName": "get_queue" }, + "description": "Sample for GetQueue", "file": "cloudtasks_v2beta3_generated_cloud_tasks_get_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_GetQueue_sync", "segments": [ { @@ -524,19 +977,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_get_queue_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient.get_task", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.GetTask", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "GetTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.GetTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.types.Task", + "shortName": "get_task" }, + "description": "Sample for GetTask", "file": "cloudtasks_v2beta3_generated_cloud_tasks_get_task_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_GetTask_async", "segments": [ { @@ -569,18 +1058,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_get_task_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient.get_task", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.GetTask", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "GetTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.GetTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.types.Task", + "shortName": "get_task" }, + "description": "Sample for GetTask", "file": "cloudtasks_v2beta3_generated_cloud_tasks_get_task_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_GetTask_sync", "segments": [ { @@ -613,19 +1138,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_get_task_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient.list_queues", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.ListQueues", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "ListQueues" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.ListQueuesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.services.cloud_tasks.pagers.ListQueuesAsyncPager", + "shortName": "list_queues" }, + "description": "Sample for ListQueues", "file": "cloudtasks_v2beta3_generated_cloud_tasks_list_queues_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_ListQueues_async", "segments": [ { @@ -658,18 +1219,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_list_queues_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient.list_queues", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.ListQueues", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "ListQueues" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.ListQueuesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.services.cloud_tasks.pagers.ListQueuesPager", + "shortName": "list_queues" }, + "description": "Sample for ListQueues", "file": "cloudtasks_v2beta3_generated_cloud_tasks_list_queues_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_ListQueues_sync", "segments": [ { @@ -702,19 +1299,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_list_queues_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient.list_tasks", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.ListTasks", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "ListTasks" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.ListTasksRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.services.cloud_tasks.pagers.ListTasksAsyncPager", + "shortName": "list_tasks" }, + "description": "Sample for ListTasks", "file": "cloudtasks_v2beta3_generated_cloud_tasks_list_tasks_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_ListTasks_async", "segments": [ { @@ -747,18 +1380,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_list_tasks_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient.list_tasks", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.ListTasks", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "ListTasks" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.ListTasksRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.services.cloud_tasks.pagers.ListTasksPager", + "shortName": "list_tasks" }, + "description": "Sample for ListTasks", "file": "cloudtasks_v2beta3_generated_cloud_tasks_list_tasks_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_ListTasks_sync", "segments": [ { @@ -791,19 +1460,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_list_tasks_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient.pause_queue", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.PauseQueue", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "PauseQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.PauseQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.types.Queue", + "shortName": "pause_queue" }, + "description": "Sample for PauseQueue", "file": "cloudtasks_v2beta3_generated_cloud_tasks_pause_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_PauseQueue_async", "segments": [ { @@ -836,18 +1541,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_pause_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient.pause_queue", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.PauseQueue", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "PauseQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.PauseQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.types.Queue", + "shortName": "pause_queue" }, + "description": "Sample for PauseQueue", "file": "cloudtasks_v2beta3_generated_cloud_tasks_pause_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_PauseQueue_sync", "segments": [ { @@ -880,19 +1621,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_pause_queue_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient.purge_queue", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.PurgeQueue", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "PurgeQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.PurgeQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.types.Queue", + "shortName": "purge_queue" }, + "description": "Sample for PurgeQueue", "file": "cloudtasks_v2beta3_generated_cloud_tasks_purge_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_PurgeQueue_async", "segments": [ { @@ -925,18 +1702,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_purge_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient.purge_queue", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.PurgeQueue", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "PurgeQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.PurgeQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.types.Queue", + "shortName": "purge_queue" }, + "description": "Sample for PurgeQueue", "file": "cloudtasks_v2beta3_generated_cloud_tasks_purge_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_PurgeQueue_sync", "segments": [ { @@ -969,19 +1782,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_purge_queue_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient.resume_queue", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "ResumeQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.ResumeQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.types.Queue", + "shortName": "resume_queue" }, + "description": "Sample for ResumeQueue", "file": "cloudtasks_v2beta3_generated_cloud_tasks_resume_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_ResumeQueue_async", "segments": [ { @@ -1014,18 +1863,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_resume_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient.resume_queue", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.ResumeQueue", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "ResumeQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.ResumeQueueRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.types.Queue", + "shortName": "resume_queue" }, + "description": "Sample for ResumeQueue", "file": "cloudtasks_v2beta3_generated_cloud_tasks_resume_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_ResumeQueue_sync", "segments": [ { @@ -1058,19 +1943,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_resume_queue_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient.run_task", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.RunTask", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "RunTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.RunTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.types.Task", + "shortName": "run_task" }, + "description": "Sample for RunTask", "file": "cloudtasks_v2beta3_generated_cloud_tasks_run_task_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_RunTask_async", "segments": [ { @@ -1103,18 +2024,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_run_task_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient.run_task", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.RunTask", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "RunTask" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.RunTaskRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.types.Task", + "shortName": "run_task" }, + "description": "Sample for RunTask", "file": "cloudtasks_v2beta3_generated_cloud_tasks_run_task_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_RunTask_sync", "segments": [ { @@ -1147,197 +2104,389 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_run_task_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient.set_iam_policy", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.SetIamPolicy", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "SetIamPolicy" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.SetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "set_iam_policy" }, + "description": "Sample for SetIamPolicy", "file": "cloudtasks_v2beta3_generated_cloud_tasks_set_iam_policy_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_SetIamPolicy_async", "segments": [ { - "end": 44, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 45, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 34, + "start": 32, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 39, + "start": 35, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 42, + "start": 40, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 46, + "start": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_set_iam_policy_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient.set_iam_policy", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.SetIamPolicy", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "SetIamPolicy" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.SetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "set_iam_policy" }, + "description": "Sample for SetIamPolicy", "file": "cloudtasks_v2beta3_generated_cloud_tasks_set_iam_policy_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_SetIamPolicy_sync", "segments": [ { - "end": 44, + "end": 45, "start": 27, "type": "FULL" }, { - "end": 44, + "end": 45, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 34, + "start": 32, "type": "CLIENT_INITIALIZATION" }, { - "end": 38, - "start": 34, + "end": 39, + "start": 35, "type": "REQUEST_INITIALIZATION" }, { - "end": 41, - "start": 39, + "end": 42, + "start": 40, "type": "REQUEST_EXECUTION" }, { - "end": 45, - "start": 42, + "end": 46, + "start": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_set_iam_policy_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient.test_iam_permissions", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.TestIamPermissions", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "TestIamPermissions" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "permissions", + "type": "Sequence[str]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.iam_policy_pb2.TestIamPermissionsResponse", + "shortName": "test_iam_permissions" }, + "description": "Sample for TestIamPermissions", "file": "cloudtasks_v2beta3_generated_cloud_tasks_test_iam_permissions_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_TestIamPermissions_async", "segments": [ { - "end": 45, + "end": 46, "start": 27, "type": "FULL" }, { - "end": 45, + "end": 46, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 34, + "start": 32, "type": "CLIENT_INITIALIZATION" }, { - "end": 39, - "start": 34, + "end": 40, + "start": 35, "type": "REQUEST_INITIALIZATION" }, { - "end": 42, - "start": 40, + "end": 43, + "start": 41, "type": "REQUEST_EXECUTION" }, { - "end": 46, - "start": 43, + "end": 47, + "start": 44, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_test_iam_permissions_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient.test_iam_permissions", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.TestIamPermissions", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "TestIamPermissions" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "permissions", + "type": "Sequence[str]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.iam.v1.iam_policy_pb2.TestIamPermissionsResponse", + "shortName": "test_iam_permissions" }, + "description": "Sample for TestIamPermissions", "file": "cloudtasks_v2beta3_generated_cloud_tasks_test_iam_permissions_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_TestIamPermissions_sync", "segments": [ { - "end": 45, + "end": 46, "start": 27, "type": "FULL" }, { - "end": 45, + "end": 46, "start": 27, "type": "SHORT" }, { - "end": 33, - "start": 31, + "end": 34, + "start": 32, "type": "CLIENT_INITIALIZATION" }, { - "end": 39, - "start": 34, + "end": 40, + "start": 35, "type": "REQUEST_INITIALIZATION" }, { - "end": 42, - "start": 40, + "end": 43, + "start": 41, "type": "REQUEST_EXECUTION" }, { - "end": 46, - "start": 43, + "end": 47, + "start": 44, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_test_iam_permissions_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient", + "shortName": "CloudTasksAsyncClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksAsyncClient.update_queue", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "UpdateQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.UpdateQueueRequest" + }, + { + "name": "queue", + "type": "google.cloud.tasks_v2beta3.types.Queue" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.types.Queue", + "shortName": "update_queue" }, + "description": "Sample for UpdateQueue", "file": "cloudtasks_v2beta3_generated_cloud_tasks_update_queue_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_UpdateQueue_async", "segments": [ { @@ -1370,18 +2519,58 @@ "start": 41, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_update_queue_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient", + "shortName": "CloudTasksClient" + }, + "fullName": "google.cloud.tasks_v2beta3.CloudTasksClient.update_queue", "method": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks.UpdateQueue", "service": { + "fullName": "google.cloud.tasks.v2beta3.CloudTasks", "shortName": "CloudTasks" }, "shortName": "UpdateQueue" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.tasks_v2beta3.types.UpdateQueueRequest" + }, + { + "name": "queue", + "type": "google.cloud.tasks_v2beta3.types.Queue" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.tasks_v2beta3.types.Queue", + "shortName": "update_queue" }, + "description": "Sample for UpdateQueue", "file": "cloudtasks_v2beta3_generated_cloud_tasks_update_queue_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudtasks_v2beta3_generated_CloudTasks_UpdateQueue_sync", "segments": [ { @@ -1414,7 +2603,8 @@ "start": 41, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudtasks_v2beta3_generated_cloud_tasks_update_queue_sync.py" } ] } diff --git a/scripts/fixup_tasks_v2_keywords.py b/scripts/fixup_tasks_v2_keywords.py index feccd76d..f5b33f8c 100644 --- a/scripts/fixup_tasks_v2_keywords.py +++ b/scripts/fixup_tasks_v2_keywords.py @@ -52,7 +52,7 @@ class tasksCallTransformer(cst.CSTTransformer): 'purge_queue': ('name', ), 'resume_queue': ('name', ), 'run_task': ('name', 'response_view', ), - 'set_iam_policy': ('resource', 'policy', ), + 'set_iam_policy': ('resource', 'policy', 'update_mask', ), 'test_iam_permissions': ('resource', 'permissions', ), 'update_queue': ('queue', 'update_mask', ), } diff --git a/scripts/fixup_tasks_v2beta2_keywords.py b/scripts/fixup_tasks_v2beta2_keywords.py index 40c04cdf..e13de3c1 100644 --- a/scripts/fixup_tasks_v2beta2_keywords.py +++ b/scripts/fixup_tasks_v2beta2_keywords.py @@ -56,7 +56,7 @@ class tasksCallTransformer(cst.CSTTransformer): 'renew_lease': ('name', 'schedule_time', 'lease_duration', 'response_view', ), 'resume_queue': ('name', ), 'run_task': ('name', 'response_view', ), - 'set_iam_policy': ('resource', 'policy', ), + 'set_iam_policy': ('resource', 'policy', 'update_mask', ), 'test_iam_permissions': ('resource', 'permissions', ), 'update_queue': ('queue', 'update_mask', ), } diff --git a/scripts/fixup_tasks_v2beta3_keywords.py b/scripts/fixup_tasks_v2beta3_keywords.py index 174560db..a7bb30b7 100644 --- a/scripts/fixup_tasks_v2beta3_keywords.py +++ b/scripts/fixup_tasks_v2beta3_keywords.py @@ -52,7 +52,7 @@ class tasksCallTransformer(cst.CSTTransformer): 'purge_queue': ('name', ), 'resume_queue': ('name', ), 'run_task': ('name', 'response_view', ), - 'set_iam_policy': ('resource', 'policy', ), + 'set_iam_policy': ('resource', 'policy', 'update_mask', ), 'test_iam_permissions': ('resource', 'permissions', ), 'update_queue': ('queue', 'update_mask', ), } diff --git a/setup.py b/setup.py index 2a967acc..bc30a604 100644 --- a/setup.py +++ b/setup.py @@ -28,7 +28,7 @@ # Until this issue is closed # https://github.com/googleapis/google-cloud-python/issues/10566 "google-api-core[grpc] >= 1.31.5, <3.0.0dev,!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0", - "grpc-google-iam-v1 >= 0.12.3, < 0.13dev", + "grpc-google-iam-v1 >= 0.12.4, <1.0.0dev", "proto-plus >= 1.15.0", ] diff --git a/testing/constraints-3.6.txt b/testing/constraints-3.6.txt index 3755c967..654ad19f 100644 --- a/testing/constraints-3.6.txt +++ b/testing/constraints-3.6.txt @@ -6,6 +6,6 @@ # e.g., if setup.py has "foo >= 1.14.0, < 2.0.0dev", # Then this file should have foo==1.14.0 google-api-core==1.31.5 -grpc-google-iam-v1==0.12.3 +grpc-google-iam-v1==0.12.4 proto-plus==1.15.0 libcst==0.2.5 diff --git a/tests/unit/gapic/tasks_v2/test_cloud_tasks.py b/tests/unit/gapic/tasks_v2/test_cloud_tasks.py index 499f1c1e..dd7ddfbe 100644 --- a/tests/unit/gapic/tasks_v2/test_cloud_tasks.py +++ b/tests/unit/gapic/tasks_v2/test_cloud_tasks.py @@ -96,24 +96,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - CloudTasksClient, - CloudTasksAsyncClient, + (CloudTasksClient, "grpc"), + (CloudTasksAsyncClient, "grpc_asyncio"), ], ) -def test_cloud_tasks_client_from_service_account_info(client_class): +def test_cloud_tasks_client_from_service_account_info(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: factory.return_value = creds info = {"valid": True} - client = client_class.from_service_account_info(info) + client = client_class.from_service_account_info(info, transport=transport_name) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "cloudtasks.googleapis.com:443" + assert client.transport._host == ("cloudtasks.googleapis.com:443") @pytest.mark.parametrize( @@ -142,27 +142,31 @@ def test_cloud_tasks_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - CloudTasksClient, - CloudTasksAsyncClient, + (CloudTasksClient, "grpc"), + (CloudTasksAsyncClient, "grpc_asyncio"), ], ) -def test_cloud_tasks_client_from_service_account_file(client_class): +def test_cloud_tasks_client_from_service_account_file(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json") + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - client = client_class.from_service_account_json("dummy/file/path.json") + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "cloudtasks.googleapis.com:443" + assert client.transport._host == ("cloudtasks.googleapis.com:443") def test_cloud_tasks_client_get_transport_class(): @@ -998,7 +1002,7 @@ async def test_list_queues_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -1044,7 +1048,9 @@ async def test_list_queues_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_queues(request={})).pages: + async for page_ in ( + await client.list_queues(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3095,6 +3101,7 @@ def test_set_iam_policy_from_dict_foreign(): request={ "resource": "resource_value", "policy": policy_pb2.Policy(version=774), + "update_mask": field_mask_pb2.FieldMask(paths=["paths_value"]), } ) call.assert_called() @@ -3822,7 +3829,7 @@ async def test_list_tasks_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -3868,7 +3875,9 @@ async def test_list_tasks_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_tasks(request={})).pages: + async for page_ in ( + await client.list_tasks(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4924,6 +4933,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = CloudTasksClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = CloudTasksClient( @@ -4981,6 +5003,14 @@ def test_cloud_tasks_base_transport(): with pytest.raises(NotImplementedError): transport.close() + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + def test_cloud_tasks_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -5123,24 +5153,40 @@ def test_cloud_tasks_grpc_transport_client_cert_source_for_mtls(transport_class) ) -def test_cloud_tasks_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_cloud_tasks_host_no_port(transport_name): client = CloudTasksClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="cloudtasks.googleapis.com" ), + transport=transport_name, ) - assert client.transport._host == "cloudtasks.googleapis.com:443" + assert client.transport._host == ("cloudtasks.googleapis.com:443") -def test_cloud_tasks_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_cloud_tasks_host_with_port(transport_name): client = CloudTasksClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="cloudtasks.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "cloudtasks.googleapis.com:8000" + assert client.transport._host == ("cloudtasks.googleapis.com:8000") def test_cloud_tasks_grpc_transport_channel(): diff --git a/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py b/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py index a8706cd3..78371d28 100644 --- a/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py +++ b/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py @@ -96,24 +96,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - CloudTasksClient, - CloudTasksAsyncClient, + (CloudTasksClient, "grpc"), + (CloudTasksAsyncClient, "grpc_asyncio"), ], ) -def test_cloud_tasks_client_from_service_account_info(client_class): +def test_cloud_tasks_client_from_service_account_info(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: factory.return_value = creds info = {"valid": True} - client = client_class.from_service_account_info(info) + client = client_class.from_service_account_info(info, transport=transport_name) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "cloudtasks.googleapis.com:443" + assert client.transport._host == ("cloudtasks.googleapis.com:443") @pytest.mark.parametrize( @@ -142,27 +142,31 @@ def test_cloud_tasks_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - CloudTasksClient, - CloudTasksAsyncClient, + (CloudTasksClient, "grpc"), + (CloudTasksAsyncClient, "grpc_asyncio"), ], ) -def test_cloud_tasks_client_from_service_account_file(client_class): +def test_cloud_tasks_client_from_service_account_file(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json") + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - client = client_class.from_service_account_json("dummy/file/path.json") + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "cloudtasks.googleapis.com:443" + assert client.transport._host == ("cloudtasks.googleapis.com:443") def test_cloud_tasks_client_get_transport_class(): @@ -998,7 +1002,7 @@ async def test_list_queues_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -1044,7 +1048,9 @@ async def test_list_queues_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_queues(request={})).pages: + async for page_ in ( + await client.list_queues(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3125,6 +3131,7 @@ def test_set_iam_policy_from_dict_foreign(): request={ "resource": "resource_value", "policy": policy_pb2.Policy(version=774), + "update_mask": field_mask_pb2.FieldMask(paths=["paths_value"]), } ) call.assert_called() @@ -3852,7 +3859,7 @@ async def test_list_tasks_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -3898,7 +3905,9 @@ async def test_list_tasks_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_tasks(request={})).pages: + async for page_ in ( + await client.list_tasks(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -5896,6 +5905,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = CloudTasksClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = CloudTasksClient( @@ -5957,6 +5979,14 @@ def test_cloud_tasks_base_transport(): with pytest.raises(NotImplementedError): transport.close() + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + def test_cloud_tasks_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -6099,24 +6129,40 @@ def test_cloud_tasks_grpc_transport_client_cert_source_for_mtls(transport_class) ) -def test_cloud_tasks_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_cloud_tasks_host_no_port(transport_name): client = CloudTasksClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="cloudtasks.googleapis.com" ), + transport=transport_name, ) - assert client.transport._host == "cloudtasks.googleapis.com:443" + assert client.transport._host == ("cloudtasks.googleapis.com:443") -def test_cloud_tasks_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_cloud_tasks_host_with_port(transport_name): client = CloudTasksClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="cloudtasks.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "cloudtasks.googleapis.com:8000" + assert client.transport._host == ("cloudtasks.googleapis.com:8000") def test_cloud_tasks_grpc_transport_channel(): diff --git a/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py b/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py index 27bf6b59..a05a7a82 100644 --- a/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py +++ b/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py @@ -96,24 +96,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - CloudTasksClient, - CloudTasksAsyncClient, + (CloudTasksClient, "grpc"), + (CloudTasksAsyncClient, "grpc_asyncio"), ], ) -def test_cloud_tasks_client_from_service_account_info(client_class): +def test_cloud_tasks_client_from_service_account_info(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_info" ) as factory: factory.return_value = creds info = {"valid": True} - client = client_class.from_service_account_info(info) + client = client_class.from_service_account_info(info, transport=transport_name) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "cloudtasks.googleapis.com:443" + assert client.transport._host == ("cloudtasks.googleapis.com:443") @pytest.mark.parametrize( @@ -142,27 +142,31 @@ def test_cloud_tasks_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - CloudTasksClient, - CloudTasksAsyncClient, + (CloudTasksClient, "grpc"), + (CloudTasksAsyncClient, "grpc_asyncio"), ], ) -def test_cloud_tasks_client_from_service_account_file(client_class): +def test_cloud_tasks_client_from_service_account_file(client_class, transport_name): creds = ga_credentials.AnonymousCredentials() with mock.patch.object( service_account.Credentials, "from_service_account_file" ) as factory: factory.return_value = creds - client = client_class.from_service_account_file("dummy/file/path.json") + client = client_class.from_service_account_file( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - client = client_class.from_service_account_json("dummy/file/path.json") + client = client_class.from_service_account_json( + "dummy/file/path.json", transport=transport_name + ) assert client.transport._credentials == creds assert isinstance(client, client_class) - assert client.transport._host == "cloudtasks.googleapis.com:443" + assert client.transport._host == ("cloudtasks.googleapis.com:443") def test_cloud_tasks_client_get_transport_class(): @@ -998,7 +1002,7 @@ async def test_list_queues_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -1044,7 +1048,9 @@ async def test_list_queues_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_queues(request={})).pages: + async for page_ in ( + await client.list_queues(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -3149,6 +3155,7 @@ def test_set_iam_policy_from_dict_foreign(): request={ "resource": "resource_value", "policy": policy_pb2.Policy(version=774), + "update_mask": field_mask_pb2.FieldMask(paths=["paths_value"]), } ) call.assert_called() @@ -3876,7 +3883,7 @@ async def test_list_tasks_async_pager(): ) assert async_pager.next_page_token == "abc" responses = [] - async for response in async_pager: + async for response in async_pager: # pragma: no branch responses.append(response) assert len(responses) == 6 @@ -3922,7 +3929,9 @@ async def test_list_tasks_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_tasks(request={})).pages: + async for page_ in ( + await client.list_tasks(request={}) + ).pages: # pragma: no branch pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @@ -4978,6 +4987,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = CloudTasksClient.get_transport_class(transport_name)( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert transport.kind == transport_name + + def test_transport_grpc_default(): # A client should use the gRPC transport by default. client = CloudTasksClient( @@ -5035,6 +5057,14 @@ def test_cloud_tasks_base_transport(): with pytest.raises(NotImplementedError): transport.close() + # Catch all for all remaining methods and properties + remainder = [ + "kind", + ] + for r in remainder: + with pytest.raises(NotImplementedError): + getattr(transport, r)() + def test_cloud_tasks_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -5177,24 +5207,40 @@ def test_cloud_tasks_grpc_transport_client_cert_source_for_mtls(transport_class) ) -def test_cloud_tasks_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_cloud_tasks_host_no_port(transport_name): client = CloudTasksClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="cloudtasks.googleapis.com" ), + transport=transport_name, ) - assert client.transport._host == "cloudtasks.googleapis.com:443" + assert client.transport._host == ("cloudtasks.googleapis.com:443") -def test_cloud_tasks_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_cloud_tasks_host_with_port(transport_name): client = CloudTasksClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="cloudtasks.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "cloudtasks.googleapis.com:8000" + assert client.transport._host == ("cloudtasks.googleapis.com:8000") def test_cloud_tasks_grpc_transport_channel(): From 4772a2189a77119e9ef726d7acdf096a1ea45e7d Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Wed, 20 Apr 2022 21:11:32 -0400 Subject: [PATCH 12/17] chore(python): add nox session to sort python imports (#254) Source-Link: https://github.com/googleapis/synthtool/commit/1b71c10e20de7ed3f97f692f99a0e3399b67049f Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 +- docs/conf.py | 2 +- google/cloud/tasks/__init__.py | 62 +++++++++-------- google/cloud/tasks_v2/__init__.py | 58 ++++++++-------- .../tasks_v2/services/cloud_tasks/__init__.py | 2 +- .../services/cloud_tasks/async_client.py | 20 +++--- .../tasks_v2/services/cloud_tasks/client.py | 18 ++--- .../tasks_v2/services/cloud_tasks/pagers.py | 8 +-- .../cloud_tasks/transports/__init__.py | 1 - .../services/cloud_tasks/transports/base.py | 10 +-- .../services/cloud_tasks/transports/grpc.py | 15 ++-- .../cloud_tasks/transports/grpc_asyncio.py | 15 ++-- google/cloud/tasks_v2/types/__init__.py | 14 +--- google/cloud/tasks_v2/types/cloudtasks.py | 3 +- google/cloud/tasks_v2/types/queue.py | 5 +- google/cloud/tasks_v2/types/target.py | 1 - google/cloud/tasks_v2/types/task.py | 5 +- google/cloud/tasks_v2beta2/__init__.py | 69 +++++++++---------- .../services/cloud_tasks/__init__.py | 2 +- .../services/cloud_tasks/async_client.py | 20 +++--- .../services/cloud_tasks/client.py | 18 ++--- .../services/cloud_tasks/pagers.py | 8 +-- .../cloud_tasks/transports/__init__.py | 1 - .../services/cloud_tasks/transports/base.py | 10 +-- .../services/cloud_tasks/transports/grpc.py | 15 ++-- .../cloud_tasks/transports/grpc_asyncio.py | 15 ++-- google/cloud/tasks_v2beta2/types/__init__.py | 15 +--- .../cloud/tasks_v2beta2/types/cloudtasks.py | 7 +- google/cloud/tasks_v2beta2/types/queue.py | 5 +- google/cloud/tasks_v2beta2/types/target.py | 1 - google/cloud/tasks_v2beta2/types/task.py | 5 +- google/cloud/tasks_v2beta3/__init__.py | 69 ++++++++++--------- .../services/cloud_tasks/__init__.py | 2 +- .../services/cloud_tasks/async_client.py | 20 +++--- .../services/cloud_tasks/client.py | 18 ++--- .../services/cloud_tasks/pagers.py | 8 +-- .../cloud_tasks/transports/__init__.py | 1 - .../services/cloud_tasks/transports/base.py | 10 +-- .../services/cloud_tasks/transports/grpc.py | 15 ++-- .../cloud_tasks/transports/grpc_asyncio.py | 15 ++-- google/cloud/tasks_v2beta3/types/__init__.py | 15 +--- .../cloud/tasks_v2beta3/types/cloudtasks.py | 3 +- google/cloud/tasks_v2beta3/types/queue.py | 5 +- google/cloud/tasks_v2beta3/types/target.py | 1 - google/cloud/tasks_v2beta3/types/task.py | 5 +- noxfile.py | 28 +++++++- samples/snippets/create_http_task.py | 5 +- samples/snippets/delete_queue_test.py | 1 - samples/snippets/noxfile.py | 23 ++++++- tests/unit/gapic/tasks_v2/test_cloud_tasks.py | 44 ++++++------ .../gapic/tasks_v2beta2/test_cloud_tasks.py | 44 ++++++------ .../gapic/tasks_v2beta3/test_cloud_tasks.py | 44 ++++++------ 52 files changed, 404 insertions(+), 406 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index bc893c97..7c454abf 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:8a5d3f6a2e43ed8293f34e06a2f56931d1e88a2694c3bb11b15df4eb256ad163 -# created: 2022-04-06T10:30:21.687684602Z + digest: sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 +# created: 2022-04-20T23:42:53.970438194Z diff --git a/docs/conf.py b/docs/conf.py index e6a9ea76..cfed6c1d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -24,9 +24,9 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys import os import shlex +import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the diff --git a/google/cloud/tasks/__init__.py b/google/cloud/tasks/__init__.py index 4858a472..e9b8ecc9 100644 --- a/google/cloud/tasks/__init__.py +++ b/google/cloud/tasks/__init__.py @@ -14,38 +14,42 @@ # limitations under the License. # -from google.cloud.tasks_v2.services.cloud_tasks.client import CloudTasksClient from google.cloud.tasks_v2.services.cloud_tasks.async_client import ( CloudTasksAsyncClient, ) - -from google.cloud.tasks_v2.types.cloudtasks import CreateQueueRequest -from google.cloud.tasks_v2.types.cloudtasks import CreateTaskRequest -from google.cloud.tasks_v2.types.cloudtasks import DeleteQueueRequest -from google.cloud.tasks_v2.types.cloudtasks import DeleteTaskRequest -from google.cloud.tasks_v2.types.cloudtasks import GetQueueRequest -from google.cloud.tasks_v2.types.cloudtasks import GetTaskRequest -from google.cloud.tasks_v2.types.cloudtasks import ListQueuesRequest -from google.cloud.tasks_v2.types.cloudtasks import ListQueuesResponse -from google.cloud.tasks_v2.types.cloudtasks import ListTasksRequest -from google.cloud.tasks_v2.types.cloudtasks import ListTasksResponse -from google.cloud.tasks_v2.types.cloudtasks import PauseQueueRequest -from google.cloud.tasks_v2.types.cloudtasks import PurgeQueueRequest -from google.cloud.tasks_v2.types.cloudtasks import ResumeQueueRequest -from google.cloud.tasks_v2.types.cloudtasks import RunTaskRequest -from google.cloud.tasks_v2.types.cloudtasks import UpdateQueueRequest -from google.cloud.tasks_v2.types.queue import Queue -from google.cloud.tasks_v2.types.queue import RateLimits -from google.cloud.tasks_v2.types.queue import RetryConfig -from google.cloud.tasks_v2.types.queue import StackdriverLoggingConfig -from google.cloud.tasks_v2.types.target import AppEngineHttpRequest -from google.cloud.tasks_v2.types.target import AppEngineRouting -from google.cloud.tasks_v2.types.target import HttpRequest -from google.cloud.tasks_v2.types.target import OAuthToken -from google.cloud.tasks_v2.types.target import OidcToken -from google.cloud.tasks_v2.types.target import HttpMethod -from google.cloud.tasks_v2.types.task import Attempt -from google.cloud.tasks_v2.types.task import Task +from google.cloud.tasks_v2.services.cloud_tasks.client import CloudTasksClient +from google.cloud.tasks_v2.types.cloudtasks import ( + CreateQueueRequest, + CreateTaskRequest, + DeleteQueueRequest, + DeleteTaskRequest, + GetQueueRequest, + GetTaskRequest, + ListQueuesRequest, + ListQueuesResponse, + ListTasksRequest, + ListTasksResponse, + PauseQueueRequest, + PurgeQueueRequest, + ResumeQueueRequest, + RunTaskRequest, + UpdateQueueRequest, +) +from google.cloud.tasks_v2.types.queue import ( + Queue, + RateLimits, + RetryConfig, + StackdriverLoggingConfig, +) +from google.cloud.tasks_v2.types.target import ( + AppEngineHttpRequest, + AppEngineRouting, + HttpMethod, + HttpRequest, + OAuthToken, + OidcToken, +) +from google.cloud.tasks_v2.types.task import Attempt, Task __all__ = ( "CloudTasksClient", diff --git a/google/cloud/tasks_v2/__init__.py b/google/cloud/tasks_v2/__init__.py index 4be35c73..f0f89bca 100644 --- a/google/cloud/tasks_v2/__init__.py +++ b/google/cloud/tasks_v2/__init__.py @@ -14,36 +14,34 @@ # limitations under the License. # -from .services.cloud_tasks import CloudTasksClient -from .services.cloud_tasks import CloudTasksAsyncClient - -from .types.cloudtasks import CreateQueueRequest -from .types.cloudtasks import CreateTaskRequest -from .types.cloudtasks import DeleteQueueRequest -from .types.cloudtasks import DeleteTaskRequest -from .types.cloudtasks import GetQueueRequest -from .types.cloudtasks import GetTaskRequest -from .types.cloudtasks import ListQueuesRequest -from .types.cloudtasks import ListQueuesResponse -from .types.cloudtasks import ListTasksRequest -from .types.cloudtasks import ListTasksResponse -from .types.cloudtasks import PauseQueueRequest -from .types.cloudtasks import PurgeQueueRequest -from .types.cloudtasks import ResumeQueueRequest -from .types.cloudtasks import RunTaskRequest -from .types.cloudtasks import UpdateQueueRequest -from .types.queue import Queue -from .types.queue import RateLimits -from .types.queue import RetryConfig -from .types.queue import StackdriverLoggingConfig -from .types.target import AppEngineHttpRequest -from .types.target import AppEngineRouting -from .types.target import HttpRequest -from .types.target import OAuthToken -from .types.target import OidcToken -from .types.target import HttpMethod -from .types.task import Attempt -from .types.task import Task +from .services.cloud_tasks import CloudTasksAsyncClient, CloudTasksClient +from .types.cloudtasks import ( + CreateQueueRequest, + CreateTaskRequest, + DeleteQueueRequest, + DeleteTaskRequest, + GetQueueRequest, + GetTaskRequest, + ListQueuesRequest, + ListQueuesResponse, + ListTasksRequest, + ListTasksResponse, + PauseQueueRequest, + PurgeQueueRequest, + ResumeQueueRequest, + RunTaskRequest, + UpdateQueueRequest, +) +from .types.queue import Queue, RateLimits, RetryConfig, StackdriverLoggingConfig +from .types.target import ( + AppEngineHttpRequest, + AppEngineRouting, + HttpMethod, + HttpRequest, + OAuthToken, + OidcToken, +) +from .types.task import Attempt, Task __all__ = ( "CloudTasksAsyncClient", diff --git a/google/cloud/tasks_v2/services/cloud_tasks/__init__.py b/google/cloud/tasks_v2/services/cloud_tasks/__init__.py index aedb130d..b47f3823 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/__init__.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import CloudTasksClient from .async_client import CloudTasksAsyncClient +from .client import CloudTasksClient __all__ = ( "CloudTasksClient", 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 d6907ec4..4241d209 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/async_client.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/async_client.py @@ -17,20 +17,26 @@ import functools import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.protobuf import duration_pb2 # type: ignore +from google.protobuf import field_mask_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore + from google.cloud.tasks_v2.services.cloud_tasks import pagers from google.cloud.tasks_v2.types import cloudtasks from google.cloud.tasks_v2.types import queue @@ -38,14 +44,10 @@ from google.cloud.tasks_v2.types import target from google.cloud.tasks_v2.types import task from google.cloud.tasks_v2.types import task as gct_task -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.protobuf import duration_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import CloudTasksTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import CloudTasksGrpcAsyncIOTransport + from .client import CloudTasksClient +from .transports.base import DEFAULT_CLIENT_INFO, CloudTasksTransport +from .transports.grpc_asyncio import CloudTasksGrpcAsyncIOTransport class CloudTasksAsyncClient: diff --git a/google/cloud/tasks_v2/services/cloud_tasks/client.py b/google/cloud/tasks_v2/services/cloud_tasks/client.py index 4348f0af..c95ba3aa 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/client.py @@ -17,23 +17,29 @@ import os import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.protobuf import duration_pb2 # type: ignore +from google.protobuf import field_mask_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore + from google.cloud.tasks_v2.services.cloud_tasks import pagers from google.cloud.tasks_v2.types import cloudtasks from google.cloud.tasks_v2.types import queue @@ -41,12 +47,8 @@ from google.cloud.tasks_v2.types import target from google.cloud.tasks_v2.types import task from google.cloud.tasks_v2.types import task as gct_task -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.protobuf import duration_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import CloudTasksTransport, DEFAULT_CLIENT_INFO + +from .transports.base import DEFAULT_CLIENT_INFO, CloudTasksTransport from .transports.grpc import CloudTasksGrpcTransport from .transports.grpc_asyncio import CloudTasksGrpcAsyncIOTransport diff --git a/google/cloud/tasks_v2/services/cloud_tasks/pagers.py b/google/cloud/tasks_v2/services/cloud_tasks/pagers.py index 1dd9d10d..9e59171a 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/pagers.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/pagers.py @@ -18,15 +18,13 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) -from google.cloud.tasks_v2.types import cloudtasks -from google.cloud.tasks_v2.types import queue -from google.cloud.tasks_v2.types import task +from google.cloud.tasks_v2.types import cloudtasks, queue, task class ListQueuesPager: diff --git a/google/cloud/tasks_v2/services/cloud_tasks/transports/__init__.py b/google/cloud/tasks_v2/services/cloud_tasks/transports/__init__.py index ec04b44d..dd95e460 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/transports/__init__.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import CloudTasksGrpcTransport from .grpc_asyncio import CloudTasksGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[CloudTasksTransport]] _transport_registry["grpc"] = CloudTasksGrpcTransport diff --git a/google/cloud/tasks_v2/services/cloud_tasks/transports/base.py b/google/cloud/tasks_v2/services/cloud_tasks/transports/base.py index babc01ee..da4aa8f8 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/transports/base.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/transports/base.py @@ -15,24 +15,24 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore from google.oauth2 import service_account # type: ignore +from google.protobuf import empty_pb2 # type: ignore +import pkg_resources from google.cloud.tasks_v2.types import cloudtasks from google.cloud.tasks_v2.types import queue from google.cloud.tasks_v2.types import queue as gct_queue from google.cloud.tasks_v2.types import task from google.cloud.tasks_v2.types import task as gct_task -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( 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 98414a99..1405298b 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/transports/grpc.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/transports/grpc.py @@ -13,15 +13,16 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from google.cloud.tasks_v2.types import cloudtasks @@ -29,10 +30,8 @@ from google.cloud.tasks_v2.types import queue as gct_queue from google.cloud.tasks_v2.types import task from google.cloud.tasks_v2.types import task as gct_task -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore -from .base import CloudTasksTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, CloudTasksTransport class CloudTasksGrpcTransport(CloudTasksTransport): 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 a90e0e87..4101e3e8 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 @@ -13,14 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async +from google.api_core import gapic_v1, grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore @@ -29,10 +30,8 @@ from google.cloud.tasks_v2.types import queue as gct_queue from google.cloud.tasks_v2.types import task from google.cloud.tasks_v2.types import task as gct_task -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore -from .base import CloudTasksTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, CloudTasksTransport from .grpc import CloudTasksGrpcTransport diff --git a/google/cloud/tasks_v2/types/__init__.py b/google/cloud/tasks_v2/types/__init__.py index 5cd79655..d35c84ef 100644 --- a/google/cloud/tasks_v2/types/__init__.py +++ b/google/cloud/tasks_v2/types/__init__.py @@ -30,24 +30,16 @@ RunTaskRequest, UpdateQueueRequest, ) -from .queue import ( - Queue, - RateLimits, - RetryConfig, - StackdriverLoggingConfig, -) +from .queue import Queue, RateLimits, RetryConfig, StackdriverLoggingConfig from .target import ( AppEngineHttpRequest, AppEngineRouting, + HttpMethod, HttpRequest, OAuthToken, OidcToken, - HttpMethod, -) -from .task import ( - Attempt, - Task, ) +from .task import Attempt, Task __all__ = ( "CreateQueueRequest", diff --git a/google/cloud/tasks_v2/types/cloudtasks.py b/google/cloud/tasks_v2/types/cloudtasks.py index 0b068d4b..f4cf7e0a 100644 --- a/google/cloud/tasks_v2/types/cloudtasks.py +++ b/google/cloud/tasks_v2/types/cloudtasks.py @@ -13,12 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.protobuf import field_mask_pb2 # type: ignore import proto # type: ignore from google.cloud.tasks_v2.types import queue as gct_queue from google.cloud.tasks_v2.types import task as gct_task -from google.protobuf import field_mask_pb2 # type: ignore - __protobuf__ = proto.module( package="google.cloud.tasks.v2", diff --git a/google/cloud/tasks_v2/types/queue.py b/google/cloud/tasks_v2/types/queue.py index 092383e3..89a6d123 100644 --- a/google/cloud/tasks_v2/types/queue.py +++ b/google/cloud/tasks_v2/types/queue.py @@ -13,12 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - -from google.cloud.tasks_v2.types import target from google.protobuf import duration_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore +import proto # type: ignore +from google.cloud.tasks_v2.types import target __protobuf__ = proto.module( package="google.cloud.tasks.v2", diff --git a/google/cloud/tasks_v2/types/target.py b/google/cloud/tasks_v2/types/target.py index 00edf096..129615dc 100644 --- a/google/cloud/tasks_v2/types/target.py +++ b/google/cloud/tasks_v2/types/target.py @@ -15,7 +15,6 @@ # import proto # type: ignore - __protobuf__ = proto.module( package="google.cloud.tasks.v2", manifest={ diff --git a/google/cloud/tasks_v2/types/task.py b/google/cloud/tasks_v2/types/task.py index 69357fd2..09dabb7c 100644 --- a/google/cloud/tasks_v2/types/task.py +++ b/google/cloud/tasks_v2/types/task.py @@ -13,13 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - -from google.cloud.tasks_v2.types import target from google.protobuf import duration_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore from google.rpc import status_pb2 # type: ignore +import proto # type: ignore +from google.cloud.tasks_v2.types import target __protobuf__ = proto.module( package="google.cloud.tasks.v2", diff --git a/google/cloud/tasks_v2beta2/__init__.py b/google/cloud/tasks_v2beta2/__init__.py index c44fd1a6..6ad082cb 100644 --- a/google/cloud/tasks_v2beta2/__init__.py +++ b/google/cloud/tasks_v2beta2/__init__.py @@ -14,42 +14,39 @@ # limitations under the License. # -from .services.cloud_tasks import CloudTasksClient -from .services.cloud_tasks import CloudTasksAsyncClient - -from .types.cloudtasks import AcknowledgeTaskRequest -from .types.cloudtasks import CancelLeaseRequest -from .types.cloudtasks import CreateQueueRequest -from .types.cloudtasks import CreateTaskRequest -from .types.cloudtasks import DeleteQueueRequest -from .types.cloudtasks import DeleteTaskRequest -from .types.cloudtasks import GetQueueRequest -from .types.cloudtasks import GetTaskRequest -from .types.cloudtasks import LeaseTasksRequest -from .types.cloudtasks import LeaseTasksResponse -from .types.cloudtasks import ListQueuesRequest -from .types.cloudtasks import ListQueuesResponse -from .types.cloudtasks import ListTasksRequest -from .types.cloudtasks import ListTasksResponse -from .types.cloudtasks import PauseQueueRequest -from .types.cloudtasks import PurgeQueueRequest -from .types.cloudtasks import RenewLeaseRequest -from .types.cloudtasks import ResumeQueueRequest -from .types.cloudtasks import RunTaskRequest -from .types.cloudtasks import UpdateQueueRequest -from .types.queue import Queue -from .types.queue import QueueStats -from .types.queue import RateLimits -from .types.queue import RetryConfig -from .types.target import AppEngineHttpRequest -from .types.target import AppEngineHttpTarget -from .types.target import AppEngineRouting -from .types.target import PullMessage -from .types.target import PullTarget -from .types.target import HttpMethod -from .types.task import AttemptStatus -from .types.task import Task -from .types.task import TaskStatus +from .services.cloud_tasks import CloudTasksAsyncClient, CloudTasksClient +from .types.cloudtasks import ( + AcknowledgeTaskRequest, + CancelLeaseRequest, + CreateQueueRequest, + CreateTaskRequest, + DeleteQueueRequest, + DeleteTaskRequest, + GetQueueRequest, + GetTaskRequest, + LeaseTasksRequest, + LeaseTasksResponse, + ListQueuesRequest, + ListQueuesResponse, + ListTasksRequest, + ListTasksResponse, + PauseQueueRequest, + PurgeQueueRequest, + RenewLeaseRequest, + ResumeQueueRequest, + RunTaskRequest, + UpdateQueueRequest, +) +from .types.queue import Queue, QueueStats, RateLimits, RetryConfig +from .types.target import ( + AppEngineHttpRequest, + AppEngineHttpTarget, + AppEngineRouting, + HttpMethod, + PullMessage, + PullTarget, +) +from .types.task import AttemptStatus, Task, TaskStatus __all__ = ( "CloudTasksAsyncClient", diff --git a/google/cloud/tasks_v2beta2/services/cloud_tasks/__init__.py b/google/cloud/tasks_v2beta2/services/cloud_tasks/__init__.py index aedb130d..b47f3823 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/__init__.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import CloudTasksClient from .async_client import CloudTasksAsyncClient +from .client import CloudTasksClient __all__ = ( "CloudTasksClient", 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 586edc75..4affe76f 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py @@ -17,20 +17,26 @@ import functools import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.protobuf import duration_pb2 # type: ignore +from google.protobuf import field_mask_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore + from google.cloud.tasks_v2beta2.services.cloud_tasks import pagers from google.cloud.tasks_v2beta2.types import cloudtasks from google.cloud.tasks_v2beta2.types import queue @@ -38,14 +44,10 @@ from google.cloud.tasks_v2beta2.types import target from google.cloud.tasks_v2beta2.types import task from google.cloud.tasks_v2beta2.types import task as gct_task -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.protobuf import duration_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import CloudTasksTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import CloudTasksGrpcAsyncIOTransport + from .client import CloudTasksClient +from .transports.base import DEFAULT_CLIENT_INFO, CloudTasksTransport +from .transports.grpc_asyncio import CloudTasksGrpcAsyncIOTransport class CloudTasksAsyncClient: diff --git a/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py b/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py index c9c71258..5bfe815a 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/client.py @@ -17,23 +17,29 @@ import os import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.protobuf import duration_pb2 # type: ignore +from google.protobuf import field_mask_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore + from google.cloud.tasks_v2beta2.services.cloud_tasks import pagers from google.cloud.tasks_v2beta2.types import cloudtasks from google.cloud.tasks_v2beta2.types import queue @@ -41,12 +47,8 @@ from google.cloud.tasks_v2beta2.types import target from google.cloud.tasks_v2beta2.types import task from google.cloud.tasks_v2beta2.types import task as gct_task -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.protobuf import duration_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import CloudTasksTransport, DEFAULT_CLIENT_INFO + +from .transports.base import DEFAULT_CLIENT_INFO, CloudTasksTransport from .transports.grpc import CloudTasksGrpcTransport from .transports.grpc_asyncio import CloudTasksGrpcAsyncIOTransport diff --git a/google/cloud/tasks_v2beta2/services/cloud_tasks/pagers.py b/google/cloud/tasks_v2beta2/services/cloud_tasks/pagers.py index 54228367..77ea57fc 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/pagers.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/pagers.py @@ -18,15 +18,13 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) -from google.cloud.tasks_v2beta2.types import cloudtasks -from google.cloud.tasks_v2beta2.types import queue -from google.cloud.tasks_v2beta2.types import task +from google.cloud.tasks_v2beta2.types import cloudtasks, queue, task class ListQueuesPager: diff --git a/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/__init__.py b/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/__init__.py index ec04b44d..dd95e460 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/__init__.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import CloudTasksGrpcTransport from .grpc_asyncio import CloudTasksGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[CloudTasksTransport]] _transport_registry["grpc"] = CloudTasksGrpcTransport diff --git a/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/base.py b/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/base.py index f1303f9a..15df103e 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/base.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/base.py @@ -15,24 +15,24 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore from google.oauth2 import service_account # type: ignore +from google.protobuf import empty_pb2 # type: ignore +import pkg_resources from google.cloud.tasks_v2beta2.types import cloudtasks from google.cloud.tasks_v2beta2.types import queue from google.cloud.tasks_v2beta2.types import queue as gct_queue from google.cloud.tasks_v2beta2.types import task from google.cloud.tasks_v2beta2.types import task as gct_task -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( 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 315b98e4..0d65c14a 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/grpc.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/transports/grpc.py @@ -13,15 +13,16 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from google.cloud.tasks_v2beta2.types import cloudtasks @@ -29,10 +30,8 @@ from google.cloud.tasks_v2beta2.types import queue as gct_queue from google.cloud.tasks_v2beta2.types import task from google.cloud.tasks_v2beta2.types import task as gct_task -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore -from .base import CloudTasksTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, CloudTasksTransport class CloudTasksGrpcTransport(CloudTasksTransport): 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 c9f4bee1..30cbc0c3 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 @@ -13,14 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async +from google.api_core import gapic_v1, grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore @@ -29,10 +30,8 @@ from google.cloud.tasks_v2beta2.types import queue as gct_queue from google.cloud.tasks_v2beta2.types import task from google.cloud.tasks_v2beta2.types import task as gct_task -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore -from .base import CloudTasksTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, CloudTasksTransport from .grpc import CloudTasksGrpcTransport diff --git a/google/cloud/tasks_v2beta2/types/__init__.py b/google/cloud/tasks_v2beta2/types/__init__.py index b198074d..1ae3c727 100644 --- a/google/cloud/tasks_v2beta2/types/__init__.py +++ b/google/cloud/tasks_v2beta2/types/__init__.py @@ -35,25 +35,16 @@ RunTaskRequest, UpdateQueueRequest, ) -from .queue import ( - Queue, - QueueStats, - RateLimits, - RetryConfig, -) +from .queue import Queue, QueueStats, RateLimits, RetryConfig from .target import ( AppEngineHttpRequest, AppEngineHttpTarget, AppEngineRouting, + HttpMethod, PullMessage, PullTarget, - HttpMethod, -) -from .task import ( - AttemptStatus, - Task, - TaskStatus, ) +from .task import AttemptStatus, Task, TaskStatus __all__ = ( "AcknowledgeTaskRequest", diff --git a/google/cloud/tasks_v2beta2/types/cloudtasks.py b/google/cloud/tasks_v2beta2/types/cloudtasks.py index 087aa7cc..c10244f7 100644 --- a/google/cloud/tasks_v2beta2/types/cloudtasks.py +++ b/google/cloud/tasks_v2beta2/types/cloudtasks.py @@ -13,14 +13,13 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - -from google.cloud.tasks_v2beta2.types import queue as gct_queue -from google.cloud.tasks_v2beta2.types import task as gct_task from google.protobuf import duration_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore +import proto # type: ignore +from google.cloud.tasks_v2beta2.types import queue as gct_queue +from google.cloud.tasks_v2beta2.types import task as gct_task __protobuf__ = proto.module( package="google.cloud.tasks.v2beta2", diff --git a/google/cloud/tasks_v2beta2/types/queue.py b/google/cloud/tasks_v2beta2/types/queue.py index da665292..717f9ac3 100644 --- a/google/cloud/tasks_v2beta2/types/queue.py +++ b/google/cloud/tasks_v2beta2/types/queue.py @@ -13,12 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - -from google.cloud.tasks_v2beta2.types import target from google.protobuf import duration_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore +import proto # type: ignore +from google.cloud.tasks_v2beta2.types import target __protobuf__ = proto.module( package="google.cloud.tasks.v2beta2", diff --git a/google/cloud/tasks_v2beta2/types/target.py b/google/cloud/tasks_v2beta2/types/target.py index 998aa254..95b5991b 100644 --- a/google/cloud/tasks_v2beta2/types/target.py +++ b/google/cloud/tasks_v2beta2/types/target.py @@ -15,7 +15,6 @@ # import proto # type: ignore - __protobuf__ = proto.module( package="google.cloud.tasks.v2beta2", manifest={ diff --git a/google/cloud/tasks_v2beta2/types/task.py b/google/cloud/tasks_v2beta2/types/task.py index 9b064903..af1b2df5 100644 --- a/google/cloud/tasks_v2beta2/types/task.py +++ b/google/cloud/tasks_v2beta2/types/task.py @@ -13,12 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - -from google.cloud.tasks_v2beta2.types import target from google.protobuf import timestamp_pb2 # type: ignore from google.rpc import status_pb2 # type: ignore +import proto # type: ignore +from google.cloud.tasks_v2beta2.types import target __protobuf__ = proto.module( package="google.cloud.tasks.v2beta2", diff --git a/google/cloud/tasks_v2beta3/__init__.py b/google/cloud/tasks_v2beta3/__init__.py index aacbca5f..87f47f7c 100644 --- a/google/cloud/tasks_v2beta3/__init__.py +++ b/google/cloud/tasks_v2beta3/__init__.py @@ -14,39 +14,42 @@ # limitations under the License. # -from .services.cloud_tasks import CloudTasksClient -from .services.cloud_tasks import CloudTasksAsyncClient - -from .types.cloudtasks import CreateQueueRequest -from .types.cloudtasks import CreateTaskRequest -from .types.cloudtasks import DeleteQueueRequest -from .types.cloudtasks import DeleteTaskRequest -from .types.cloudtasks import GetQueueRequest -from .types.cloudtasks import GetTaskRequest -from .types.cloudtasks import ListQueuesRequest -from .types.cloudtasks import ListQueuesResponse -from .types.cloudtasks import ListTasksRequest -from .types.cloudtasks import ListTasksResponse -from .types.cloudtasks import PauseQueueRequest -from .types.cloudtasks import PurgeQueueRequest -from .types.cloudtasks import ResumeQueueRequest -from .types.cloudtasks import RunTaskRequest -from .types.cloudtasks import UpdateQueueRequest -from .types.queue import Queue -from .types.queue import QueueStats -from .types.queue import RateLimits -from .types.queue import RetryConfig -from .types.queue import StackdriverLoggingConfig -from .types.target import AppEngineHttpQueue -from .types.target import AppEngineHttpRequest -from .types.target import AppEngineRouting -from .types.target import HttpRequest -from .types.target import OAuthToken -from .types.target import OidcToken -from .types.target import PullMessage -from .types.target import HttpMethod -from .types.task import Attempt -from .types.task import Task +from .services.cloud_tasks import CloudTasksAsyncClient, CloudTasksClient +from .types.cloudtasks import ( + CreateQueueRequest, + CreateTaskRequest, + DeleteQueueRequest, + DeleteTaskRequest, + GetQueueRequest, + GetTaskRequest, + ListQueuesRequest, + ListQueuesResponse, + ListTasksRequest, + ListTasksResponse, + PauseQueueRequest, + PurgeQueueRequest, + ResumeQueueRequest, + RunTaskRequest, + UpdateQueueRequest, +) +from .types.queue import ( + Queue, + QueueStats, + RateLimits, + RetryConfig, + StackdriverLoggingConfig, +) +from .types.target import ( + AppEngineHttpQueue, + AppEngineHttpRequest, + AppEngineRouting, + HttpMethod, + HttpRequest, + OAuthToken, + OidcToken, + PullMessage, +) +from .types.task import Attempt, Task __all__ = ( "CloudTasksAsyncClient", diff --git a/google/cloud/tasks_v2beta3/services/cloud_tasks/__init__.py b/google/cloud/tasks_v2beta3/services/cloud_tasks/__init__.py index aedb130d..b47f3823 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/__init__.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/__init__.py @@ -13,8 +13,8 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import CloudTasksClient from .async_client import CloudTasksAsyncClient +from .client import CloudTasksClient __all__ = ( "CloudTasksClient", 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 909d16f9..5c049569 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py @@ -17,20 +17,26 @@ import functools import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources -from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +from google.api_core.client_options import ClientOptions from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.protobuf import duration_pb2 # type: ignore +from google.protobuf import field_mask_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore + from google.cloud.tasks_v2beta3.services.cloud_tasks import pagers from google.cloud.tasks_v2beta3.types import cloudtasks from google.cloud.tasks_v2beta3.types import queue @@ -38,14 +44,10 @@ from google.cloud.tasks_v2beta3.types import target from google.cloud.tasks_v2beta3.types import task from google.cloud.tasks_v2beta3.types import task as gct_task -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.protobuf import duration_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import CloudTasksTransport, DEFAULT_CLIENT_INFO -from .transports.grpc_asyncio import CloudTasksGrpcAsyncIOTransport + from .client import CloudTasksClient +from .transports.base import DEFAULT_CLIENT_INFO, CloudTasksTransport +from .transports.grpc_asyncio import CloudTasksGrpcAsyncIOTransport class CloudTasksAsyncClient: diff --git a/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py b/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py index 96c75e34..9f2b1686 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/client.py @@ -17,23 +17,29 @@ import os import re from typing import Dict, Mapping, Optional, Sequence, Tuple, Type, Union -import pkg_resources from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries from google.auth import credentials as ga_credentials # type: ignore +from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.auth.transport import mtls # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore -from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import pkg_resources try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault] except AttributeError: # pragma: NO COVER OptionalRetry = Union[retries.Retry, object] # type: ignore +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.protobuf import duration_pb2 # type: ignore +from google.protobuf import field_mask_pb2 # type: ignore +from google.protobuf import timestamp_pb2 # type: ignore + from google.cloud.tasks_v2beta3.services.cloud_tasks import pagers from google.cloud.tasks_v2beta3.types import cloudtasks from google.cloud.tasks_v2beta3.types import queue @@ -41,12 +47,8 @@ from google.cloud.tasks_v2beta3.types import target from google.cloud.tasks_v2beta3.types import task from google.cloud.tasks_v2beta3.types import task as gct_task -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.protobuf import duration_pb2 # type: ignore -from google.protobuf import field_mask_pb2 # type: ignore -from google.protobuf import timestamp_pb2 # type: ignore -from .transports.base import CloudTasksTransport, DEFAULT_CLIENT_INFO + +from .transports.base import DEFAULT_CLIENT_INFO, CloudTasksTransport from .transports.grpc import CloudTasksGrpcTransport from .transports.grpc_asyncio import CloudTasksGrpcAsyncIOTransport diff --git a/google/cloud/tasks_v2beta3/services/cloud_tasks/pagers.py b/google/cloud/tasks_v2beta3/services/cloud_tasks/pagers.py index 6d34e80c..7efe01c3 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/pagers.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/pagers.py @@ -18,15 +18,13 @@ AsyncIterator, Awaitable, Callable, + Iterator, + Optional, Sequence, Tuple, - Optional, - Iterator, ) -from google.cloud.tasks_v2beta3.types import cloudtasks -from google.cloud.tasks_v2beta3.types import queue -from google.cloud.tasks_v2beta3.types import task +from google.cloud.tasks_v2beta3.types import cloudtasks, queue, task class ListQueuesPager: diff --git a/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/__init__.py b/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/__init__.py index ec04b44d..dd95e460 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/__init__.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/__init__.py @@ -20,7 +20,6 @@ from .grpc import CloudTasksGrpcTransport from .grpc_asyncio import CloudTasksGrpcAsyncIOTransport - # Compile a registry of transports. _transport_registry = OrderedDict() # type: Dict[str, Type[CloudTasksTransport]] _transport_registry["grpc"] = CloudTasksGrpcTransport diff --git a/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/base.py b/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/base.py index 08de66d2..174e108b 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/base.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/base.py @@ -15,24 +15,24 @@ # import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -import pkg_resources -import google.auth # type: ignore import google.api_core from google.api_core import exceptions as core_exceptions from google.api_core import gapic_v1 from google.api_core import retry as retries +import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore from google.oauth2 import service_account # type: ignore +from google.protobuf import empty_pb2 # type: ignore +import pkg_resources from google.cloud.tasks_v2beta3.types import cloudtasks from google.cloud.tasks_v2beta3.types import queue from google.cloud.tasks_v2beta3.types import queue as gct_queue from google.cloud.tasks_v2beta3.types import task from google.cloud.tasks_v2beta3.types import task as gct_task -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( 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 925c2696..a9b2ac0b 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/grpc.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/transports/grpc.py @@ -13,15 +13,16 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import grpc_helpers -from google.api_core import gapic_v1 +from google.api_core import gapic_v1, grpc_helpers import google.auth # type: ignore from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from google.cloud.tasks_v2beta3.types import cloudtasks @@ -29,10 +30,8 @@ from google.cloud.tasks_v2beta3.types import queue as gct_queue from google.cloud.tasks_v2beta3.types import task from google.cloud.tasks_v2beta3.types import task as gct_task -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore -from .base import CloudTasksTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, CloudTasksTransport class CloudTasksGrpcTransport(CloudTasksTransport): 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 2531ad03..be558793 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 @@ -13,14 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import warnings from typing import Awaitable, Callable, Dict, Optional, Sequence, Tuple, Union +import warnings -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers_async +from google.api_core import gapic_v1, grpc_helpers_async from google.auth import credentials as ga_credentials # type: ignore from google.auth.transport.grpc import SslCredentials # type: ignore - +from google.iam.v1 import iam_policy_pb2 # type: ignore +from google.iam.v1 import policy_pb2 # type: ignore +from google.protobuf import empty_pb2 # type: ignore import grpc # type: ignore from grpc.experimental import aio # type: ignore @@ -29,10 +30,8 @@ from google.cloud.tasks_v2beta3.types import queue as gct_queue from google.cloud.tasks_v2beta3.types import task from google.cloud.tasks_v2beta3.types import task as gct_task -from google.iam.v1 import iam_policy_pb2 # type: ignore -from google.iam.v1 import policy_pb2 # type: ignore -from google.protobuf import empty_pb2 # type: ignore -from .base import CloudTasksTransport, DEFAULT_CLIENT_INFO + +from .base import DEFAULT_CLIENT_INFO, CloudTasksTransport from .grpc import CloudTasksGrpcTransport diff --git a/google/cloud/tasks_v2beta3/types/__init__.py b/google/cloud/tasks_v2beta3/types/__init__.py index fd8d5813..66f3e0ab 100644 --- a/google/cloud/tasks_v2beta3/types/__init__.py +++ b/google/cloud/tasks_v2beta3/types/__init__.py @@ -30,27 +30,18 @@ RunTaskRequest, UpdateQueueRequest, ) -from .queue import ( - Queue, - QueueStats, - RateLimits, - RetryConfig, - StackdriverLoggingConfig, -) +from .queue import Queue, QueueStats, RateLimits, RetryConfig, StackdriverLoggingConfig from .target import ( AppEngineHttpQueue, AppEngineHttpRequest, AppEngineRouting, + HttpMethod, HttpRequest, OAuthToken, OidcToken, PullMessage, - HttpMethod, -) -from .task import ( - Attempt, - Task, ) +from .task import Attempt, Task __all__ = ( "CreateQueueRequest", diff --git a/google/cloud/tasks_v2beta3/types/cloudtasks.py b/google/cloud/tasks_v2beta3/types/cloudtasks.py index a6fcaf93..663e2124 100644 --- a/google/cloud/tasks_v2beta3/types/cloudtasks.py +++ b/google/cloud/tasks_v2beta3/types/cloudtasks.py @@ -13,12 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # +from google.protobuf import field_mask_pb2 # type: ignore import proto # type: ignore from google.cloud.tasks_v2beta3.types import queue as gct_queue from google.cloud.tasks_v2beta3.types import task as gct_task -from google.protobuf import field_mask_pb2 # type: ignore - __protobuf__ = proto.module( package="google.cloud.tasks.v2beta3", diff --git a/google/cloud/tasks_v2beta3/types/queue.py b/google/cloud/tasks_v2beta3/types/queue.py index 620194b8..f2aed3c0 100644 --- a/google/cloud/tasks_v2beta3/types/queue.py +++ b/google/cloud/tasks_v2beta3/types/queue.py @@ -13,12 +13,11 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - -from google.cloud.tasks_v2beta3.types import target from google.protobuf import duration_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore +import proto # type: ignore +from google.cloud.tasks_v2beta3.types import target __protobuf__ = proto.module( package="google.cloud.tasks.v2beta3", diff --git a/google/cloud/tasks_v2beta3/types/target.py b/google/cloud/tasks_v2beta3/types/target.py index e964eb0e..0268791f 100644 --- a/google/cloud/tasks_v2beta3/types/target.py +++ b/google/cloud/tasks_v2beta3/types/target.py @@ -15,7 +15,6 @@ # import proto # type: ignore - __protobuf__ = proto.module( package="google.cloud.tasks.v2beta3", manifest={ diff --git a/google/cloud/tasks_v2beta3/types/task.py b/google/cloud/tasks_v2beta3/types/task.py index 20930b51..6f651136 100644 --- a/google/cloud/tasks_v2beta3/types/task.py +++ b/google/cloud/tasks_v2beta3/types/task.py @@ -13,13 +13,12 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import proto # type: ignore - -from google.cloud.tasks_v2beta3.types import target from google.protobuf import duration_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore from google.rpc import status_pb2 # type: ignore +import proto # type: ignore +from google.cloud.tasks_v2beta3.types import target __protobuf__ = proto.module( package="google.cloud.tasks.v2beta3", diff --git a/noxfile.py b/noxfile.py index 6ee5e8ab..7c1742d2 100644 --- a/noxfile.py +++ b/noxfile.py @@ -17,6 +17,7 @@ # Generated by synthtool. DO NOT EDIT! from __future__ import absolute_import + import os import pathlib import shutil @@ -25,7 +26,8 @@ import nox BLACK_VERSION = "black==22.3.0" -BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] +ISORT_VERSION = "isort==5.10.1" +LINT_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] DEFAULT_PYTHON_VERSION = "3.8" @@ -83,7 +85,7 @@ def lint(session): session.run( "black", "--check", - *BLACK_PATHS, + *LINT_PATHS, ) session.run("flake8", "google", "tests") @@ -94,7 +96,27 @@ def blacken(session): session.install(BLACK_VERSION) session.run( "black", - *BLACK_PATHS, + *LINT_PATHS, + ) + + +@nox.session(python=DEFAULT_PYTHON_VERSION) +def format(session): + """ + Run isort to sort imports. Then run black + to format code to uniform standard. + """ + session.install(BLACK_VERSION, ISORT_VERSION) + # Use the --fss option to sort imports using strict alphabetical order. + # See https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections + session.run( + "isort", + "--fss", + *LINT_PATHS, + ) + session.run( + "black", + *LINT_PATHS, ) diff --git a/samples/snippets/create_http_task.py b/samples/snippets/create_http_task.py index 7bf75d41..13057fa8 100644 --- a/samples/snippets/create_http_task.py +++ b/samples/snippets/create_http_task.py @@ -30,11 +30,12 @@ def create_http_task( # [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, duration_pb2 import datetime import json + from google.cloud import tasks_v2 + from google.protobuf import duration_pb2, timestamp_pb2 + # Create a client. client = tasks_v2.CloudTasksClient() diff --git a/samples/snippets/delete_queue_test.py b/samples/snippets/delete_queue_test.py index e814c910..0d1914e8 100644 --- a/samples/snippets/delete_queue_test.py +++ b/samples/snippets/delete_queue_test.py @@ -21,7 +21,6 @@ import delete_queue - TEST_PROJECT_ID = os.environ["GOOGLE_CLOUD_PROJECT"] TEST_LOCATION = os.getenv("TEST_QUEUE_LOCATION", "us-central1") TEST_QUEUE_NAME = f"my-queue-{uuid.uuid4().hex}" diff --git a/samples/snippets/noxfile.py b/samples/snippets/noxfile.py index 25f87a21..3b3ffa5d 100644 --- a/samples/snippets/noxfile.py +++ b/samples/snippets/noxfile.py @@ -22,7 +22,6 @@ import nox - # WARNING - WARNING - WARNING - WARNING - WARNING # WARNING - WARNING - WARNING - WARNING - WARNING # DO NOT EDIT THIS FILE EVER! @@ -30,6 +29,7 @@ # WARNING - WARNING - WARNING - WARNING - WARNING BLACK_VERSION = "black==22.3.0" +ISORT_VERSION = "isort==5.10.1" # Copy `noxfile_config.py` to your directory and modify it instead. @@ -168,12 +168,33 @@ def lint(session: nox.sessions.Session) -> None: @nox.session def blacken(session: nox.sessions.Session) -> None: + """Run black. Format code to uniform standard.""" session.install(BLACK_VERSION) python_files = [path for path in os.listdir(".") if path.endswith(".py")] session.run("black", *python_files) +# +# format = isort + black +# + + +@nox.session +def format(session: nox.sessions.Session) -> None: + """ + Run isort to sort imports. Then run black + to format code to uniform standard. + """ + session.install(BLACK_VERSION, ISORT_VERSION) + python_files = [path for path in os.listdir(".") if path.endswith(".py")] + + # Use the --fss option to sort imports using strict alphabetical order. + # See https://pycqa.github.io/isort/docs/configuration/options.html#force-sort-within-sections + session.run("isort", "--fss", *python_files) + session.run("black", *python_files) + + # # Sample Tests # diff --git a/tests/unit/gapic/tasks_v2/test_cloud_tasks.py b/tests/unit/gapic/tasks_v2/test_cloud_tasks.py index dd7ddfbe..423b0529 100644 --- a/tests/unit/gapic/tasks_v2/test_cloud_tasks.py +++ b/tests/unit/gapic/tasks_v2/test_cloud_tasks.py @@ -13,34 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os -import mock - -import grpc -from grpc.experimental import aio import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule - +import os +from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.tasks_v2.services.cloud_tasks import CloudTasksAsyncClient -from google.cloud.tasks_v2.services.cloud_tasks import CloudTasksClient -from google.cloud.tasks_v2.services.cloud_tasks import pagers -from google.cloud.tasks_v2.services.cloud_tasks import transports -from google.cloud.tasks_v2.types import cloudtasks -from google.cloud.tasks_v2.types import queue -from google.cloud.tasks_v2.types import queue as gct_queue -from google.cloud.tasks_v2.types import target -from google.cloud.tasks_v2.types import task -from google.cloud.tasks_v2.types import task as gct_task from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import options_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore @@ -51,7 +32,24 @@ from google.protobuf import timestamp_pb2 # type: ignore from google.rpc import status_pb2 # type: ignore from google.type import expr_pb2 # type: ignore -import google.auth +import grpc +from grpc.experimental import aio +import mock +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + +from google.cloud.tasks_v2.services.cloud_tasks import ( + CloudTasksAsyncClient, + CloudTasksClient, + pagers, + transports, +) +from google.cloud.tasks_v2.types import cloudtasks +from google.cloud.tasks_v2.types import queue +from google.cloud.tasks_v2.types import queue as gct_queue +from google.cloud.tasks_v2.types import target +from google.cloud.tasks_v2.types import task +from google.cloud.tasks_v2.types import task as gct_task def client_cert_source_callback(): diff --git a/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py b/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py index 78371d28..eae992b3 100644 --- a/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py +++ b/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py @@ -13,34 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os -import mock - -import grpc -from grpc.experimental import aio import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule - +import os +from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.tasks_v2beta2.services.cloud_tasks import CloudTasksAsyncClient -from google.cloud.tasks_v2beta2.services.cloud_tasks import CloudTasksClient -from google.cloud.tasks_v2beta2.services.cloud_tasks import pagers -from google.cloud.tasks_v2beta2.services.cloud_tasks import transports -from google.cloud.tasks_v2beta2.types import cloudtasks -from google.cloud.tasks_v2beta2.types import queue -from google.cloud.tasks_v2beta2.types import queue as gct_queue -from google.cloud.tasks_v2beta2.types import target -from google.cloud.tasks_v2beta2.types import task -from google.cloud.tasks_v2beta2.types import task as gct_task from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import options_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore @@ -51,7 +32,24 @@ from google.protobuf import timestamp_pb2 # type: ignore from google.rpc import status_pb2 # type: ignore from google.type import expr_pb2 # type: ignore -import google.auth +import grpc +from grpc.experimental import aio +import mock +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + +from google.cloud.tasks_v2beta2.services.cloud_tasks import ( + CloudTasksAsyncClient, + CloudTasksClient, + pagers, + transports, +) +from google.cloud.tasks_v2beta2.types import cloudtasks +from google.cloud.tasks_v2beta2.types import queue +from google.cloud.tasks_v2beta2.types import queue as gct_queue +from google.cloud.tasks_v2beta2.types import target +from google.cloud.tasks_v2beta2.types import task +from google.cloud.tasks_v2beta2.types import task as gct_task def client_cert_source_callback(): diff --git a/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py b/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py index a05a7a82..cf998b41 100644 --- a/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py +++ b/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py @@ -13,34 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # -import os -import mock - -import grpc -from grpc.experimental import aio import math -import pytest -from proto.marshal.rules.dates import DurationRule, TimestampRule - +import os +from google.api_core import gapic_v1, grpc_helpers, grpc_helpers_async, path_template from google.api_core import client_options from google.api_core import exceptions as core_exceptions -from google.api_core import gapic_v1 -from google.api_core import grpc_helpers -from google.api_core import grpc_helpers_async -from google.api_core import path_template +import google.auth from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.tasks_v2beta3.services.cloud_tasks import CloudTasksAsyncClient -from google.cloud.tasks_v2beta3.services.cloud_tasks import CloudTasksClient -from google.cloud.tasks_v2beta3.services.cloud_tasks import pagers -from google.cloud.tasks_v2beta3.services.cloud_tasks import transports -from google.cloud.tasks_v2beta3.types import cloudtasks -from google.cloud.tasks_v2beta3.types import queue -from google.cloud.tasks_v2beta3.types import queue as gct_queue -from google.cloud.tasks_v2beta3.types import target -from google.cloud.tasks_v2beta3.types import task -from google.cloud.tasks_v2beta3.types import task as gct_task from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import options_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore @@ -51,7 +32,24 @@ from google.protobuf import timestamp_pb2 # type: ignore from google.rpc import status_pb2 # type: ignore from google.type import expr_pb2 # type: ignore -import google.auth +import grpc +from grpc.experimental import aio +import mock +from proto.marshal.rules.dates import DurationRule, TimestampRule +import pytest + +from google.cloud.tasks_v2beta3.services.cloud_tasks import ( + CloudTasksAsyncClient, + CloudTasksClient, + pagers, + transports, +) +from google.cloud.tasks_v2beta3.types import cloudtasks +from google.cloud.tasks_v2beta3.types import queue +from google.cloud.tasks_v2beta3.types import queue as gct_queue +from google.cloud.tasks_v2beta3.types import target +from google.cloud.tasks_v2beta3.types import task +from google.cloud.tasks_v2beta3.types import task as gct_task def client_cert_source_callback(): From ca16c07a024e81e6d7f3c8acf338c8decc03cc9b Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 21 Apr 2022 16:16:32 +0000 Subject: [PATCH 13/17] chore(python): use ubuntu 22.04 in docs image (#256) Source-Link: https://github.com/googleapis/synthtool/commit/f15cc72fb401b4861cedebb10af74afe428fb1f8 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd --- .github/.OwlBot.lock.yaml | 4 ++-- .kokoro/docker/docs/Dockerfile | 20 ++++++++++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 7c454abf..64f82d6b 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:00c9d764fd1cd56265f12a5ef4b99a0c9e87cf261018099141e2ca5158890416 -# created: 2022-04-20T23:42:53.970438194Z + digest: sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd +# created: 2022-04-21T15:43:16.246106921Z diff --git a/.kokoro/docker/docs/Dockerfile b/.kokoro/docker/docs/Dockerfile index 4e1b1fb8..238b87b9 100644 --- a/.kokoro/docker/docs/Dockerfile +++ b/.kokoro/docker/docs/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from ubuntu:20.04 +from ubuntu:22.04 ENV DEBIAN_FRONTEND noninteractive @@ -60,8 +60,24 @@ RUN apt-get update \ && rm -rf /var/lib/apt/lists/* \ && rm -f /var/cache/apt/archives/*.deb +###################### Install python 3.8.11 + +# Download python 3.8.11 +RUN wget https://www.python.org/ftp/python/3.8.11/Python-3.8.11.tgz + +# Extract files +RUN tar -xvf Python-3.8.11.tgz + +# Install python 3.8.11 +RUN ./Python-3.8.11/configure --enable-optimizations +RUN make altinstall + +###################### Install pip RUN wget -O /tmp/get-pip.py 'https://bootstrap.pypa.io/get-pip.py' \ - && python3.8 /tmp/get-pip.py \ + && python3 /tmp/get-pip.py \ && rm /tmp/get-pip.py +# Test pip +RUN python3 -m pip + CMD ["python3.8"] From c5dfcbaf9b42b26ad471850b5e4b3770f842585d Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 25 Apr 2022 17:04:27 +0200 Subject: [PATCH 14/17] chore(deps): update dependency pytest to v7.1.2 (#257) --- 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 4f6bf643..d00689e0 100644 --- a/samples/snippets/requirements-test.txt +++ b/samples/snippets/requirements-test.txt @@ -1 +1 @@ -pytest==7.1.1 +pytest==7.1.2 From dccd050267dc901d9038bb9ff637bf2006e2ab57 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 28 Apr 2022 07:46:24 -0400 Subject: [PATCH 15/17] chore: use gapic-generator-python 0.65.2 (#258) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: use gapic-generator-python 0.65.2 PiperOrigin-RevId: 444333013 Source-Link: https://github.com/googleapis/googleapis/commit/f91b6cf82e929280f6562f6110957c654bd9e2e6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/16eb36095c294e712c74a1bf23550817b42174e5 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMTZlYjM2MDk1YzI5NGU3MTJjNzRhMWJmMjM1NTA4MTdiNDIxNzRlNSJ9 * 🦉 Updates from OwlBot post-processor 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 | 96 +++++----- .../services/cloud_tasks/async_client.py | 120 ++++++------- .../services/cloud_tasks/async_client.py | 96 +++++----- tests/unit/gapic/tasks_v2/test_cloud_tasks.py | 132 +++++++------- .../gapic/tasks_v2beta2/test_cloud_tasks.py | 164 +++++++++--------- .../gapic/tasks_v2beta3/test_cloud_tasks.py | 132 +++++++------- 6 files changed, 370 insertions(+), 370 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 4241d209..fe092df2 100644 --- a/google/cloud/tasks_v2/services/cloud_tasks/async_client.py +++ b/google/cloud/tasks_v2/services/cloud_tasks/async_client.py @@ -228,9 +228,9 @@ async def list_queues( from google.cloud import tasks_v2 - def sample_list_queues(): + async def sample_list_queues(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.ListQueuesRequest( @@ -241,7 +241,7 @@ def sample_list_queues(): page_result = client.list_queues(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -346,9 +346,9 @@ async def get_queue( from google.cloud import tasks_v2 - def sample_get_queue(): + async def sample_get_queue(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.GetQueueRequest( @@ -356,7 +356,7 @@ def sample_get_queue(): ) # Make the request - response = client.get_queue(request=request) + response = await client.get_queue(request=request) # Handle the response print(response) @@ -466,9 +466,9 @@ async def create_queue( from google.cloud import tasks_v2 - def sample_create_queue(): + async def sample_create_queue(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.CreateQueueRequest( @@ -476,7 +476,7 @@ def sample_create_queue(): ) # Make the request - response = client.create_queue(request=request) + response = await client.create_queue(request=request) # Handle the response print(response) @@ -595,16 +595,16 @@ async def update_queue( from google.cloud import tasks_v2 - def sample_update_queue(): + async def sample_update_queue(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.UpdateQueueRequest( ) # Make the request - response = client.update_queue(request=request) + response = await client.update_queue(request=request) # Handle the response print(response) @@ -725,9 +725,9 @@ async def delete_queue( from google.cloud import tasks_v2 - def sample_delete_queue(): + async def sample_delete_queue(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.DeleteQueueRequest( @@ -735,7 +735,7 @@ def sample_delete_queue(): ) # Make the request - client.delete_queue(request=request) + await client.delete_queue(request=request) Args: request (Union[google.cloud.tasks_v2.types.DeleteQueueRequest, dict]): @@ -823,9 +823,9 @@ async def purge_queue( from google.cloud import tasks_v2 - def sample_purge_queue(): + async def sample_purge_queue(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.PurgeQueueRequest( @@ -833,7 +833,7 @@ def sample_purge_queue(): ) # Make the request - response = client.purge_queue(request=request) + response = await client.purge_queue(request=request) # Handle the response print(response) @@ -929,9 +929,9 @@ async def pause_queue( from google.cloud import tasks_v2 - def sample_pause_queue(): + async def sample_pause_queue(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.PauseQueueRequest( @@ -939,7 +939,7 @@ def sample_pause_queue(): ) # Make the request - response = client.pause_queue(request=request) + response = await client.pause_queue(request=request) # Handle the response print(response) @@ -1042,9 +1042,9 @@ async def resume_queue( from google.cloud import tasks_v2 - def sample_resume_queue(): + async def sample_resume_queue(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.ResumeQueueRequest( @@ -1052,7 +1052,7 @@ def sample_resume_queue(): ) # Make the request - response = client.resume_queue(request=request) + response = await client.resume_queue(request=request) # Handle the response print(response) @@ -1150,9 +1150,9 @@ async def get_iam_policy( from google.cloud import tasks_v2 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_get_iam_policy(): + async def sample_get_iam_policy(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.GetIamPolicyRequest( @@ -1160,7 +1160,7 @@ def sample_get_iam_policy(): ) # Make the request - response = client.get_iam_policy(request=request) + response = await client.get_iam_policy(request=request) # Handle the response print(response) @@ -1331,9 +1331,9 @@ async def set_iam_policy( from google.cloud import tasks_v2 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_set_iam_policy(): + async def sample_set_iam_policy(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.SetIamPolicyRequest( @@ -1341,7 +1341,7 @@ def sample_set_iam_policy(): ) # Make the request - response = client.set_iam_policy(request=request) + response = await client.set_iam_policy(request=request) # Handle the response print(response) @@ -1499,9 +1499,9 @@ async def test_iam_permissions( from google.cloud import tasks_v2 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_test_iam_permissions(): + async def sample_test_iam_permissions(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.TestIamPermissionsRequest( @@ -1510,7 +1510,7 @@ def sample_test_iam_permissions(): ) # Make the request - response = client.test_iam_permissions(request=request) + response = await client.test_iam_permissions(request=request) # Handle the response print(response) @@ -1626,9 +1626,9 @@ async def list_tasks( from google.cloud import tasks_v2 - def sample_list_tasks(): + async def sample_list_tasks(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.ListTasksRequest( @@ -1639,7 +1639,7 @@ def sample_list_tasks(): page_result = client.list_tasks(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1745,9 +1745,9 @@ async def get_task( from google.cloud import tasks_v2 - def sample_get_task(): + async def sample_get_task(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.GetTaskRequest( @@ -1755,7 +1755,7 @@ def sample_get_task(): ) # Make the request - response = client.get_task(request=request) + response = await client.get_task(request=request) # Handle the response print(response) @@ -1855,9 +1855,9 @@ async def create_task( from google.cloud import tasks_v2 - def sample_create_task(): + async def sample_create_task(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.CreateTaskRequest( @@ -1865,7 +1865,7 @@ def sample_create_task(): ) # Make the request - response = client.create_task(request=request) + response = await client.create_task(request=request) # Handle the response print(response) @@ -2001,9 +2001,9 @@ async def delete_task( from google.cloud import tasks_v2 - def sample_delete_task(): + async def sample_delete_task(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.DeleteTaskRequest( @@ -2011,7 +2011,7 @@ def sample_delete_task(): ) # Make the request - client.delete_task(request=request) + await client.delete_task(request=request) Args: request (Union[google.cloud.tasks_v2.types.DeleteTaskRequest, dict]): @@ -2121,9 +2121,9 @@ async def run_task( from google.cloud import tasks_v2 - def sample_run_task(): + async def sample_run_task(): # Create a client - client = tasks_v2.CloudTasksClient() + client = tasks_v2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2.RunTaskRequest( @@ -2131,7 +2131,7 @@ def sample_run_task(): ) # Make the request - response = client.run_task(request=request) + response = await client.run_task(request=request) # Handle the response print(response) 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 4affe76f..a5bf6571 100644 --- a/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py +++ b/google/cloud/tasks_v2beta2/services/cloud_tasks/async_client.py @@ -228,9 +228,9 @@ async def list_queues( from google.cloud import tasks_v2beta2 - def sample_list_queues(): + async def sample_list_queues(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.ListQueuesRequest( @@ -241,7 +241,7 @@ def sample_list_queues(): page_result = client.list_queues(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -346,9 +346,9 @@ async def get_queue( from google.cloud import tasks_v2beta2 - def sample_get_queue(): + async def sample_get_queue(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.GetQueueRequest( @@ -356,7 +356,7 @@ def sample_get_queue(): ) # Make the request - response = client.get_queue(request=request) + response = await client.get_queue(request=request) # Handle the response print(response) @@ -466,9 +466,9 @@ async def create_queue( from google.cloud import tasks_v2beta2 - def sample_create_queue(): + async def sample_create_queue(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.CreateQueueRequest( @@ -476,7 +476,7 @@ def sample_create_queue(): ) # Make the request - response = client.create_queue(request=request) + response = await client.create_queue(request=request) # Handle the response print(response) @@ -595,16 +595,16 @@ async def update_queue( from google.cloud import tasks_v2beta2 - def sample_update_queue(): + async def sample_update_queue(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.UpdateQueueRequest( ) # Make the request - response = client.update_queue(request=request) + response = await client.update_queue(request=request) # Handle the response print(response) @@ -726,9 +726,9 @@ async def delete_queue( from google.cloud import tasks_v2beta2 - def sample_delete_queue(): + async def sample_delete_queue(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.DeleteQueueRequest( @@ -736,7 +736,7 @@ def sample_delete_queue(): ) # Make the request - client.delete_queue(request=request) + await client.delete_queue(request=request) Args: request (Union[google.cloud.tasks_v2beta2.types.DeleteQueueRequest, dict]): @@ -824,9 +824,9 @@ async def purge_queue( from google.cloud import tasks_v2beta2 - def sample_purge_queue(): + async def sample_purge_queue(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.PurgeQueueRequest( @@ -834,7 +834,7 @@ def sample_purge_queue(): ) # Make the request - response = client.purge_queue(request=request) + response = await client.purge_queue(request=request) # Handle the response print(response) @@ -930,9 +930,9 @@ async def pause_queue( from google.cloud import tasks_v2beta2 - def sample_pause_queue(): + async def sample_pause_queue(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.PauseQueueRequest( @@ -940,7 +940,7 @@ def sample_pause_queue(): ) # Make the request - response = client.pause_queue(request=request) + response = await client.pause_queue(request=request) # Handle the response print(response) @@ -1043,9 +1043,9 @@ async def resume_queue( from google.cloud import tasks_v2beta2 - def sample_resume_queue(): + async def sample_resume_queue(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.ResumeQueueRequest( @@ -1053,7 +1053,7 @@ def sample_resume_queue(): ) # Make the request - response = client.resume_queue(request=request) + response = await client.resume_queue(request=request) # Handle the response print(response) @@ -1151,9 +1151,9 @@ async def get_iam_policy( from google.cloud import tasks_v2beta2 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_get_iam_policy(): + async def sample_get_iam_policy(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.GetIamPolicyRequest( @@ -1161,7 +1161,7 @@ def sample_get_iam_policy(): ) # Make the request - response = client.get_iam_policy(request=request) + response = await client.get_iam_policy(request=request) # Handle the response print(response) @@ -1332,9 +1332,9 @@ async def set_iam_policy( from google.cloud import tasks_v2beta2 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_set_iam_policy(): + async def sample_set_iam_policy(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.SetIamPolicyRequest( @@ -1342,7 +1342,7 @@ def sample_set_iam_policy(): ) # Make the request - response = client.set_iam_policy(request=request) + response = await client.set_iam_policy(request=request) # Handle the response print(response) @@ -1500,9 +1500,9 @@ async def test_iam_permissions( from google.cloud import tasks_v2beta2 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_test_iam_permissions(): + async def sample_test_iam_permissions(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.TestIamPermissionsRequest( @@ -1511,7 +1511,7 @@ def sample_test_iam_permissions(): ) # Make the request - response = client.test_iam_permissions(request=request) + response = await client.test_iam_permissions(request=request) # Handle the response print(response) @@ -1627,9 +1627,9 @@ async def list_tasks( from google.cloud import tasks_v2beta2 - def sample_list_tasks(): + async def sample_list_tasks(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.ListTasksRequest( @@ -1640,7 +1640,7 @@ def sample_list_tasks(): page_result = client.list_tasks(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1746,9 +1746,9 @@ async def get_task( from google.cloud import tasks_v2beta2 - def sample_get_task(): + async def sample_get_task(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.GetTaskRequest( @@ -1756,7 +1756,7 @@ def sample_get_task(): ) # Make the request - response = client.get_task(request=request) + response = await client.get_task(request=request) # Handle the response print(response) @@ -1860,9 +1860,9 @@ async def create_task( from google.cloud import tasks_v2beta2 - def sample_create_task(): + async def sample_create_task(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.CreateTaskRequest( @@ -1870,7 +1870,7 @@ def sample_create_task(): ) # Make the request - response = client.create_task(request=request) + response = await client.create_task(request=request) # Handle the response print(response) @@ -2006,9 +2006,9 @@ async def delete_task( from google.cloud import tasks_v2beta2 - def sample_delete_task(): + async def sample_delete_task(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.DeleteTaskRequest( @@ -2016,7 +2016,7 @@ def sample_delete_task(): ) # Make the request - client.delete_task(request=request) + await client.delete_task(request=request) Args: request (Union[google.cloud.tasks_v2beta2.types.DeleteTaskRequest, dict]): @@ -2124,9 +2124,9 @@ async def lease_tasks( from google.cloud import tasks_v2beta2 - def sample_lease_tasks(): + async def sample_lease_tasks(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.LeaseTasksRequest( @@ -2134,7 +2134,7 @@ def sample_lease_tasks(): ) # Make the request - response = client.lease_tasks(request=request) + response = await client.lease_tasks(request=request) # Handle the response print(response) @@ -2267,9 +2267,9 @@ async def acknowledge_task( from google.cloud import tasks_v2beta2 - def sample_acknowledge_task(): + async def sample_acknowledge_task(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.AcknowledgeTaskRequest( @@ -2277,7 +2277,7 @@ def sample_acknowledge_task(): ) # Make the request - client.acknowledge_task(request=request) + await client.acknowledge_task(request=request) Args: request (Union[google.cloud.tasks_v2beta2.types.AcknowledgeTaskRequest, dict]): @@ -2374,9 +2374,9 @@ async def renew_lease( from google.cloud import tasks_v2beta2 - def sample_renew_lease(): + async def sample_renew_lease(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.RenewLeaseRequest( @@ -2384,7 +2384,7 @@ def sample_renew_lease(): ) # Make the request - response = client.renew_lease(request=request) + response = await client.renew_lease(request=request) # Handle the response print(response) @@ -2504,9 +2504,9 @@ async def cancel_lease( from google.cloud import tasks_v2beta2 - def sample_cancel_lease(): + async def sample_cancel_lease(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.CancelLeaseRequest( @@ -2514,7 +2514,7 @@ def sample_cancel_lease(): ) # Make the request - response = client.cancel_lease(request=request) + response = await client.cancel_lease(request=request) # Handle the response print(response) @@ -2646,9 +2646,9 @@ async def run_task( from google.cloud import tasks_v2beta2 - def sample_run_task(): + async def sample_run_task(): # Create a client - client = tasks_v2beta2.CloudTasksClient() + client = tasks_v2beta2.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta2.RunTaskRequest( @@ -2656,7 +2656,7 @@ def sample_run_task(): ) # Make the request - response = client.run_task(request=request) + response = await client.run_task(request=request) # Handle the response print(response) 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 5c049569..06196ba9 100644 --- a/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py +++ b/google/cloud/tasks_v2beta3/services/cloud_tasks/async_client.py @@ -228,9 +228,9 @@ async def list_queues( from google.cloud import tasks_v2beta3 - def sample_list_queues(): + async def sample_list_queues(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.ListQueuesRequest( @@ -241,7 +241,7 @@ def sample_list_queues(): page_result = client.list_queues(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -346,9 +346,9 @@ async def get_queue( from google.cloud import tasks_v2beta3 - def sample_get_queue(): + async def sample_get_queue(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.GetQueueRequest( @@ -356,7 +356,7 @@ def sample_get_queue(): ) # Make the request - response = client.get_queue(request=request) + response = await client.get_queue(request=request) # Handle the response print(response) @@ -466,9 +466,9 @@ async def create_queue( from google.cloud import tasks_v2beta3 - def sample_create_queue(): + async def sample_create_queue(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.CreateQueueRequest( @@ -476,7 +476,7 @@ def sample_create_queue(): ) # Make the request - response = client.create_queue(request=request) + response = await client.create_queue(request=request) # Handle the response print(response) @@ -595,16 +595,16 @@ async def update_queue( from google.cloud import tasks_v2beta3 - def sample_update_queue(): + async def sample_update_queue(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.UpdateQueueRequest( ) # Make the request - response = client.update_queue(request=request) + response = await client.update_queue(request=request) # Handle the response print(response) @@ -726,9 +726,9 @@ async def delete_queue( from google.cloud import tasks_v2beta3 - def sample_delete_queue(): + async def sample_delete_queue(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.DeleteQueueRequest( @@ -736,7 +736,7 @@ def sample_delete_queue(): ) # Make the request - client.delete_queue(request=request) + await client.delete_queue(request=request) Args: request (Union[google.cloud.tasks_v2beta3.types.DeleteQueueRequest, dict]): @@ -824,9 +824,9 @@ async def purge_queue( from google.cloud import tasks_v2beta3 - def sample_purge_queue(): + async def sample_purge_queue(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.PurgeQueueRequest( @@ -834,7 +834,7 @@ def sample_purge_queue(): ) # Make the request - response = client.purge_queue(request=request) + response = await client.purge_queue(request=request) # Handle the response print(response) @@ -930,9 +930,9 @@ async def pause_queue( from google.cloud import tasks_v2beta3 - def sample_pause_queue(): + async def sample_pause_queue(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.PauseQueueRequest( @@ -940,7 +940,7 @@ def sample_pause_queue(): ) # Make the request - response = client.pause_queue(request=request) + response = await client.pause_queue(request=request) # Handle the response print(response) @@ -1043,9 +1043,9 @@ async def resume_queue( from google.cloud import tasks_v2beta3 - def sample_resume_queue(): + async def sample_resume_queue(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.ResumeQueueRequest( @@ -1053,7 +1053,7 @@ def sample_resume_queue(): ) # Make the request - response = client.resume_queue(request=request) + response = await client.resume_queue(request=request) # Handle the response print(response) @@ -1151,9 +1151,9 @@ async def get_iam_policy( from google.cloud import tasks_v2beta3 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_get_iam_policy(): + async def sample_get_iam_policy(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.GetIamPolicyRequest( @@ -1161,7 +1161,7 @@ def sample_get_iam_policy(): ) # Make the request - response = client.get_iam_policy(request=request) + response = await client.get_iam_policy(request=request) # Handle the response print(response) @@ -1332,9 +1332,9 @@ async def set_iam_policy( from google.cloud import tasks_v2beta3 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_set_iam_policy(): + async def sample_set_iam_policy(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.SetIamPolicyRequest( @@ -1342,7 +1342,7 @@ def sample_set_iam_policy(): ) # Make the request - response = client.set_iam_policy(request=request) + response = await client.set_iam_policy(request=request) # Handle the response print(response) @@ -1500,9 +1500,9 @@ async def test_iam_permissions( from google.cloud import tasks_v2beta3 from google.iam.v1 import iam_policy_pb2 # type: ignore - def sample_test_iam_permissions(): + async def sample_test_iam_permissions(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.TestIamPermissionsRequest( @@ -1511,7 +1511,7 @@ def sample_test_iam_permissions(): ) # Make the request - response = client.test_iam_permissions(request=request) + response = await client.test_iam_permissions(request=request) # Handle the response print(response) @@ -1627,9 +1627,9 @@ async def list_tasks( from google.cloud import tasks_v2beta3 - def sample_list_tasks(): + async def sample_list_tasks(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.ListTasksRequest( @@ -1640,7 +1640,7 @@ def sample_list_tasks(): page_result = client.list_tasks(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1746,9 +1746,9 @@ async def get_task( from google.cloud import tasks_v2beta3 - def sample_get_task(): + async def sample_get_task(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.GetTaskRequest( @@ -1756,7 +1756,7 @@ def sample_get_task(): ) # Make the request - response = client.get_task(request=request) + response = await client.get_task(request=request) # Handle the response print(response) @@ -1856,9 +1856,9 @@ async def create_task( from google.cloud import tasks_v2beta3 - def sample_create_task(): + async def sample_create_task(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.CreateTaskRequest( @@ -1866,7 +1866,7 @@ def sample_create_task(): ) # Make the request - response = client.create_task(request=request) + response = await client.create_task(request=request) # Handle the response print(response) @@ -2002,9 +2002,9 @@ async def delete_task( from google.cloud import tasks_v2beta3 - def sample_delete_task(): + async def sample_delete_task(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.DeleteTaskRequest( @@ -2012,7 +2012,7 @@ def sample_delete_task(): ) # Make the request - client.delete_task(request=request) + await client.delete_task(request=request) Args: request (Union[google.cloud.tasks_v2beta3.types.DeleteTaskRequest, dict]): @@ -2123,9 +2123,9 @@ async def run_task( from google.cloud import tasks_v2beta3 - def sample_run_task(): + async def sample_run_task(): # Create a client - client = tasks_v2beta3.CloudTasksClient() + client = tasks_v2beta3.CloudTasksAsyncClient() # Initialize request argument(s) request = tasks_v2beta3.RunTaskRequest( @@ -2133,7 +2133,7 @@ def sample_run_task(): ) # Make the request - response = client.run_task(request=request) + response = await client.run_task(request=request) # Handle the response print(response) diff --git a/tests/unit/gapic/tasks_v2/test_cloud_tasks.py b/tests/unit/gapic/tasks_v2/test_cloud_tasks.py index 423b0529..35dda73e 100644 --- a/tests/unit/gapic/tasks_v2/test_cloud_tasks.py +++ b/tests/unit/gapic/tasks_v2/test_cloud_tasks.py @@ -732,7 +732,7 @@ def test_list_queues_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.ListQueuesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_queues), "__call__") as call: @@ -748,7 +748,7 @@ def test_list_queues_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -762,7 +762,7 @@ async def test_list_queues_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.ListQueuesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_queues), "__call__") as call: @@ -780,7 +780,7 @@ async def test_list_queues_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -911,7 +911,7 @@ def test_list_queues_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, queue.Queue) for i in results) @@ -1156,7 +1156,7 @@ def test_get_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.GetQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_queue), "__call__") as call: @@ -1172,7 +1172,7 @@ def test_get_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1186,7 +1186,7 @@ async def test_get_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.GetQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_queue), "__call__") as call: @@ -1202,7 +1202,7 @@ async def test_get_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1388,7 +1388,7 @@ def test_create_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateQueueRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_queue), "__call__") as call: @@ -1404,7 +1404,7 @@ def test_create_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1418,7 +1418,7 @@ async def test_create_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateQueueRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_queue), "__call__") as call: @@ -1434,7 +1434,7 @@ async def test_create_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1630,7 +1630,7 @@ def test_update_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.UpdateQueueRequest() - request.queue.name = "queue.name/value" + request.queue.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_queue), "__call__") as call: @@ -1646,7 +1646,7 @@ def test_update_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "queue.name=queue.name/value", + "queue.name=name_value", ) in kw["metadata"] @@ -1660,7 +1660,7 @@ async def test_update_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.UpdateQueueRequest() - request.queue.name = "queue.name/value" + request.queue.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_queue), "__call__") as call: @@ -1676,7 +1676,7 @@ async def test_update_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "queue.name=queue.name/value", + "queue.name=name_value", ) in kw["metadata"] @@ -1860,7 +1860,7 @@ def test_delete_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_queue), "__call__") as call: @@ -1876,7 +1876,7 @@ def test_delete_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1890,7 +1890,7 @@ async def test_delete_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_queue), "__call__") as call: @@ -1906,7 +1906,7 @@ async def test_delete_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2092,7 +2092,7 @@ def test_purge_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.PurgeQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_queue), "__call__") as call: @@ -2108,7 +2108,7 @@ def test_purge_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2122,7 +2122,7 @@ async def test_purge_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.PurgeQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_queue), "__call__") as call: @@ -2138,7 +2138,7 @@ async def test_purge_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2324,7 +2324,7 @@ def test_pause_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.PauseQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.pause_queue), "__call__") as call: @@ -2340,7 +2340,7 @@ def test_pause_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2354,7 +2354,7 @@ async def test_pause_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.PauseQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.pause_queue), "__call__") as call: @@ -2370,7 +2370,7 @@ async def test_pause_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2556,7 +2556,7 @@ def test_resume_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.ResumeQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.resume_queue), "__call__") as call: @@ -2572,7 +2572,7 @@ def test_resume_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2586,7 +2586,7 @@ async def test_resume_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.ResumeQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.resume_queue), "__call__") as call: @@ -2602,7 +2602,7 @@ async def test_resume_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2788,7 +2788,7 @@ def test_get_iam_policy_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.GetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -2804,7 +2804,7 @@ def test_get_iam_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -2818,7 +2818,7 @@ async def test_get_iam_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.GetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -2834,7 +2834,7 @@ async def test_get_iam_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3037,7 +3037,7 @@ def test_set_iam_policy_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.SetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -3053,7 +3053,7 @@ def test_set_iam_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3067,7 +3067,7 @@ async def test_set_iam_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.SetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -3083,7 +3083,7 @@ async def test_set_iam_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3290,7 +3290,7 @@ def test_test_iam_permissions_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.TestIamPermissionsRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3308,7 +3308,7 @@ def test_test_iam_permissions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3322,7 +3322,7 @@ async def test_test_iam_permissions_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.TestIamPermissionsRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3342,7 +3342,7 @@ async def test_test_iam_permissions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3559,7 +3559,7 @@ def test_list_tasks_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.ListTasksRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_tasks), "__call__") as call: @@ -3575,7 +3575,7 @@ def test_list_tasks_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3589,7 +3589,7 @@ async def test_list_tasks_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.ListTasksRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_tasks), "__call__") as call: @@ -3607,7 +3607,7 @@ async def test_list_tasks_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3738,7 +3738,7 @@ def test_list_tasks_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, task.Task) for i in results) @@ -3994,7 +3994,7 @@ def test_get_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.GetTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_task), "__call__") as call: @@ -4010,7 +4010,7 @@ def test_get_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4024,7 +4024,7 @@ async def test_get_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.GetTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_task), "__call__") as call: @@ -4040,7 +4040,7 @@ async def test_get_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4237,7 +4237,7 @@ def test_create_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateTaskRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_task), "__call__") as call: @@ -4253,7 +4253,7 @@ def test_create_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4267,7 +4267,7 @@ async def test_create_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateTaskRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_task), "__call__") as call: @@ -4283,7 +4283,7 @@ async def test_create_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4467,7 +4467,7 @@ def test_delete_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_task), "__call__") as call: @@ -4483,7 +4483,7 @@ def test_delete_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4497,7 +4497,7 @@ async def test_delete_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_task), "__call__") as call: @@ -4513,7 +4513,7 @@ async def test_delete_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4710,7 +4710,7 @@ def test_run_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.RunTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.run_task), "__call__") as call: @@ -4726,7 +4726,7 @@ def test_run_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4740,7 +4740,7 @@ async def test_run_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.RunTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.run_task), "__call__") as call: @@ -4756,7 +4756,7 @@ async def test_run_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py b/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py index eae992b3..ea08fcef 100644 --- a/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py +++ b/tests/unit/gapic/tasks_v2beta2/test_cloud_tasks.py @@ -732,7 +732,7 @@ def test_list_queues_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.ListQueuesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_queues), "__call__") as call: @@ -748,7 +748,7 @@ def test_list_queues_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -762,7 +762,7 @@ async def test_list_queues_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.ListQueuesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_queues), "__call__") as call: @@ -780,7 +780,7 @@ async def test_list_queues_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -911,7 +911,7 @@ def test_list_queues_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, queue.Queue) for i in results) @@ -1161,7 +1161,7 @@ def test_get_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.GetQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_queue), "__call__") as call: @@ -1177,7 +1177,7 @@ def test_get_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1191,7 +1191,7 @@ async def test_get_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.GetQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_queue), "__call__") as call: @@ -1207,7 +1207,7 @@ async def test_get_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1398,7 +1398,7 @@ def test_create_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateQueueRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_queue), "__call__") as call: @@ -1414,7 +1414,7 @@ def test_create_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1428,7 +1428,7 @@ async def test_create_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateQueueRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_queue), "__call__") as call: @@ -1444,7 +1444,7 @@ async def test_create_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1645,7 +1645,7 @@ def test_update_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.UpdateQueueRequest() - request.queue.name = "queue.name/value" + request.queue.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_queue), "__call__") as call: @@ -1661,7 +1661,7 @@ def test_update_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "queue.name=queue.name/value", + "queue.name=name_value", ) in kw["metadata"] @@ -1675,7 +1675,7 @@ async def test_update_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.UpdateQueueRequest() - request.queue.name = "queue.name/value" + request.queue.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_queue), "__call__") as call: @@ -1691,7 +1691,7 @@ async def test_update_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "queue.name=queue.name/value", + "queue.name=name_value", ) in kw["metadata"] @@ -1875,7 +1875,7 @@ def test_delete_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_queue), "__call__") as call: @@ -1891,7 +1891,7 @@ def test_delete_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1905,7 +1905,7 @@ async def test_delete_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_queue), "__call__") as call: @@ -1921,7 +1921,7 @@ async def test_delete_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2112,7 +2112,7 @@ def test_purge_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.PurgeQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_queue), "__call__") as call: @@ -2128,7 +2128,7 @@ def test_purge_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2142,7 +2142,7 @@ async def test_purge_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.PurgeQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_queue), "__call__") as call: @@ -2158,7 +2158,7 @@ async def test_purge_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2349,7 +2349,7 @@ def test_pause_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.PauseQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.pause_queue), "__call__") as call: @@ -2365,7 +2365,7 @@ def test_pause_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2379,7 +2379,7 @@ async def test_pause_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.PauseQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.pause_queue), "__call__") as call: @@ -2395,7 +2395,7 @@ async def test_pause_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2586,7 +2586,7 @@ def test_resume_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.ResumeQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.resume_queue), "__call__") as call: @@ -2602,7 +2602,7 @@ def test_resume_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2616,7 +2616,7 @@ async def test_resume_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.ResumeQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.resume_queue), "__call__") as call: @@ -2632,7 +2632,7 @@ async def test_resume_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2818,7 +2818,7 @@ def test_get_iam_policy_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.GetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -2834,7 +2834,7 @@ def test_get_iam_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -2848,7 +2848,7 @@ async def test_get_iam_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.GetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -2864,7 +2864,7 @@ async def test_get_iam_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3067,7 +3067,7 @@ def test_set_iam_policy_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.SetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -3083,7 +3083,7 @@ def test_set_iam_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3097,7 +3097,7 @@ async def test_set_iam_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.SetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -3113,7 +3113,7 @@ async def test_set_iam_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3320,7 +3320,7 @@ def test_test_iam_permissions_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.TestIamPermissionsRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3338,7 +3338,7 @@ def test_test_iam_permissions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3352,7 +3352,7 @@ async def test_test_iam_permissions_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.TestIamPermissionsRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3372,7 +3372,7 @@ async def test_test_iam_permissions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3589,7 +3589,7 @@ def test_list_tasks_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.ListTasksRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_tasks), "__call__") as call: @@ -3605,7 +3605,7 @@ def test_list_tasks_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3619,7 +3619,7 @@ async def test_list_tasks_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.ListTasksRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_tasks), "__call__") as call: @@ -3637,7 +3637,7 @@ async def test_list_tasks_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3768,7 +3768,7 @@ def test_list_tasks_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, task.Task) for i in results) @@ -4016,7 +4016,7 @@ def test_get_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.GetTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_task), "__call__") as call: @@ -4032,7 +4032,7 @@ def test_get_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4046,7 +4046,7 @@ async def test_get_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.GetTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_task), "__call__") as call: @@ -4062,7 +4062,7 @@ async def test_get_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4251,7 +4251,7 @@ def test_create_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateTaskRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_task), "__call__") as call: @@ -4267,7 +4267,7 @@ def test_create_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4281,7 +4281,7 @@ async def test_create_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateTaskRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_task), "__call__") as call: @@ -4297,7 +4297,7 @@ async def test_create_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4481,7 +4481,7 @@ def test_delete_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_task), "__call__") as call: @@ -4497,7 +4497,7 @@ def test_delete_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4511,7 +4511,7 @@ async def test_delete_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_task), "__call__") as call: @@ -4527,7 +4527,7 @@ async def test_delete_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4703,7 +4703,7 @@ def test_lease_tasks_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.LeaseTasksRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.lease_tasks), "__call__") as call: @@ -4719,7 +4719,7 @@ def test_lease_tasks_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4733,7 +4733,7 @@ async def test_lease_tasks_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.LeaseTasksRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.lease_tasks), "__call__") as call: @@ -4751,7 +4751,7 @@ async def test_lease_tasks_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4937,7 +4937,7 @@ def test_acknowledge_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.AcknowledgeTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.acknowledge_task), "__call__") as call: @@ -4953,7 +4953,7 @@ def test_acknowledge_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4967,7 +4967,7 @@ async def test_acknowledge_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.AcknowledgeTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.acknowledge_task), "__call__") as call: @@ -4983,7 +4983,7 @@ async def test_acknowledge_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5182,7 +5182,7 @@ def test_renew_lease_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.RenewLeaseRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.renew_lease), "__call__") as call: @@ -5198,7 +5198,7 @@ def test_renew_lease_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5212,7 +5212,7 @@ async def test_renew_lease_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.RenewLeaseRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.renew_lease), "__call__") as call: @@ -5228,7 +5228,7 @@ async def test_renew_lease_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5437,7 +5437,7 @@ def test_cancel_lease_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.CancelLeaseRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_lease), "__call__") as call: @@ -5453,7 +5453,7 @@ def test_cancel_lease_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5467,7 +5467,7 @@ async def test_cancel_lease_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.CancelLeaseRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.cancel_lease), "__call__") as call: @@ -5483,7 +5483,7 @@ async def test_cancel_lease_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5682,7 +5682,7 @@ def test_run_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.RunTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.run_task), "__call__") as call: @@ -5698,7 +5698,7 @@ def test_run_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5712,7 +5712,7 @@ async def test_run_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.RunTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.run_task), "__call__") as call: @@ -5728,7 +5728,7 @@ async def test_run_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] diff --git a/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py b/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py index cf998b41..86fa27e3 100644 --- a/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py +++ b/tests/unit/gapic/tasks_v2beta3/test_cloud_tasks.py @@ -732,7 +732,7 @@ def test_list_queues_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.ListQueuesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_queues), "__call__") as call: @@ -748,7 +748,7 @@ def test_list_queues_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -762,7 +762,7 @@ async def test_list_queues_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.ListQueuesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_queues), "__call__") as call: @@ -780,7 +780,7 @@ async def test_list_queues_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -911,7 +911,7 @@ def test_list_queues_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, queue.Queue) for i in results) @@ -1165,7 +1165,7 @@ def test_get_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.GetQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_queue), "__call__") as call: @@ -1181,7 +1181,7 @@ def test_get_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1195,7 +1195,7 @@ async def test_get_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.GetQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_queue), "__call__") as call: @@ -1211,7 +1211,7 @@ async def test_get_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1406,7 +1406,7 @@ def test_create_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateQueueRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_queue), "__call__") as call: @@ -1422,7 +1422,7 @@ def test_create_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1436,7 +1436,7 @@ async def test_create_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateQueueRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_queue), "__call__") as call: @@ -1452,7 +1452,7 @@ async def test_create_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1657,7 +1657,7 @@ def test_update_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.UpdateQueueRequest() - request.queue.name = "queue.name/value" + request.queue.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_queue), "__call__") as call: @@ -1673,7 +1673,7 @@ def test_update_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "queue.name=queue.name/value", + "queue.name=name_value", ) in kw["metadata"] @@ -1687,7 +1687,7 @@ async def test_update_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.UpdateQueueRequest() - request.queue.name = "queue.name/value" + request.queue.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_queue), "__call__") as call: @@ -1703,7 +1703,7 @@ async def test_update_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "queue.name=queue.name/value", + "queue.name=name_value", ) in kw["metadata"] @@ -1887,7 +1887,7 @@ def test_delete_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_queue), "__call__") as call: @@ -1903,7 +1903,7 @@ def test_delete_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1917,7 +1917,7 @@ async def test_delete_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_queue), "__call__") as call: @@ -1933,7 +1933,7 @@ async def test_delete_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2128,7 +2128,7 @@ def test_purge_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.PurgeQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_queue), "__call__") as call: @@ -2144,7 +2144,7 @@ def test_purge_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2158,7 +2158,7 @@ async def test_purge_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.PurgeQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.purge_queue), "__call__") as call: @@ -2174,7 +2174,7 @@ async def test_purge_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2369,7 +2369,7 @@ def test_pause_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.PauseQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.pause_queue), "__call__") as call: @@ -2385,7 +2385,7 @@ def test_pause_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2399,7 +2399,7 @@ async def test_pause_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.PauseQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.pause_queue), "__call__") as call: @@ -2415,7 +2415,7 @@ async def test_pause_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2610,7 +2610,7 @@ def test_resume_queue_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.ResumeQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.resume_queue), "__call__") as call: @@ -2626,7 +2626,7 @@ def test_resume_queue_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2640,7 +2640,7 @@ async def test_resume_queue_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.ResumeQueueRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.resume_queue), "__call__") as call: @@ -2656,7 +2656,7 @@ async def test_resume_queue_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2842,7 +2842,7 @@ def test_get_iam_policy_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.GetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -2858,7 +2858,7 @@ def test_get_iam_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -2872,7 +2872,7 @@ async def test_get_iam_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.GetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_iam_policy), "__call__") as call: @@ -2888,7 +2888,7 @@ async def test_get_iam_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3091,7 +3091,7 @@ def test_set_iam_policy_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.SetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -3107,7 +3107,7 @@ def test_set_iam_policy_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3121,7 +3121,7 @@ async def test_set_iam_policy_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.SetIamPolicyRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.set_iam_policy), "__call__") as call: @@ -3137,7 +3137,7 @@ async def test_set_iam_policy_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3344,7 +3344,7 @@ def test_test_iam_permissions_field_headers(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.TestIamPermissionsRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3362,7 +3362,7 @@ def test_test_iam_permissions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3376,7 +3376,7 @@ async def test_test_iam_permissions_field_headers_async(): # a field header. Set these to a non-empty value. request = iam_policy_pb2.TestIamPermissionsRequest() - request.resource = "resource/value" + request.resource = "resource_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3396,7 +3396,7 @@ async def test_test_iam_permissions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "resource=resource/value", + "resource=resource_value", ) in kw["metadata"] @@ -3613,7 +3613,7 @@ def test_list_tasks_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.ListTasksRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_tasks), "__call__") as call: @@ -3629,7 +3629,7 @@ def test_list_tasks_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3643,7 +3643,7 @@ async def test_list_tasks_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.ListTasksRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_tasks), "__call__") as call: @@ -3661,7 +3661,7 @@ async def test_list_tasks_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3792,7 +3792,7 @@ def test_list_tasks_pager(transport_name: str = "grpc"): assert pager._metadata == metadata - results = [i for i in pager] + results = list(pager) assert len(results) == 6 assert all(isinstance(i, task.Task) for i in results) @@ -4048,7 +4048,7 @@ def test_get_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.GetTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_task), "__call__") as call: @@ -4064,7 +4064,7 @@ def test_get_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4078,7 +4078,7 @@ async def test_get_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.GetTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_task), "__call__") as call: @@ -4094,7 +4094,7 @@ async def test_get_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4291,7 +4291,7 @@ def test_create_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateTaskRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_task), "__call__") as call: @@ -4307,7 +4307,7 @@ def test_create_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4321,7 +4321,7 @@ async def test_create_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.CreateTaskRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_task), "__call__") as call: @@ -4337,7 +4337,7 @@ async def test_create_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -4521,7 +4521,7 @@ def test_delete_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_task), "__call__") as call: @@ -4537,7 +4537,7 @@ def test_delete_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4551,7 +4551,7 @@ async def test_delete_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.DeleteTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_task), "__call__") as call: @@ -4567,7 +4567,7 @@ async def test_delete_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4764,7 +4764,7 @@ def test_run_task_field_headers(): # a field header. Set these to a non-empty value. request = cloudtasks.RunTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.run_task), "__call__") as call: @@ -4780,7 +4780,7 @@ def test_run_task_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4794,7 +4794,7 @@ async def test_run_task_field_headers_async(): # a field header. Set these to a non-empty value. request = cloudtasks.RunTaskRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.run_task), "__call__") as call: @@ -4810,7 +4810,7 @@ async def test_run_task_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] From 8344f2d494773f5759e5663faf763842f129b5ac Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 5 May 2022 23:04:16 +0000 Subject: [PATCH 16/17] chore(python): auto approve template changes (#259) Source-Link: https://github.com/googleapis/synthtool/commit/453a5d9c9a55d1969240a37d36cec626d20a9024 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32 --- .github/.OwlBot.lock.yaml | 4 ++-- .github/auto-approve.yml | 3 +++ scripts/readme-gen/readme_gen.py | 5 ++++- 3 files changed, 9 insertions(+), 3 deletions(-) create mode 100644 .github/auto-approve.yml diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 64f82d6b..757c9dca 100644 --- a/.github/.OwlBot.lock.yaml +++ b/.github/.OwlBot.lock.yaml @@ -13,5 +13,5 @@ # limitations under the License. docker: image: gcr.io/cloud-devrel-public-resources/owlbot-python:latest - digest: sha256:bc5eed3804aec2f05fad42aacf973821d9500c174015341f721a984a0825b6fd -# created: 2022-04-21T15:43:16.246106921Z + digest: sha256:81ed5ecdfc7cac5b699ba4537376f3563f6f04122c4ec9e735d3b3dc1d43dd32 +# created: 2022-05-05T22:08:23.383410683Z diff --git a/.github/auto-approve.yml b/.github/auto-approve.yml new file mode 100644 index 00000000..311ebbb8 --- /dev/null +++ b/.github/auto-approve.yml @@ -0,0 +1,3 @@ +# https://github.com/googleapis/repo-automation-bots/tree/main/packages/auto-approve +processes: + - "OwlBotTemplateChanges" diff --git a/scripts/readme-gen/readme_gen.py b/scripts/readme-gen/readme_gen.py index d309d6e9..91b59676 100644 --- a/scripts/readme-gen/readme_gen.py +++ b/scripts/readme-gen/readme_gen.py @@ -28,7 +28,10 @@ jinja_env = jinja2.Environment( trim_blocks=True, loader=jinja2.FileSystemLoader( - os.path.abspath(os.path.join(os.path.dirname(__file__), 'templates')))) + os.path.abspath(os.path.join(os.path.dirname(__file__), "templates")) + ), + autoescape=True, +) README_TMPL = jinja_env.get_template('README.tmpl.rst') From d24d2f6e26047441aabcccdb62ed4e3df7668c11 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Fri, 6 May 2022 16:52:30 -0700 Subject: [PATCH 17/17] chore(main): release 2.9.0 (#253) Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com> --- CHANGELOG.md | 17 +++++++++++++++++ setup.py | 2 +- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f88a603f..b9252ae9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,23 @@ [1]: https://pypi.org/project/google-cloud-tasks/#history +## [2.9.0](https://github.com/googleapis/python-tasks/compare/v2.8.1...v2.9.0) (2022-05-05) + + +### Features + +* AuditConfig for IAM v1 ([7b7a294](https://github.com/googleapis/python-tasks/commit/7b7a2946a8554a06d8fdc57b13c2726c5d8a443b)) + + +### Bug Fixes + +* **deps:** require grpc-google-iam-v1 >=0.12.4 ([7b7a294](https://github.com/googleapis/python-tasks/commit/7b7a2946a8554a06d8fdc57b13c2726c5d8a443b)) + + +### Documentation + +* fix type in docstring for map fields ([7b7a294](https://github.com/googleapis/python-tasks/commit/7b7a2946a8554a06d8fdc57b13c2726c5d8a443b)) + ### [2.8.1](https://github.com/googleapis/python-tasks/compare/v2.8.0...v2.8.1) (2022-03-05) diff --git a/setup.py b/setup.py index bc30a604..a447bd0f 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ name = "google-cloud-tasks" description = "Cloud Tasks API API client library" -version = "2.8.1" +version = "2.9.0" release_status = "Development Status :: 5 - Production/Stable" dependencies = [ # NOTE: Maintainers, please do not require google-api-core>=2.x.x