From 082afb481ef202a7f42bfc094a3cd1d98a2d91d3 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 7 Mar 2022 20:47:04 +0100 Subject: [PATCH 01/41] chore(deps): update dependency google-cloud-iot to v2.4.1 (#272) --- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index 2ce282d7..4c155baa 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -3,7 +3,7 @@ flaky==3.7.0 google-api-python-client==2.39.0 google-auth-httplib2==0.1.0 google-auth==2.6.0 -google-cloud-iot==2.4.0 +google-cloud-iot==2.4.1 google-cloud-pubsub==2.10.0 google-cloud-storage==2.1.0 paho-mqtt==1.6.1 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index be9f6dc9..a5376bde 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -3,7 +3,7 @@ flaky==3.7.0 google-api-python-client==2.39.0 google-auth-httplib2==0.1.0 google-auth==2.6.0 -google-cloud-iot==2.4.0 +google-cloud-iot==2.4.1 google-cloud-pubsub==2.10.0 paho-mqtt==1.6.1 pyjwt==2.3.0 From 234e1d12a2ba0c1fa34d7930662c7541390e7306 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 10 Mar 2022 11:42:18 +0100 Subject: [PATCH 02/41] chore(deps): update dependency google-cloud-pubsub to v2.11.0 (#273) --- samples/api-client/accesstoken_example/requirements-test.txt | 2 +- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements-test.txt b/samples/api-client/accesstoken_example/requirements-test.txt index 1fb33361..c7aba101 100644 --- a/samples/api-client/accesstoken_example/requirements-test.txt +++ b/samples/api-client/accesstoken_example/requirements-test.txt @@ -1,3 +1,3 @@ pytest==7.0.1 -google-cloud-pubsub==2.10.0 +google-cloud-pubsub==2.11.0 google-cloud-storage==2.1.0 diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index 4c155baa..887bdf90 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -4,7 +4,7 @@ google-api-python-client==2.39.0 google-auth-httplib2==0.1.0 google-auth==2.6.0 google-cloud-iot==2.4.1 -google-cloud-pubsub==2.10.0 +google-cloud-pubsub==2.11.0 google-cloud-storage==2.1.0 paho-mqtt==1.6.1 pyjwt==2.3.0 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index a5376bde..742a6dd3 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -4,6 +4,6 @@ google-api-python-client==2.39.0 google-auth-httplib2==0.1.0 google-auth==2.6.0 google-cloud-iot==2.4.1 -google-cloud-pubsub==2.10.0 +google-cloud-pubsub==2.11.0 paho-mqtt==1.6.1 pyjwt==2.3.0 From 67729a7530277ccb558fe70e1b2e9955f3ffe898 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 10 Mar 2022 18:46:07 +0100 Subject: [PATCH 03/41] chore(deps): update dependency google-api-python-client to v2.40.0 (#274) --- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index 887bdf90..9f767127 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -1,6 +1,6 @@ cryptography==36.0.1 flaky==3.7.0 -google-api-python-client==2.39.0 +google-api-python-client==2.40.0 google-auth-httplib2==0.1.0 google-auth==2.6.0 google-cloud-iot==2.4.1 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index 742a6dd3..e847c8db 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -1,6 +1,6 @@ cryptography==36.0.1 flaky==3.7.0 -google-api-python-client==2.39.0 +google-api-python-client==2.40.0 google-auth-httplib2==0.1.0 google-auth==2.6.0 google-cloud-iot==2.4.1 From 5336f53f2726c5a4897fd0ae576432affa868863 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sun, 13 Mar 2022 21:27:40 +0100 Subject: [PATCH 04/41] chore(deps): update dependency pytest to v7.1.0 (#276) --- samples/api-client/accesstoken_example/requirements-test.txt | 2 +- samples/api-client/manager/requirements-test.txt | 2 +- samples/api-client/mqtt_example/requirements-test.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements-test.txt b/samples/api-client/accesstoken_example/requirements-test.txt index c7aba101..5bc76f8a 100644 --- a/samples/api-client/accesstoken_example/requirements-test.txt +++ b/samples/api-client/accesstoken_example/requirements-test.txt @@ -1,3 +1,3 @@ -pytest==7.0.1 +pytest==7.1.0 google-cloud-pubsub==2.11.0 google-cloud-storage==2.1.0 diff --git a/samples/api-client/manager/requirements-test.txt b/samples/api-client/manager/requirements-test.txt index c2845bff..824a8a7a 100644 --- a/samples/api-client/manager/requirements-test.txt +++ b/samples/api-client/manager/requirements-test.txt @@ -1 +1 @@ -pytest==7.0.1 +pytest==7.1.0 diff --git a/samples/api-client/mqtt_example/requirements-test.txt b/samples/api-client/mqtt_example/requirements-test.txt index c2845bff..824a8a7a 100644 --- a/samples/api-client/mqtt_example/requirements-test.txt +++ b/samples/api-client/mqtt_example/requirements-test.txt @@ -1 +1 @@ -pytest==7.0.1 +pytest==7.1.0 From 12f484fb634c9eedf1d938b71622a92dfef8fc69 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 14 Mar 2022 19:31:35 +0100 Subject: [PATCH 05/41] chore(deps): update dependency google-cloud-storage to v2.2.0 (#277) --- samples/api-client/accesstoken_example/requirements-test.txt | 2 +- samples/api-client/accesstoken_example/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements-test.txt b/samples/api-client/accesstoken_example/requirements-test.txt index 5bc76f8a..e6535df5 100644 --- a/samples/api-client/accesstoken_example/requirements-test.txt +++ b/samples/api-client/accesstoken_example/requirements-test.txt @@ -1,3 +1,3 @@ pytest==7.1.0 google-cloud-pubsub==2.11.0 -google-cloud-storage==2.1.0 +google-cloud-storage==2.2.0 diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index 9f767127..8d9ac6eb 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -5,6 +5,6 @@ google-auth-httplib2==0.1.0 google-auth==2.6.0 google-cloud-iot==2.4.1 google-cloud-pubsub==2.11.0 -google-cloud-storage==2.1.0 +google-cloud-storage==2.2.0 paho-mqtt==1.6.1 pyjwt==2.3.0 From 61709a9fd4e5b3dd47d5be086a55c08409d04c06 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 15 Mar 2022 17:21:25 +0100 Subject: [PATCH 06/41] chore(deps): update dependency google-api-python-client to v2.41.0 (#278) --- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index 8d9ac6eb..dd1c5a66 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -1,6 +1,6 @@ cryptography==36.0.1 flaky==3.7.0 -google-api-python-client==2.40.0 +google-api-python-client==2.41.0 google-auth-httplib2==0.1.0 google-auth==2.6.0 google-cloud-iot==2.4.1 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index e847c8db..ae75ebdd 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -1,6 +1,6 @@ cryptography==36.0.1 flaky==3.7.0 -google-api-python-client==2.40.0 +google-api-python-client==2.41.0 google-auth-httplib2==0.1.0 google-auth==2.6.0 google-cloud-iot==2.4.1 From 37eb87822da3cd6d1a19c5d1249275f62939f233 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 15 Mar 2022 23:01:04 +0100 Subject: [PATCH 07/41] chore(deps): update dependency google-cloud-storage to v2.2.1 (#279) --- samples/api-client/accesstoken_example/requirements-test.txt | 2 +- samples/api-client/accesstoken_example/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements-test.txt b/samples/api-client/accesstoken_example/requirements-test.txt index e6535df5..212b3e89 100644 --- a/samples/api-client/accesstoken_example/requirements-test.txt +++ b/samples/api-client/accesstoken_example/requirements-test.txt @@ -1,3 +1,3 @@ pytest==7.1.0 google-cloud-pubsub==2.11.0 -google-cloud-storage==2.2.0 +google-cloud-storage==2.2.1 diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index dd1c5a66..2a762108 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -5,6 +5,6 @@ google-auth-httplib2==0.1.0 google-auth==2.6.0 google-cloud-iot==2.4.1 google-cloud-pubsub==2.11.0 -google-cloud-storage==2.2.0 +google-cloud-storage==2.2.1 paho-mqtt==1.6.1 pyjwt==2.3.0 From c503eeb478b7f9564b92dbe19235e1a1ac630f2a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 16 Mar 2022 11:48:37 +0100 Subject: [PATCH 08/41] chore(deps): update dependency cryptography to v36.0.2 (#280) --- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index 2a762108..35aecdfa 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -1,4 +1,4 @@ -cryptography==36.0.1 +cryptography==36.0.2 flaky==3.7.0 google-api-python-client==2.41.0 google-auth-httplib2==0.1.0 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index ae75ebdd..7bbf20d9 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -1,4 +1,4 @@ -cryptography==36.0.1 +cryptography==36.0.2 flaky==3.7.0 google-api-python-client==2.41.0 google-auth-httplib2==0.1.0 From 2db9528b78ce136d7d129ea6fb56a3508a3d7537 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Sat, 19 Mar 2022 11:13:15 +0100 Subject: [PATCH 09/41] chore(deps): update all dependencies (#281) --- samples/api-client/accesstoken_example/requirements-test.txt | 2 +- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements-test.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- samples/api-client/mqtt_example/requirements-test.txt | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements-test.txt b/samples/api-client/accesstoken_example/requirements-test.txt index 212b3e89..d2d75af4 100644 --- a/samples/api-client/accesstoken_example/requirements-test.txt +++ b/samples/api-client/accesstoken_example/requirements-test.txt @@ -1,3 +1,3 @@ -pytest==7.1.0 +pytest==7.1.1 google-cloud-pubsub==2.11.0 google-cloud-storage==2.2.1 diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index 35aecdfa..68561d82 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -2,7 +2,7 @@ cryptography==36.0.2 flaky==3.7.0 google-api-python-client==2.41.0 google-auth-httplib2==0.1.0 -google-auth==2.6.0 +google-auth==2.6.2 google-cloud-iot==2.4.1 google-cloud-pubsub==2.11.0 google-cloud-storage==2.2.1 diff --git a/samples/api-client/manager/requirements-test.txt b/samples/api-client/manager/requirements-test.txt index 824a8a7a..4f6bf643 100644 --- a/samples/api-client/manager/requirements-test.txt +++ b/samples/api-client/manager/requirements-test.txt @@ -1 +1 @@ -pytest==7.1.0 +pytest==7.1.1 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index 7bbf20d9..747481b8 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -2,7 +2,7 @@ cryptography==36.0.2 flaky==3.7.0 google-api-python-client==2.41.0 google-auth-httplib2==0.1.0 -google-auth==2.6.0 +google-auth==2.6.2 google-cloud-iot==2.4.1 google-cloud-pubsub==2.11.0 paho-mqtt==1.6.1 diff --git a/samples/api-client/mqtt_example/requirements-test.txt b/samples/api-client/mqtt_example/requirements-test.txt index 824a8a7a..4f6bf643 100644 --- a/samples/api-client/mqtt_example/requirements-test.txt +++ b/samples/api-client/mqtt_example/requirements-test.txt @@ -1 +1 @@ -pytest==7.1.0 +pytest==7.1.1 From df2bf272b1eeb625e780c4bf021857a328903903 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 25 Mar 2022 19:55:23 +0100 Subject: [PATCH 10/41] chore(deps): update dependency google-api-python-client to v2.42.0 (#283) --- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index 68561d82..a5406339 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -1,6 +1,6 @@ cryptography==36.0.2 flaky==3.7.0 -google-api-python-client==2.41.0 +google-api-python-client==2.42.0 google-auth-httplib2==0.1.0 google-auth==2.6.2 google-cloud-iot==2.4.1 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index 747481b8..a3107019 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -1,6 +1,6 @@ cryptography==36.0.2 flaky==3.7.0 -google-api-python-client==2.41.0 +google-api-python-client==2.42.0 google-auth-httplib2==0.1.0 google-auth==2.6.2 google-cloud-iot==2.4.1 From efe5a517a2d00933926e54f9a660fe9a3831e4ba 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 11/41] chore(python): use black==22.3.0 (#287) 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/device_manager/async_client.py | 154 ++- .../iot_v1/services/device_manager/client.py | 206 ++- .../device_manager/transports/base.py | 26 +- .../device_manager/transports/grpc.py | 3 +- google/cloud/iot_v1/types/device_manager.py | 248 +++- google/cloud/iot_v1/types/resources.py | 271 +++- noxfile.py | 9 +- .../api-client/accesstoken_example/noxfile.py | 2 +- samples/api-client/manager/noxfile.py | 2 +- samples/api-client/mqtt_example/noxfile.py | 2 +- .../unit/gapic/iot_v1/test_device_manager.py | 1167 +++++++++++++---- 13 files changed, 1630 insertions(+), 475 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 44c78f7c..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:4e1991042fe54b991db9ca17c8fb386e61b22fe4d1472a568bf0fcac85dcf5d3 + digest: sha256:7cffbc10910c3ab1b852c05114a08d374c195a81cdec1d4a67a1d129331d0bfe diff --git a/docs/conf.py b/docs/conf.py index c85a516a..f82b687a 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-iot", "google-cloud-iot Documentation", [author], 1,) + ( + root_doc, + "google-cloud-iot", + "google-cloud-iot 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/iot_v1/services/device_manager/async_client.py b/google/cloud/iot_v1/services/device_manager/async_client.py index 90cdf082..7a537fb0 100644 --- a/google/cloud/iot_v1/services/device_manager/async_client.py +++ b/google/cloud/iot_v1/services/device_manager/async_client.py @@ -307,7 +307,12 @@ def sample_create_device_registry(): ) # 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 @@ -404,7 +409,12 @@ def sample_get_device_registry(): ) # 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 @@ -508,7 +518,12 @@ def sample_update_device_registry(): ) # 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 @@ -599,7 +614,10 @@ def sample_delete_device_registry(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def list_device_registries( @@ -700,12 +718,20 @@ def sample_list_device_registries(): ) # 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.ListDeviceRegistriesAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -806,7 +832,12 @@ def sample_create_device(): ) # 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 @@ -905,7 +936,12 @@ def sample_get_device(): ) # 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 @@ -1009,7 +1045,12 @@ def sample_update_device(): ) # 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 @@ -1102,7 +1143,10 @@ def sample_delete_device(): # Send the request. await rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) async def list_devices( @@ -1203,12 +1247,20 @@ def sample_list_devices(): ) # 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.ListDevicesAsyncPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1326,7 +1378,12 @@ def sample_modify_cloud_to_device_config(): ) # 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 @@ -1428,7 +1485,12 @@ def sample_list_device_config_versions(): ) # 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 @@ -1529,7 +1591,12 @@ def sample_list_device_states(): ) # 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 @@ -1659,7 +1726,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. @@ -1676,7 +1745,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 @@ -1807,7 +1881,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. @@ -1824,7 +1900,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 @@ -1912,7 +1993,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, @@ -1930,7 +2012,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 @@ -2077,7 +2164,12 @@ def sample_send_command_to_device(): ) # 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 @@ -2187,7 +2279,12 @@ def sample_bind_device_to_gateway(): ) # 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 @@ -2300,7 +2397,12 @@ def sample_unbind_device_from_gateway(): ) # 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 @@ -2314,7 +2416,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-iot",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-iot", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/iot_v1/services/device_manager/client.py b/google/cloud/iot_v1/services/device_manager/client.py index 7807f98d..e55d8e9e 100644 --- a/google/cloud/iot_v1/services/device_manager/client.py +++ b/google/cloud/iot_v1/services/device_manager/client.py @@ -59,7 +59,10 @@ class DeviceManagerClientMeta(type): _transport_registry["grpc"] = DeviceManagerGrpcTransport _transport_registry["grpc_asyncio"] = DeviceManagerGrpcAsyncIOTransport - def get_transport_class(cls, label: str = None,) -> Type[DeviceManagerTransport]: + def get_transport_class( + cls, + label: str = None, + ) -> Type[DeviceManagerTransport]: """Returns an appropriate transport class. Args: @@ -166,10 +169,18 @@ def transport(self) -> DeviceManagerTransport: return self._transport @staticmethod - def device_path(project: str, location: str, registry: str, device: str,) -> str: + def device_path( + project: str, + location: str, + registry: str, + device: str, + ) -> str: """Returns a fully-qualified device string.""" return "projects/{project}/locations/{location}/registries/{registry}/devices/{device}".format( - project=project, location=location, registry=registry, device=device, + project=project, + location=location, + registry=registry, + device=device, ) @staticmethod @@ -182,10 +193,16 @@ def parse_device_path(path: str) -> Dict[str, str]: return m.groupdict() if m else {} @staticmethod - def registry_path(project: str, location: str, registry: str,) -> str: + def registry_path( + project: str, + location: str, + registry: str, + ) -> str: """Returns a fully-qualified registry string.""" return "projects/{project}/locations/{location}/registries/{registry}".format( - project=project, location=location, registry=registry, + project=project, + location=location, + registry=registry, ) @staticmethod @@ -198,7 +215,9 @@ def parse_registry_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, @@ -211,9 +230,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]: @@ -222,9 +245,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]: @@ -233,9 +260,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]: @@ -244,10 +275,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,7 +551,12 @@ def sample_create_device_registry(): ) # 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 @@ -603,7 +643,12 @@ def sample_get_device_registry(): ) # 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 @@ -707,7 +752,12 @@ def sample_update_device_registry(): ) # 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 @@ -788,7 +838,10 @@ def sample_delete_device_registry(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def list_device_registries( @@ -879,12 +932,20 @@ def sample_list_device_registries(): ) # 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.ListDeviceRegistriesPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -985,7 +1046,12 @@ def sample_create_device(): ) # 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 @@ -1074,7 +1140,12 @@ def sample_get_device(): ) # 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 @@ -1178,7 +1249,12 @@ def sample_update_device(): ) # 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 @@ -1261,7 +1337,10 @@ def sample_delete_device(): # Send the request. rpc( - request, retry=retry, timeout=timeout, metadata=metadata, + request, + retry=retry, + timeout=timeout, + metadata=metadata, ) def list_devices( @@ -1352,12 +1431,20 @@ def sample_list_devices(): ) # 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.ListDevicesPager( - method=rpc, request=request, response=response, metadata=metadata, + method=rpc, + request=request, + response=response, + metadata=metadata, ) # Done; return the response. @@ -1466,7 +1553,12 @@ def sample_modify_cloud_to_device_config(): ) # 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 @@ -1560,7 +1652,12 @@ def sample_list_device_config_versions(): ) # 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 @@ -1651,7 +1748,12 @@ def sample_list_device_states(): ) # 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,7 +1899,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 @@ -1944,7 +2051,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 @@ -2049,7 +2161,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 @@ -2185,7 +2302,12 @@ def sample_send_command_to_device(): ) # 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 @@ -2295,7 +2417,12 @@ def sample_bind_device_to_gateway(): ) # 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 @@ -2410,7 +2537,12 @@ def sample_unbind_device_from_gateway(): ) # 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 @@ -2431,7 +2563,9 @@ def __exit__(self, type, value, traceback): try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-iot",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-iot", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() diff --git a/google/cloud/iot_v1/services/device_manager/transports/base.py b/google/cloud/iot_v1/services/device_manager/transports/base.py index 029e3feb..51fe3095 100644 --- a/google/cloud/iot_v1/services/device_manager/transports/base.py +++ b/google/cloud/iot_v1/services/device_manager/transports/base.py @@ -33,7 +33,9 @@ try: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( - gapic_version=pkg_resources.get_distribution("google-cloud-iot",).version, + gapic_version=pkg_resources.get_distribution( + "google-cloud-iot", + ).version, ) except pkg_resources.DistributionNotFound: DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo() @@ -181,7 +183,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.create_device: gapic_v1.method.wrap_method( - self.create_device, default_timeout=120.0, client_info=client_info, + self.create_device, + default_timeout=120.0, + client_info=client_info, ), self.get_device: gapic_v1.method.wrap_method( self.get_device, @@ -199,7 +203,9 @@ def _prep_wrapped_messages(self, client_info): client_info=client_info, ), self.update_device: gapic_v1.method.wrap_method( - self.update_device, default_timeout=120.0, client_info=client_info, + self.update_device, + default_timeout=120.0, + client_info=client_info, ), self.delete_device: gapic_v1.method.wrap_method( self.delete_device, @@ -278,10 +284,14 @@ 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=120.0, client_info=client_info, + self.set_iam_policy, + default_timeout=120.0, + client_info=client_info, ), self.get_iam_policy: gapic_v1.method.wrap_method( - self.get_iam_policy, default_timeout=120.0, client_info=client_info, + self.get_iam_policy, + default_timeout=120.0, + client_info=client_info, ), self.test_iam_permissions: gapic_v1.method.wrap_method( self.test_iam_permissions, @@ -319,9 +329,9 @@ def _prep_wrapped_messages(self, 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/iot_v1/services/device_manager/transports/grpc.py b/google/cloud/iot_v1/services/device_manager/transports/grpc.py index bb5e5d19..ce42385c 100644 --- a/google/cloud/iot_v1/services/device_manager/transports/grpc.py +++ b/google/cloud/iot_v1/services/device_manager/transports/grpc.py @@ -229,8 +229,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/iot_v1/types/device_manager.py b/google/cloud/iot_v1/types/device_manager.py index 60a87da3..579198cd 100644 --- a/google/cloud/iot_v1/types/device_manager.py +++ b/google/cloud/iot_v1/types/device_manager.py @@ -64,9 +64,14 @@ class CreateDeviceRegistryRequest(proto.Message): registry ``id`` provided and the ``parent`` field. """ - parent = proto.Field(proto.STRING, number=1,) + parent = proto.Field( + proto.STRING, + number=1, + ) device_registry = proto.Field( - proto.MESSAGE, number=2, message=resources.DeviceRegistry, + proto.MESSAGE, + number=2, + message=resources.DeviceRegistry, ) @@ -79,7 +84,10 @@ class GetDeviceRegistryRequest(proto.Message): ``projects/example-project/locations/us-central1/registries/my-registry``. """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class DeleteDeviceRegistryRequest(proto.Message): @@ -91,7 +99,10 @@ class DeleteDeviceRegistryRequest(proto.Message): ``projects/example-project/locations/us-central1/registries/my-registry``. """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class UpdateDeviceRegistryRequest(proto.Message): @@ -113,10 +124,14 @@ class UpdateDeviceRegistryRequest(proto.Message): """ device_registry = proto.Field( - proto.MESSAGE, number=1, message=resources.DeviceRegistry, + proto.MESSAGE, + number=1, + message=resources.DeviceRegistry, ) update_mask = proto.Field( - proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=2, + message=field_mask_pb2.FieldMask, ) @@ -140,9 +155,18 @@ class ListDeviceRegistriesRequest(proto.Message): the system should return the next page of data. """ - parent = proto.Field(proto.STRING, number=1,) - page_size = proto.Field(proto.INT32, number=2,) - page_token = proto.Field(proto.STRING, number=3,) + parent = proto.Field( + proto.STRING, + number=1, + ) + page_size = proto.Field( + proto.INT32, + number=2, + ) + page_token = proto.Field( + proto.STRING, + number=3, + ) class ListDeviceRegistriesResponse(proto.Message): @@ -162,9 +186,14 @@ def raw_page(self): return self device_registries = proto.RepeatedField( - proto.MESSAGE, number=1, message=resources.DeviceRegistry, + proto.MESSAGE, + number=1, + message=resources.DeviceRegistry, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, ) - next_page_token = proto.Field(proto.STRING, number=2,) class CreateDeviceRequest(proto.Message): @@ -181,8 +210,15 @@ class CreateDeviceRequest(proto.Message): the device registry ``id`` and the ``parent`` field. """ - parent = proto.Field(proto.STRING, number=1,) - device = proto.Field(proto.MESSAGE, number=2, message=resources.Device,) + parent = proto.Field( + proto.STRING, + number=1, + ) + device = proto.Field( + proto.MESSAGE, + number=2, + message=resources.Device, + ) class GetDeviceRequest(proto.Message): @@ -201,8 +237,15 @@ class GetDeviceRequest(proto.Message): format, for example: ``last_heartbeat_time``. """ - name = proto.Field(proto.STRING, number=1,) - field_mask = proto.Field(proto.MESSAGE, number=2, message=field_mask_pb2.FieldMask,) + name = proto.Field( + proto.STRING, + number=1, + ) + field_mask = proto.Field( + proto.MESSAGE, + number=2, + message=field_mask_pb2.FieldMask, + ) class UpdateDeviceRequest(proto.Message): @@ -223,9 +266,15 @@ class UpdateDeviceRequest(proto.Message): ``metadata`` """ - device = proto.Field(proto.MESSAGE, number=2, message=resources.Device,) + device = proto.Field( + proto.MESSAGE, + number=2, + message=resources.Device, + ) update_mask = proto.Field( - proto.MESSAGE, number=3, message=field_mask_pb2.FieldMask, + proto.MESSAGE, + number=3, + message=field_mask_pb2.FieldMask, ) @@ -240,7 +289,10 @@ class DeleteDeviceRequest(proto.Message): ``projects/p0/locations/us-central1/registries/registry0/devices/{num_id}``. """ - name = proto.Field(proto.STRING, number=1,) + name = proto.Field( + proto.STRING, + number=1, + ) class ListDevicesRequest(proto.Message): @@ -277,15 +329,36 @@ class ListDevicesRequest(proto.Message): page of data. """ - parent = proto.Field(proto.STRING, number=1,) - device_num_ids = proto.RepeatedField(proto.UINT64, number=2,) - device_ids = proto.RepeatedField(proto.STRING, number=3,) - field_mask = proto.Field(proto.MESSAGE, number=4, message=field_mask_pb2.FieldMask,) + parent = proto.Field( + proto.STRING, + number=1, + ) + device_num_ids = proto.RepeatedField( + proto.UINT64, + number=2, + ) + device_ids = proto.RepeatedField( + proto.STRING, + number=3, + ) + field_mask = proto.Field( + proto.MESSAGE, + number=4, + message=field_mask_pb2.FieldMask, + ) gateway_list_options = proto.Field( - proto.MESSAGE, number=6, message="GatewayListOptions", + proto.MESSAGE, + number=6, + message="GatewayListOptions", + ) + page_size = proto.Field( + proto.INT32, + number=100, + ) + page_token = proto.Field( + proto.STRING, + number=101, ) - page_size = proto.Field(proto.INT32, number=100,) - page_token = proto.Field(proto.STRING, number=101,) class GatewayListOptions(proto.Message): @@ -326,10 +399,21 @@ class GatewayListOptions(proto.Message): """ gateway_type = proto.Field( - proto.ENUM, number=1, oneof="filter", enum=resources.GatewayType, + proto.ENUM, + number=1, + oneof="filter", + enum=resources.GatewayType, + ) + associations_gateway_id = proto.Field( + proto.STRING, + number=2, + oneof="filter", + ) + associations_device_id = proto.Field( + proto.STRING, + number=3, + oneof="filter", ) - associations_gateway_id = proto.Field(proto.STRING, number=2, oneof="filter",) - associations_device_id = proto.Field(proto.STRING, number=3, oneof="filter",) class ListDevicesResponse(proto.Message): @@ -348,8 +432,15 @@ class ListDevicesResponse(proto.Message): def raw_page(self): return self - devices = proto.RepeatedField(proto.MESSAGE, number=1, message=resources.Device,) - next_page_token = proto.Field(proto.STRING, number=2,) + devices = proto.RepeatedField( + proto.MESSAGE, + number=1, + message=resources.Device, + ) + next_page_token = proto.Field( + proto.STRING, + number=2, + ) class ModifyCloudToDeviceConfigRequest(proto.Message): @@ -375,9 +466,18 @@ class ModifyCloudToDeviceConfigRequest(proto.Message): device. """ - name = proto.Field(proto.STRING, number=1,) - version_to_update = proto.Field(proto.INT64, number=2,) - binary_data = proto.Field(proto.BYTES, number=3,) + name = proto.Field( + proto.STRING, + number=1, + ) + version_to_update = proto.Field( + proto.INT64, + number=2, + ) + binary_data = proto.Field( + proto.BYTES, + number=3, + ) class ListDeviceConfigVersionsRequest(proto.Message): @@ -397,8 +497,14 @@ class ListDeviceConfigVersionsRequest(proto.Message): the versions available. """ - name = proto.Field(proto.STRING, number=1,) - num_versions = proto.Field(proto.INT32, number=2,) + name = proto.Field( + proto.STRING, + number=1, + ) + num_versions = proto.Field( + proto.INT32, + number=2, + ) class ListDeviceConfigVersionsResponse(proto.Message): @@ -412,7 +518,9 @@ class ListDeviceConfigVersionsResponse(proto.Message): """ device_configs = proto.RepeatedField( - proto.MESSAGE, number=1, message=resources.DeviceConfig, + proto.MESSAGE, + number=1, + message=resources.DeviceConfig, ) @@ -433,8 +541,14 @@ class ListDeviceStatesRequest(proto.Message): available. """ - name = proto.Field(proto.STRING, number=1,) - num_states = proto.Field(proto.INT32, number=2,) + name = proto.Field( + proto.STRING, + number=1, + ) + num_states = proto.Field( + proto.INT32, + number=2, + ) class ListDeviceStatesResponse(proto.Message): @@ -448,7 +562,9 @@ class ListDeviceStatesResponse(proto.Message): """ device_states = proto.RepeatedField( - proto.MESSAGE, number=1, message=resources.DeviceState, + proto.MESSAGE, + number=1, + message=resources.DeviceState, ) @@ -476,14 +592,22 @@ class SendCommandToDeviceRequest(proto.Message): null characters. """ - name = proto.Field(proto.STRING, number=1,) - binary_data = proto.Field(proto.BYTES, number=2,) - subfolder = proto.Field(proto.STRING, number=3,) + name = proto.Field( + proto.STRING, + number=1, + ) + binary_data = proto.Field( + proto.BYTES, + number=2, + ) + subfolder = proto.Field( + proto.STRING, + number=3, + ) class SendCommandToDeviceResponse(proto.Message): - r"""Response for ``SendCommandToDevice``. - """ + r"""Response for ``SendCommandToDevice``.""" class BindDeviceToGatewayRequest(proto.Message): @@ -502,14 +626,22 @@ class BindDeviceToGatewayRequest(proto.Message): numeric ID or the user-defined device identifier. """ - parent = proto.Field(proto.STRING, number=1,) - gateway_id = proto.Field(proto.STRING, number=2,) - device_id = proto.Field(proto.STRING, number=3,) + parent = proto.Field( + proto.STRING, + number=1, + ) + gateway_id = proto.Field( + proto.STRING, + number=2, + ) + device_id = proto.Field( + proto.STRING, + number=3, + ) class BindDeviceToGatewayResponse(proto.Message): - r"""Response for ``BindDeviceToGateway``. - """ + r"""Response for ``BindDeviceToGateway``.""" class UnbindDeviceFromGatewayRequest(proto.Message): @@ -528,14 +660,22 @@ class UnbindDeviceFromGatewayRequest(proto.Message): numeric ID or the user-defined device identifier. """ - parent = proto.Field(proto.STRING, number=1,) - gateway_id = proto.Field(proto.STRING, number=2,) - device_id = proto.Field(proto.STRING, number=3,) + parent = proto.Field( + proto.STRING, + number=1, + ) + gateway_id = proto.Field( + proto.STRING, + number=2, + ) + device_id = proto.Field( + proto.STRING, + number=3, + ) class UnbindDeviceFromGatewayResponse(proto.Message): - r"""Response for ``UnbindDeviceFromGateway``. - """ + r"""Response for ``UnbindDeviceFromGateway``.""" __all__ = tuple(sorted(__protobuf__.manifest)) diff --git a/google/cloud/iot_v1/types/resources.py b/google/cloud/iot_v1/types/resources.py index 51869023..23c05a25 100644 --- a/google/cloud/iot_v1/types/resources.py +++ b/google/cloud/iot_v1/types/resources.py @@ -213,39 +213,87 @@ class Device(proto.Message): Gateway-related configuration and state. """ - id = proto.Field(proto.STRING, number=1,) - name = proto.Field(proto.STRING, number=2,) - num_id = proto.Field(proto.UINT64, number=3,) + id = proto.Field( + proto.STRING, + number=1, + ) + name = proto.Field( + proto.STRING, + number=2, + ) + num_id = proto.Field( + proto.UINT64, + number=3, + ) credentials = proto.RepeatedField( - proto.MESSAGE, number=12, message="DeviceCredential", + proto.MESSAGE, + number=12, + message="DeviceCredential", ) last_heartbeat_time = proto.Field( - proto.MESSAGE, number=7, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=7, + message=timestamp_pb2.Timestamp, ) last_event_time = proto.Field( - proto.MESSAGE, number=8, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=8, + message=timestamp_pb2.Timestamp, ) last_state_time = proto.Field( - proto.MESSAGE, number=20, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=20, + message=timestamp_pb2.Timestamp, ) last_config_ack_time = proto.Field( - proto.MESSAGE, number=14, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=14, + message=timestamp_pb2.Timestamp, ) last_config_send_time = proto.Field( - proto.MESSAGE, number=18, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=18, + message=timestamp_pb2.Timestamp, + ) + blocked = proto.Field( + proto.BOOL, + number=19, ) - blocked = proto.Field(proto.BOOL, number=19,) last_error_time = proto.Field( - proto.MESSAGE, number=10, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=10, + message=timestamp_pb2.Timestamp, ) last_error_status = proto.Field( - proto.MESSAGE, number=11, message=status_pb2.Status, + proto.MESSAGE, + number=11, + message=status_pb2.Status, + ) + config = proto.Field( + proto.MESSAGE, + number=13, + message="DeviceConfig", + ) + state = proto.Field( + proto.MESSAGE, + number=16, + message="DeviceState", + ) + log_level = proto.Field( + proto.ENUM, + number=21, + enum="LogLevel", + ) + metadata = proto.MapField( + proto.STRING, + proto.STRING, + number=17, + ) + gateway_config = proto.Field( + proto.MESSAGE, + number=24, + message="GatewayConfig", ) - config = proto.Field(proto.MESSAGE, number=13, message="DeviceConfig",) - state = proto.Field(proto.MESSAGE, number=16, message="DeviceState",) - log_level = proto.Field(proto.ENUM, number=21, enum="LogLevel",) - metadata = proto.MapField(proto.STRING, proto.STRING, number=17,) - gateway_config = proto.Field(proto.MESSAGE, number=24, message="GatewayConfig",) class GatewayConfig(proto.Message): @@ -265,11 +313,24 @@ class GatewayConfig(proto.Message): accessed the gateway specified in ``last_accessed_gateway``. """ - gateway_type = proto.Field(proto.ENUM, number=1, enum="GatewayType",) - gateway_auth_method = proto.Field(proto.ENUM, number=2, enum="GatewayAuthMethod",) - last_accessed_gateway_id = proto.Field(proto.STRING, number=3,) + gateway_type = proto.Field( + proto.ENUM, + number=1, + enum="GatewayType", + ) + gateway_auth_method = proto.Field( + proto.ENUM, + number=2, + enum="GatewayAuthMethod", + ) + last_accessed_gateway_id = proto.Field( + proto.STRING, + number=3, + ) last_accessed_gateway_time = proto.Field( - proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=4, + message=timestamp_pb2.Timestamp, ) @@ -338,19 +399,43 @@ class DeviceRegistry(proto.Message): are revoked, deleted, or modified. """ - id = proto.Field(proto.STRING, number=1,) - name = proto.Field(proto.STRING, number=2,) + id = proto.Field( + proto.STRING, + number=1, + ) + name = proto.Field( + proto.STRING, + number=2, + ) event_notification_configs = proto.RepeatedField( - proto.MESSAGE, number=10, message="EventNotificationConfig", + proto.MESSAGE, + number=10, + message="EventNotificationConfig", ) state_notification_config = proto.Field( - proto.MESSAGE, number=7, message="StateNotificationConfig", + proto.MESSAGE, + number=7, + message="StateNotificationConfig", + ) + mqtt_config = proto.Field( + proto.MESSAGE, + number=4, + message="MqttConfig", + ) + http_config = proto.Field( + proto.MESSAGE, + number=9, + message="HttpConfig", + ) + log_level = proto.Field( + proto.ENUM, + number=11, + enum="LogLevel", ) - mqtt_config = proto.Field(proto.MESSAGE, number=4, message="MqttConfig",) - http_config = proto.Field(proto.MESSAGE, number=9, message="HttpConfig",) - log_level = proto.Field(proto.ENUM, number=11, enum="LogLevel",) credentials = proto.RepeatedField( - proto.MESSAGE, number=8, message="RegistryCredential", + proto.MESSAGE, + number=8, + message="RegistryCredential", ) @@ -364,7 +449,11 @@ class MqttConfig(proto.Message): registry will fail. """ - mqtt_enabled_state = proto.Field(proto.ENUM, number=1, enum="MqttState",) + mqtt_enabled_state = proto.Field( + proto.ENUM, + number=1, + enum="MqttState", + ) class HttpConfig(proto.Message): @@ -378,7 +467,11 @@ class HttpConfig(proto.Message): registry. """ - http_enabled_state = proto.Field(proto.ENUM, number=1, enum="HttpState",) + http_enabled_state = proto.Field( + proto.ENUM, + number=1, + enum="HttpState", + ) class EventNotificationConfig(proto.Message): @@ -397,8 +490,14 @@ class EventNotificationConfig(proto.Message): ``projects/myProject/topics/deviceEvents``. """ - subfolder_matches = proto.Field(proto.STRING, number=2,) - pubsub_topic_name = proto.Field(proto.STRING, number=1,) + subfolder_matches = proto.Field( + proto.STRING, + number=2, + ) + pubsub_topic_name = proto.Field( + proto.STRING, + number=1, + ) class StateNotificationConfig(proto.Message): @@ -411,7 +510,10 @@ class StateNotificationConfig(proto.Message): ``projects/myProject/topics/deviceEvents``. """ - pubsub_topic_name = proto.Field(proto.STRING, number=1,) + pubsub_topic_name = proto.Field( + proto.STRING, + number=1, + ) class RegistryCredential(proto.Message): @@ -430,7 +532,10 @@ class RegistryCredential(proto.Message): """ public_key_certificate = proto.Field( - proto.MESSAGE, number=1, oneof="credential", message="PublicKeyCertificate", + proto.MESSAGE, + number=1, + oneof="credential", + message="PublicKeyCertificate", ) @@ -454,12 +559,32 @@ class X509CertificateDetails(proto.Message): The type of public key in the certificate. """ - issuer = proto.Field(proto.STRING, number=1,) - subject = proto.Field(proto.STRING, number=2,) - start_time = proto.Field(proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp,) - expiry_time = proto.Field(proto.MESSAGE, number=4, message=timestamp_pb2.Timestamp,) - signature_algorithm = proto.Field(proto.STRING, number=5,) - public_key_type = proto.Field(proto.STRING, number=6,) + issuer = proto.Field( + proto.STRING, + number=1, + ) + subject = proto.Field( + proto.STRING, + number=2, + ) + start_time = proto.Field( + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + expiry_time = proto.Field( + proto.MESSAGE, + number=4, + message=timestamp_pb2.Timestamp, + ) + signature_algorithm = proto.Field( + proto.STRING, + number=5, + ) + public_key_type = proto.Field( + proto.STRING, + number=6, + ) class PublicKeyCertificate(proto.Message): @@ -475,10 +600,19 @@ class PublicKeyCertificate(proto.Message): certificates. """ - format = proto.Field(proto.ENUM, number=1, enum="PublicKeyCertificateFormat",) - certificate = proto.Field(proto.STRING, number=2,) + format = proto.Field( + proto.ENUM, + number=1, + enum="PublicKeyCertificateFormat", + ) + certificate = proto.Field( + proto.STRING, + number=2, + ) x509_details = proto.Field( - proto.MESSAGE, number=3, message="X509CertificateDetails", + proto.MESSAGE, + number=3, + message="X509CertificateDetails", ) @@ -515,10 +649,15 @@ class DeviceCredential(proto.Message): """ public_key = proto.Field( - proto.MESSAGE, number=2, oneof="credential", message="PublicKeyCredential", + proto.MESSAGE, + number=2, + oneof="credential", + message="PublicKeyCredential", ) expiration_time = proto.Field( - proto.MESSAGE, number=6, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=6, + message=timestamp_pb2.Timestamp, ) @@ -532,8 +671,15 @@ class PublicKeyCredential(proto.Message): The key data. """ - format = proto.Field(proto.ENUM, number=1, enum="PublicKeyFormat",) - key = proto.Field(proto.STRING, number=2,) + format = proto.Field( + proto.ENUM, + number=1, + enum="PublicKeyFormat", + ) + key = proto.Field( + proto.STRING, + number=2, + ) class DeviceConfig(proto.Message): @@ -566,14 +712,24 @@ class DeviceConfig(proto.Message): The device configuration data. """ - version = proto.Field(proto.INT64, number=1,) + version = proto.Field( + proto.INT64, + number=1, + ) cloud_update_time = proto.Field( - proto.MESSAGE, number=2, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=2, + message=timestamp_pb2.Timestamp, ) device_ack_time = proto.Field( - proto.MESSAGE, number=3, message=timestamp_pb2.Timestamp, + proto.MESSAGE, + number=3, + message=timestamp_pb2.Timestamp, + ) + binary_data = proto.Field( + proto.BYTES, + number=4, ) - binary_data = proto.Field(proto.BYTES, number=4,) class DeviceState(proto.Message): @@ -587,8 +743,15 @@ class DeviceState(proto.Message): The device state data. """ - update_time = proto.Field(proto.MESSAGE, number=1, message=timestamp_pb2.Timestamp,) - binary_data = proto.Field(proto.BYTES, number=2,) + update_time = proto.Field( + proto.MESSAGE, + number=1, + message=timestamp_pb2.Timestamp, + ) + binary_data = proto.Field( + proto.BYTES, + number=2, + ) __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/api-client/accesstoken_example/noxfile.py b/samples/api-client/accesstoken_example/noxfile.py index 400396ce..11c47695 100644 --- a/samples/api-client/accesstoken_example/noxfile.py +++ b/samples/api-client/accesstoken_example/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. diff --git a/samples/api-client/manager/noxfile.py b/samples/api-client/manager/noxfile.py index 4c808af7..949e0fde 100644 --- a/samples/api-client/manager/noxfile.py +++ b/samples/api-client/manager/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. diff --git a/samples/api-client/mqtt_example/noxfile.py b/samples/api-client/mqtt_example/noxfile.py index 400396ce..11c47695 100644 --- a/samples/api-client/mqtt_example/noxfile.py +++ b/samples/api-client/mqtt_example/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. diff --git a/tests/unit/gapic/iot_v1/test_device_manager.py b/tests/unit/gapic/iot_v1/test_device_manager.py index 7d97fad1..07bef675 100644 --- a/tests/unit/gapic/iot_v1/test_device_manager.py +++ b/tests/unit/gapic/iot_v1/test_device_manager.py @@ -94,7 +94,11 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", [DeviceManagerClient, DeviceManagerAsyncClient,] + "client_class", + [ + DeviceManagerClient, + DeviceManagerAsyncClient, + ], ) def test_device_manager_client_from_service_account_info(client_class): creds = ga_credentials.AnonymousCredentials() @@ -136,7 +140,11 @@ def test_device_manager_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", [DeviceManagerClient, DeviceManagerAsyncClient,] + "client_class", + [ + DeviceManagerClient, + DeviceManagerAsyncClient, + ], ) def test_device_manager_client_from_service_account_file(client_class): creds = ga_credentials.AnonymousCredentials() @@ -500,7 +508,9 @@ def test_device_manager_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) @@ -644,11 +654,16 @@ def test_device_manager_client_create_channel_credentials_file( @pytest.mark.parametrize( - "request_type", [device_manager.CreateDeviceRegistryRequest, dict,] + "request_type", + [ + device_manager.CreateDeviceRegistryRequest, + dict, + ], ) def test_create_device_registry(request_type, transport: str = "grpc"): client = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -661,7 +676,9 @@ def test_create_device_registry(request_type, transport: str = "grpc"): ) as call: # Designate an appropriate return value for the call. call.return_value = resources.DeviceRegistry( - id="id_value", name="name_value", log_level=resources.LogLevel.NONE, + id="id_value", + name="name_value", + log_level=resources.LogLevel.NONE, ) response = client.create_device_registry(request) @@ -681,7 +698,8 @@ def test_create_device_registry_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 = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -700,7 +718,8 @@ async def test_create_device_registry_async( request_type=device_manager.CreateDeviceRegistryRequest, ): client = DeviceManagerAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -714,7 +733,9 @@ async def test_create_device_registry_async( # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( resources.DeviceRegistry( - id="id_value", name="name_value", log_level=resources.LogLevel.NONE, + id="id_value", + name="name_value", + log_level=resources.LogLevel.NONE, ) ) response = await client.create_device_registry(request) @@ -737,7 +758,9 @@ async def test_create_device_registry_async_from_dict(): def test_create_device_registry_field_headers(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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. @@ -759,7 +782,10 @@ def test_create_device_registry_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 @@ -790,11 +816,16 @@ async def test_create_device_registry_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_device_registry_flattened(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -822,7 +853,9 @@ def test_create_device_registry_flattened(): def test_create_device_registry_flattened_error(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -886,11 +919,16 @@ async def test_create_device_registry_flattened_error_async(): @pytest.mark.parametrize( - "request_type", [device_manager.GetDeviceRegistryRequest, dict,] + "request_type", + [ + device_manager.GetDeviceRegistryRequest, + dict, + ], ) def test_get_device_registry(request_type, transport: str = "grpc"): client = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -903,7 +941,9 @@ def test_get_device_registry(request_type, transport: str = "grpc"): ) as call: # Designate an appropriate return value for the call. call.return_value = resources.DeviceRegistry( - id="id_value", name="name_value", log_level=resources.LogLevel.NONE, + id="id_value", + name="name_value", + log_level=resources.LogLevel.NONE, ) response = client.get_device_registry(request) @@ -923,7 +963,8 @@ def test_get_device_registry_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 = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -942,7 +983,8 @@ async def test_get_device_registry_async( request_type=device_manager.GetDeviceRegistryRequest, ): client = DeviceManagerAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -956,7 +998,9 @@ async def test_get_device_registry_async( # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( resources.DeviceRegistry( - id="id_value", name="name_value", log_level=resources.LogLevel.NONE, + id="id_value", + name="name_value", + log_level=resources.LogLevel.NONE, ) ) response = await client.get_device_registry(request) @@ -979,7 +1023,9 @@ async def test_get_device_registry_async_from_dict(): def test_get_device_registry_field_headers(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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. @@ -1001,7 +1047,10 @@ def test_get_device_registry_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 @@ -1032,11 +1081,16 @@ async def test_get_device_registry_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_device_registry_flattened(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1046,7 +1100,9 @@ def test_get_device_registry_flattened(): call.return_value = resources.DeviceRegistry() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_device_registry(name="name_value",) + client.get_device_registry( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1058,13 +1114,16 @@ def test_get_device_registry_flattened(): def test_get_device_registry_flattened_error(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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_device_registry( - device_manager.GetDeviceRegistryRequest(), name="name_value", + device_manager.GetDeviceRegistryRequest(), + name="name_value", ) @@ -1086,7 +1145,9 @@ async def test_get_device_registry_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_device_registry(name="name_value",) + response = await client.get_device_registry( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1107,16 +1168,22 @@ async def test_get_device_registry_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.get_device_registry( - device_manager.GetDeviceRegistryRequest(), name="name_value", + device_manager.GetDeviceRegistryRequest(), + name="name_value", ) @pytest.mark.parametrize( - "request_type", [device_manager.UpdateDeviceRegistryRequest, dict,] + "request_type", + [ + device_manager.UpdateDeviceRegistryRequest, + dict, + ], ) def test_update_device_registry(request_type, transport: str = "grpc"): client = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1129,7 +1196,9 @@ def test_update_device_registry(request_type, transport: str = "grpc"): ) as call: # Designate an appropriate return value for the call. call.return_value = resources.DeviceRegistry( - id="id_value", name="name_value", log_level=resources.LogLevel.NONE, + id="id_value", + name="name_value", + log_level=resources.LogLevel.NONE, ) response = client.update_device_registry(request) @@ -1149,7 +1218,8 @@ def test_update_device_registry_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 = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1168,7 +1238,8 @@ async def test_update_device_registry_async( request_type=device_manager.UpdateDeviceRegistryRequest, ): client = DeviceManagerAsyncClient( - 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 +1253,9 @@ async def test_update_device_registry_async( # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( resources.DeviceRegistry( - id="id_value", name="name_value", log_level=resources.LogLevel.NONE, + id="id_value", + name="name_value", + log_level=resources.LogLevel.NONE, ) ) response = await client.update_device_registry(request) @@ -1205,7 +1278,9 @@ async def test_update_device_registry_async_from_dict(): def test_update_device_registry_field_headers(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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. @@ -1268,7 +1343,9 @@ async def test_update_device_registry_field_headers_async(): def test_update_device_registry_flattened(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1296,7 +1373,9 @@ def test_update_device_registry_flattened(): def test_update_device_registry_flattened_error(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -1360,11 +1439,16 @@ async def test_update_device_registry_flattened_error_async(): @pytest.mark.parametrize( - "request_type", [device_manager.DeleteDeviceRegistryRequest, dict,] + "request_type", + [ + device_manager.DeleteDeviceRegistryRequest, + dict, + ], ) def test_delete_device_registry(request_type, transport: str = "grpc"): client = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1392,7 +1476,8 @@ def test_delete_device_registry_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 = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1411,7 +1496,8 @@ async def test_delete_device_registry_async( request_type=device_manager.DeleteDeviceRegistryRequest, ): client = DeviceManagerAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1441,7 +1527,9 @@ async def test_delete_device_registry_async_from_dict(): def test_delete_device_registry_field_headers(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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,7 +1551,10 @@ def test_delete_device_registry_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 @@ -1492,11 +1583,16 @@ async def test_delete_device_registry_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_device_registry_flattened(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1506,7 +1602,9 @@ def test_delete_device_registry_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_device_registry(name="name_value",) + client.delete_device_registry( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1518,13 +1616,16 @@ def test_delete_device_registry_flattened(): def test_delete_device_registry_flattened_error(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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_device_registry( - device_manager.DeleteDeviceRegistryRequest(), name="name_value", + device_manager.DeleteDeviceRegistryRequest(), + name="name_value", ) @@ -1544,7 +1645,9 @@ async def test_delete_device_registry_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_device_registry(name="name_value",) + response = await client.delete_device_registry( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1565,16 +1668,22 @@ async def test_delete_device_registry_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.delete_device_registry( - device_manager.DeleteDeviceRegistryRequest(), name="name_value", + device_manager.DeleteDeviceRegistryRequest(), + name="name_value", ) @pytest.mark.parametrize( - "request_type", [device_manager.ListDeviceRegistriesRequest, dict,] + "request_type", + [ + device_manager.ListDeviceRegistriesRequest, + dict, + ], ) def test_list_device_registries(request_type, transport: str = "grpc"): client = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1605,7 +1714,8 @@ def test_list_device_registries_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 = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -1624,7 +1734,8 @@ async def test_list_device_registries_async( request_type=device_manager.ListDeviceRegistriesRequest, ): client = DeviceManagerAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -1659,7 +1770,9 @@ async def test_list_device_registries_async_from_dict(): def test_list_device_registries_field_headers(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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. @@ -1681,7 +1794,10 @@ def test_list_device_registries_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 @@ -1712,11 +1828,16 @@ async def test_list_device_registries_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_device_registries_flattened(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1726,7 +1847,9 @@ def test_list_device_registries_flattened(): call.return_value = device_manager.ListDeviceRegistriesResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_device_registries(parent="parent_value",) + client.list_device_registries( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1738,13 +1861,16 @@ def test_list_device_registries_flattened(): def test_list_device_registries_flattened_error(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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_device_registries( - device_manager.ListDeviceRegistriesRequest(), parent="parent_value", + device_manager.ListDeviceRegistriesRequest(), + parent="parent_value", ) @@ -1766,7 +1892,9 @@ async def test_list_device_registries_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_device_registries(parent="parent_value",) + response = await client.list_device_registries( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -1787,13 +1915,15 @@ async def test_list_device_registries_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.list_device_registries( - device_manager.ListDeviceRegistriesRequest(), parent="parent_value", + device_manager.ListDeviceRegistriesRequest(), + parent="parent_value", ) def test_list_device_registries_pager(transport_name: str = "grpc"): client = DeviceManagerClient( - 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. @@ -1811,10 +1941,14 @@ def test_list_device_registries_pager(transport_name: str = "grpc"): next_page_token="abc", ), device_manager.ListDeviceRegistriesResponse( - device_registries=[], next_page_token="def", + device_registries=[], + next_page_token="def", ), device_manager.ListDeviceRegistriesResponse( - device_registries=[resources.DeviceRegistry(),], next_page_token="ghi", + device_registries=[ + resources.DeviceRegistry(), + ], + next_page_token="ghi", ), device_manager.ListDeviceRegistriesResponse( device_registries=[ @@ -1840,7 +1974,8 @@ def test_list_device_registries_pager(transport_name: str = "grpc"): def test_list_device_registries_pages(transport_name: str = "grpc"): client = DeviceManagerClient( - 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. @@ -1858,10 +1993,14 @@ def test_list_device_registries_pages(transport_name: str = "grpc"): next_page_token="abc", ), device_manager.ListDeviceRegistriesResponse( - device_registries=[], next_page_token="def", + device_registries=[], + next_page_token="def", ), device_manager.ListDeviceRegistriesResponse( - device_registries=[resources.DeviceRegistry(),], next_page_token="ghi", + device_registries=[ + resources.DeviceRegistry(), + ], + next_page_token="ghi", ), device_manager.ListDeviceRegistriesResponse( device_registries=[ @@ -1878,7 +2017,9 @@ def test_list_device_registries_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_device_registries_async_pager(): - client = DeviceManagerAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DeviceManagerAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1897,10 +2038,14 @@ async def test_list_device_registries_async_pager(): next_page_token="abc", ), device_manager.ListDeviceRegistriesResponse( - device_registries=[], next_page_token="def", + device_registries=[], + next_page_token="def", ), device_manager.ListDeviceRegistriesResponse( - device_registries=[resources.DeviceRegistry(),], next_page_token="ghi", + device_registries=[ + resources.DeviceRegistry(), + ], + next_page_token="ghi", ), device_manager.ListDeviceRegistriesResponse( device_registries=[ @@ -1910,7 +2055,9 @@ async def test_list_device_registries_async_pager(): ), RuntimeError, ) - async_pager = await client.list_device_registries(request={},) + async_pager = await client.list_device_registries( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -1922,7 +2069,9 @@ async def test_list_device_registries_async_pager(): @pytest.mark.asyncio async def test_list_device_registries_async_pages(): - client = DeviceManagerAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DeviceManagerAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1941,10 +2090,14 @@ async def test_list_device_registries_async_pages(): next_page_token="abc", ), device_manager.ListDeviceRegistriesResponse( - device_registries=[], next_page_token="def", + device_registries=[], + next_page_token="def", ), device_manager.ListDeviceRegistriesResponse( - device_registries=[resources.DeviceRegistry(),], next_page_token="ghi", + device_registries=[ + resources.DeviceRegistry(), + ], + next_page_token="ghi", ), device_manager.ListDeviceRegistriesResponse( device_registries=[ @@ -1961,10 +2114,17 @@ async def test_list_device_registries_async_pages(): assert page_.raw_page.next_page_token == token -@pytest.mark.parametrize("request_type", [device_manager.CreateDeviceRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + device_manager.CreateDeviceRequest, + dict, + ], +) def test_create_device(request_type, transport: str = "grpc"): client = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2001,7 +2161,8 @@ def test_create_device_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 = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2017,7 +2178,8 @@ async def test_create_device_async( transport: str = "grpc_asyncio", request_type=device_manager.CreateDeviceRequest ): client = DeviceManagerAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2058,7 +2220,9 @@ async def test_create_device_async_from_dict(): def test_create_device_field_headers(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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. @@ -2078,7 +2242,10 @@ def test_create_device_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 @@ -2105,11 +2272,16 @@ async def test_create_device_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_device_flattened(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.create_device), "__call__") as call: @@ -2118,7 +2290,8 @@ def test_create_device_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.create_device( - parent="parent_value", device=resources.Device(id="id_value"), + parent="parent_value", + device=resources.Device(id="id_value"), ) # Establish that the underlying call was made with the expected @@ -2134,7 +2307,9 @@ def test_create_device_flattened(): def test_create_device_flattened_error(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2161,7 +2336,8 @@ async def test_create_device_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.create_device( - parent="parent_value", device=resources.Device(id="id_value"), + parent="parent_value", + device=resources.Device(id="id_value"), ) # Establish that the underlying call was made with the expected @@ -2192,10 +2368,17 @@ async def test_create_device_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [device_manager.GetDeviceRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + device_manager.GetDeviceRequest, + dict, + ], +) def test_get_device(request_type, transport: str = "grpc"): client = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2232,7 +2415,8 @@ def test_get_device_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 = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2248,7 +2432,8 @@ async def test_get_device_async( transport: str = "grpc_asyncio", request_type=device_manager.GetDeviceRequest ): client = DeviceManagerAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2289,7 +2474,9 @@ async def test_get_device_async_from_dict(): def test_get_device_field_headers(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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. @@ -2309,7 +2496,10 @@ def test_get_device_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 @@ -2336,11 +2526,16 @@ async def test_get_device_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_device_flattened(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_device), "__call__") as call: @@ -2348,7 +2543,9 @@ def test_get_device_flattened(): call.return_value = resources.Device() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_device(name="name_value",) + client.get_device( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2360,13 +2557,16 @@ def test_get_device_flattened(): def test_get_device_flattened_error(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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_device( - device_manager.GetDeviceRequest(), name="name_value", + device_manager.GetDeviceRequest(), + name="name_value", ) @@ -2384,7 +2584,9 @@ async def test_get_device_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(resources.Device()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_device(name="name_value",) + response = await client.get_device( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2405,14 +2607,22 @@ async def test_get_device_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.get_device( - device_manager.GetDeviceRequest(), name="name_value", + device_manager.GetDeviceRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [device_manager.UpdateDeviceRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + device_manager.UpdateDeviceRequest, + dict, + ], +) def test_update_device(request_type, transport: str = "grpc"): client = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2449,7 +2659,8 @@ def test_update_device_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 = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2465,7 +2676,8 @@ async def test_update_device_async( transport: str = "grpc_asyncio", request_type=device_manager.UpdateDeviceRequest ): client = DeviceManagerAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2506,7 +2718,9 @@ async def test_update_device_async_from_dict(): def test_update_device_field_headers(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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. @@ -2526,7 +2740,10 @@ def test_update_device_field_headers(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "device.name=device.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "device.name=device.name/value", + ) in kw["metadata"] @pytest.mark.asyncio @@ -2553,11 +2770,16 @@ async def test_update_device_field_headers_async(): # Establish that the field header was sent. _, _, kw = call.mock_calls[0] - assert ("x-goog-request-params", "device.name=device.name/value",) in kw["metadata"] + assert ( + "x-goog-request-params", + "device.name=device.name/value", + ) in kw["metadata"] def test_update_device_flattened(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_device), "__call__") as call: @@ -2583,7 +2805,9 @@ def test_update_device_flattened(): def test_update_device_flattened_error(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -2642,10 +2866,17 @@ async def test_update_device_flattened_error_async(): ) -@pytest.mark.parametrize("request_type", [device_manager.DeleteDeviceRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + device_manager.DeleteDeviceRequest, + dict, + ], +) def test_delete_device(request_type, transport: str = "grpc"): client = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2671,7 +2902,8 @@ def test_delete_device_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 = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2687,7 +2919,8 @@ async def test_delete_device_async( transport: str = "grpc_asyncio", request_type=device_manager.DeleteDeviceRequest ): client = DeviceManagerAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2715,7 +2948,9 @@ async def test_delete_device_async_from_dict(): def test_delete_device_field_headers(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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. @@ -2735,7 +2970,10 @@ def test_delete_device_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 @@ -2762,11 +3000,16 @@ async def test_delete_device_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_device_flattened(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_device), "__call__") as call: @@ -2774,7 +3017,9 @@ def test_delete_device_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_device(name="name_value",) + client.delete_device( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2786,13 +3031,16 @@ def test_delete_device_flattened(): def test_delete_device_flattened_error(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) - - # Attempting to call a method with both a request object and flattened + client = DeviceManagerClient( + 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_device( - device_manager.DeleteDeviceRequest(), name="name_value", + device_manager.DeleteDeviceRequest(), + name="name_value", ) @@ -2810,7 +3058,9 @@ async def test_delete_device_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_device(name="name_value",) + response = await client.delete_device( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2831,14 +3081,22 @@ async def test_delete_device_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.delete_device( - device_manager.DeleteDeviceRequest(), name="name_value", + device_manager.DeleteDeviceRequest(), + name="name_value", ) -@pytest.mark.parametrize("request_type", [device_manager.ListDevicesRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + device_manager.ListDevicesRequest, + dict, + ], +) def test_list_devices(request_type, transport: str = "grpc"): client = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2867,7 +3125,8 @@ def test_list_devices_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 = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -2883,7 +3142,8 @@ async def test_list_devices_async( transport: str = "grpc_asyncio", request_type=device_manager.ListDevicesRequest ): client = DeviceManagerAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -2894,7 +3154,9 @@ async def test_list_devices_async( with mock.patch.object(type(client.transport.list_devices), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - device_manager.ListDevicesResponse(next_page_token="next_page_token_value",) + device_manager.ListDevicesResponse( + next_page_token="next_page_token_value", + ) ) response = await client.list_devices(request) @@ -2914,7 +3176,9 @@ async def test_list_devices_async_from_dict(): def test_list_devices_field_headers(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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. @@ -2934,7 +3198,10 @@ def test_list_devices_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 @@ -2963,11 +3230,16 @@ async def test_list_devices_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_devices_flattened(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_devices), "__call__") as call: @@ -2975,7 +3247,9 @@ def test_list_devices_flattened(): call.return_value = device_manager.ListDevicesResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_devices(parent="parent_value",) + client.list_devices( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -2987,13 +3261,16 @@ def test_list_devices_flattened(): def test_list_devices_flattened_error(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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_devices( - device_manager.ListDevicesRequest(), parent="parent_value", + device_manager.ListDevicesRequest(), + parent="parent_value", ) @@ -3013,7 +3290,9 @@ async def test_list_devices_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_devices(parent="parent_value",) + response = await client.list_devices( + parent="parent_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3034,13 +3313,15 @@ async def test_list_devices_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.list_devices( - device_manager.ListDevicesRequest(), parent="parent_value", + device_manager.ListDevicesRequest(), + parent="parent_value", ) def test_list_devices_pager(transport_name: str = "grpc"): client = DeviceManagerClient( - 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. @@ -3048,15 +3329,28 @@ def test_list_devices_pager(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( device_manager.ListDevicesResponse( - devices=[resources.Device(), resources.Device(), resources.Device(),], + devices=[ + resources.Device(), + resources.Device(), + resources.Device(), + ], next_page_token="abc", ), - device_manager.ListDevicesResponse(devices=[], next_page_token="def",), device_manager.ListDevicesResponse( - devices=[resources.Device(),], next_page_token="ghi", + devices=[], + next_page_token="def", + ), + device_manager.ListDevicesResponse( + devices=[ + resources.Device(), + ], + next_page_token="ghi", ), device_manager.ListDevicesResponse( - devices=[resources.Device(), resources.Device(),], + devices=[ + resources.Device(), + resources.Device(), + ], ), RuntimeError, ) @@ -3076,7 +3370,8 @@ def test_list_devices_pager(transport_name: str = "grpc"): def test_list_devices_pages(transport_name: str = "grpc"): client = DeviceManagerClient( - 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. @@ -3084,15 +3379,28 @@ def test_list_devices_pages(transport_name: str = "grpc"): # Set the response to a series of pages. call.side_effect = ( device_manager.ListDevicesResponse( - devices=[resources.Device(), resources.Device(), resources.Device(),], + devices=[ + resources.Device(), + resources.Device(), + resources.Device(), + ], next_page_token="abc", ), - device_manager.ListDevicesResponse(devices=[], next_page_token="def",), device_manager.ListDevicesResponse( - devices=[resources.Device(),], next_page_token="ghi", + devices=[], + next_page_token="def", + ), + device_manager.ListDevicesResponse( + devices=[ + resources.Device(), + ], + next_page_token="ghi", ), device_manager.ListDevicesResponse( - devices=[resources.Device(), resources.Device(),], + devices=[ + resources.Device(), + resources.Device(), + ], ), RuntimeError, ) @@ -3103,7 +3411,9 @@ def test_list_devices_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_devices_async_pager(): - client = DeviceManagerAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DeviceManagerAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3112,19 +3422,34 @@ async def test_list_devices_async_pager(): # Set the response to a series of pages. call.side_effect = ( device_manager.ListDevicesResponse( - devices=[resources.Device(), resources.Device(), resources.Device(),], + devices=[ + resources.Device(), + resources.Device(), + resources.Device(), + ], next_page_token="abc", ), - device_manager.ListDevicesResponse(devices=[], next_page_token="def",), device_manager.ListDevicesResponse( - devices=[resources.Device(),], next_page_token="ghi", + devices=[], + next_page_token="def", + ), + device_manager.ListDevicesResponse( + devices=[ + resources.Device(), + ], + next_page_token="ghi", ), device_manager.ListDevicesResponse( - devices=[resources.Device(), resources.Device(),], + devices=[ + resources.Device(), + resources.Device(), + ], ), RuntimeError, ) - async_pager = await client.list_devices(request={},) + async_pager = await client.list_devices( + request={}, + ) assert async_pager.next_page_token == "abc" responses = [] async for response in async_pager: @@ -3136,7 +3461,9 @@ async def test_list_devices_async_pager(): @pytest.mark.asyncio async def test_list_devices_async_pages(): - client = DeviceManagerAsyncClient(credentials=ga_credentials.AnonymousCredentials,) + client = DeviceManagerAsyncClient( + credentials=ga_credentials.AnonymousCredentials, + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3145,15 +3472,28 @@ async def test_list_devices_async_pages(): # Set the response to a series of pages. call.side_effect = ( device_manager.ListDevicesResponse( - devices=[resources.Device(), resources.Device(), resources.Device(),], + devices=[ + resources.Device(), + resources.Device(), + resources.Device(), + ], next_page_token="abc", ), - device_manager.ListDevicesResponse(devices=[], next_page_token="def",), device_manager.ListDevicesResponse( - devices=[resources.Device(),], next_page_token="ghi", + devices=[], + next_page_token="def", + ), + device_manager.ListDevicesResponse( + devices=[ + resources.Device(), + ], + next_page_token="ghi", ), device_manager.ListDevicesResponse( - devices=[resources.Device(), resources.Device(),], + devices=[ + resources.Device(), + resources.Device(), + ], ), RuntimeError, ) @@ -3165,11 +3505,16 @@ async def test_list_devices_async_pages(): @pytest.mark.parametrize( - "request_type", [device_manager.ModifyCloudToDeviceConfigRequest, dict,] + "request_type", + [ + device_manager.ModifyCloudToDeviceConfigRequest, + dict, + ], ) def test_modify_cloud_to_device_config(request_type, transport: str = "grpc"): client = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3182,7 +3527,8 @@ def test_modify_cloud_to_device_config(request_type, transport: str = "grpc"): ) as call: # Designate an appropriate return value for the call. call.return_value = resources.DeviceConfig( - version=774, binary_data=b"binary_data_blob", + version=774, + binary_data=b"binary_data_blob", ) response = client.modify_cloud_to_device_config(request) @@ -3201,7 +3547,8 @@ def test_modify_cloud_to_device_config_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 = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3220,7 +3567,8 @@ async def test_modify_cloud_to_device_config_async( request_type=device_manager.ModifyCloudToDeviceConfigRequest, ): client = DeviceManagerAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3233,7 +3581,10 @@ async def test_modify_cloud_to_device_config_async( ) as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( - resources.DeviceConfig(version=774, binary_data=b"binary_data_blob",) + resources.DeviceConfig( + version=774, + binary_data=b"binary_data_blob", + ) ) response = await client.modify_cloud_to_device_config(request) @@ -3254,7 +3605,9 @@ async def test_modify_cloud_to_device_config_async_from_dict(): def test_modify_cloud_to_device_config_field_headers(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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. @@ -3276,7 +3629,10 @@ def test_modify_cloud_to_device_config_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 @@ -3307,11 +3663,16 @@ async def test_modify_cloud_to_device_config_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_modify_cloud_to_device_config_flattened(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3322,7 +3683,8 @@ def test_modify_cloud_to_device_config_flattened(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. client.modify_cloud_to_device_config( - name="name_value", binary_data=b"binary_data_blob", + name="name_value", + binary_data=b"binary_data_blob", ) # Establish that the underlying call was made with the expected @@ -3338,7 +3700,9 @@ def test_modify_cloud_to_device_config_flattened(): def test_modify_cloud_to_device_config_flattened_error(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -3369,7 +3733,8 @@ async def test_modify_cloud_to_device_config_flattened_async(): # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. response = await client.modify_cloud_to_device_config( - name="name_value", binary_data=b"binary_data_blob", + name="name_value", + binary_data=b"binary_data_blob", ) # Establish that the underlying call was made with the expected @@ -3401,11 +3766,16 @@ async def test_modify_cloud_to_device_config_flattened_error_async(): @pytest.mark.parametrize( - "request_type", [device_manager.ListDeviceConfigVersionsRequest, dict,] + "request_type", + [ + device_manager.ListDeviceConfigVersionsRequest, + dict, + ], ) def test_list_device_config_versions(request_type, transport: str = "grpc"): client = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3433,7 +3803,8 @@ def test_list_device_config_versions_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 = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3452,7 +3823,8 @@ async def test_list_device_config_versions_async( request_type=device_manager.ListDeviceConfigVersionsRequest, ): client = DeviceManagerAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3484,7 +3856,9 @@ async def test_list_device_config_versions_async_from_dict(): def test_list_device_config_versions_field_headers(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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. @@ -3506,7 +3880,10 @@ def test_list_device_config_versions_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 @@ -3537,11 +3914,16 @@ async def test_list_device_config_versions_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_list_device_config_versions_flattened(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3551,7 +3933,9 @@ def test_list_device_config_versions_flattened(): call.return_value = device_manager.ListDeviceConfigVersionsResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_device_config_versions(name="name_value",) + client.list_device_config_versions( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3563,13 +3947,16 @@ def test_list_device_config_versions_flattened(): def test_list_device_config_versions_flattened_error(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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_device_config_versions( - device_manager.ListDeviceConfigVersionsRequest(), name="name_value", + device_manager.ListDeviceConfigVersionsRequest(), + name="name_value", ) @@ -3591,7 +3978,9 @@ async def test_list_device_config_versions_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_device_config_versions(name="name_value",) + response = await client.list_device_config_versions( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3612,16 +4001,22 @@ async def test_list_device_config_versions_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.list_device_config_versions( - device_manager.ListDeviceConfigVersionsRequest(), name="name_value", + device_manager.ListDeviceConfigVersionsRequest(), + name="name_value", ) @pytest.mark.parametrize( - "request_type", [device_manager.ListDeviceStatesRequest, dict,] + "request_type", + [ + device_manager.ListDeviceStatesRequest, + dict, + ], ) def test_list_device_states(request_type, transport: str = "grpc"): client = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3649,7 +4044,8 @@ def test_list_device_states_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 = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3667,7 +4063,8 @@ async def test_list_device_states_async( transport: str = "grpc_asyncio", request_type=device_manager.ListDeviceStatesRequest ): client = DeviceManagerAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3699,7 +4096,9 @@ async def test_list_device_states_async_from_dict(): def test_list_device_states_field_headers(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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. @@ -3721,7 +4120,10 @@ def test_list_device_states_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 @@ -3752,11 +4154,16 @@ async def test_list_device_states_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_list_device_states_flattened(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3766,7 +4173,9 @@ def test_list_device_states_flattened(): call.return_value = device_manager.ListDeviceStatesResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_device_states(name="name_value",) + client.list_device_states( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3778,13 +4187,16 @@ def test_list_device_states_flattened(): def test_list_device_states_flattened_error(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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_device_states( - device_manager.ListDeviceStatesRequest(), name="name_value", + device_manager.ListDeviceStatesRequest(), + name="name_value", ) @@ -3806,7 +4218,9 @@ async def test_list_device_states_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_device_states(name="name_value",) + response = await client.list_device_states( + name="name_value", + ) # Establish that the underlying call was made with the expected # request object values. @@ -3827,14 +4241,22 @@ async def test_list_device_states_flattened_error_async(): # fields is an error. with pytest.raises(ValueError): await client.list_device_states( - device_manager.ListDeviceStatesRequest(), name="name_value", + device_manager.ListDeviceStatesRequest(), + name="name_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 = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3844,7 +4266,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. @@ -3862,7 +4287,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 = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -3878,7 +4304,8 @@ async def test_set_iam_policy_async( transport: str = "grpc_asyncio", request_type=iam_policy_pb2.SetIamPolicyRequest ): client = DeviceManagerAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -3889,7 +4316,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) @@ -3910,7 +4340,9 @@ async def test_set_iam_policy_async_from_dict(): def test_set_iam_policy_field_headers(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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. @@ -3930,7 +4362,10 @@ 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 @@ -3957,11 +4392,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 = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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. @@ -3976,7 +4416,9 @@ def test_set_iam_policy_from_dict_foreign(): def test_set_iam_policy_flattened(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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: @@ -3984,7 +4426,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. @@ -3996,13 +4440,16 @@ def test_set_iam_policy_flattened(): def test_set_iam_policy_flattened_error(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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", ) @@ -4020,7 +4467,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. @@ -4041,14 +4490,22 @@ async def test_set_iam_policy_flattened_error_async(): # 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.GetIamPolicyRequest, dict,]) +@pytest.mark.parametrize( + "request_type", + [ + iam_policy_pb2.GetIamPolicyRequest, + dict, + ], +) def test_get_iam_policy(request_type, transport: str = "grpc"): client = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4058,7 +4515,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. @@ -4076,7 +4536,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 = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4092,7 +4553,8 @@ async def test_get_iam_policy_async( transport: str = "grpc_asyncio", request_type=iam_policy_pb2.GetIamPolicyRequest ): client = DeviceManagerAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4103,7 +4565,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) @@ -4124,7 +4589,9 @@ async def test_get_iam_policy_async_from_dict(): def test_get_iam_policy_field_headers(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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. @@ -4144,7 +4611,10 @@ 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 @@ -4171,11 +4641,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 = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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. @@ -4190,7 +4665,9 @@ def test_get_iam_policy_from_dict_foreign(): def test_get_iam_policy_flattened(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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: @@ -4198,7 +4675,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. @@ -4210,13 +4689,16 @@ def test_get_iam_policy_flattened(): def test_get_iam_policy_flattened_error(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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", ) @@ -4234,7 +4716,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. @@ -4255,16 +4739,22 @@ async def test_get_iam_policy_flattened_error_async(): # 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.TestIamPermissionsRequest, dict,] + "request_type", + [ + iam_policy_pb2.TestIamPermissionsRequest, + dict, + ], ) def test_test_iam_permissions(request_type, transport: str = "grpc"): client = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4295,7 +4785,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 = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4314,7 +4805,8 @@ async def test_test_iam_permissions_async( request_type=iam_policy_pb2.TestIamPermissionsRequest, ): client = DeviceManagerAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4349,7 +4841,9 @@ async def test_test_iam_permissions_async_from_dict(): def test_test_iam_permissions_field_headers(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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. @@ -4371,7 +4865,10 @@ 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 @@ -4402,11 +4899,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 = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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__" @@ -4423,7 +4925,9 @@ def test_test_iam_permissions_from_dict_foreign(): def test_test_iam_permissions_flattened(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4434,7 +4938,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 @@ -4450,7 +4955,9 @@ def test_test_iam_permissions_flattened(): def test_test_iam_permissions_flattened_error(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4481,7 +4988,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 @@ -4513,11 +5021,16 @@ async def test_test_iam_permissions_flattened_error_async(): @pytest.mark.parametrize( - "request_type", [device_manager.SendCommandToDeviceRequest, dict,] + "request_type", + [ + device_manager.SendCommandToDeviceRequest, + dict, + ], ) def test_send_command_to_device(request_type, transport: str = "grpc"): client = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4545,7 +5058,8 @@ def test_send_command_to_device_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 = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4564,7 +5078,8 @@ async def test_send_command_to_device_async( request_type=device_manager.SendCommandToDeviceRequest, ): client = DeviceManagerAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4596,7 +5111,9 @@ async def test_send_command_to_device_async_from_dict(): def test_send_command_to_device_field_headers(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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. @@ -4618,7 +5135,10 @@ def test_send_command_to_device_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 @@ -4649,11 +5169,16 @@ async def test_send_command_to_device_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_send_command_to_device_flattened(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4685,7 +5210,9 @@ def test_send_command_to_device_flattened(): def test_send_command_to_device_flattened_error(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4755,11 +5282,16 @@ async def test_send_command_to_device_flattened_error_async(): @pytest.mark.parametrize( - "request_type", [device_manager.BindDeviceToGatewayRequest, dict,] + "request_type", + [ + device_manager.BindDeviceToGatewayRequest, + dict, + ], ) def test_bind_device_to_gateway(request_type, transport: str = "grpc"): client = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4787,7 +5319,8 @@ def test_bind_device_to_gateway_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 = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -4806,7 +5339,8 @@ async def test_bind_device_to_gateway_async( request_type=device_manager.BindDeviceToGatewayRequest, ): client = DeviceManagerAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -4838,7 +5372,9 @@ async def test_bind_device_to_gateway_async_from_dict(): def test_bind_device_to_gateway_field_headers(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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. @@ -4860,7 +5396,10 @@ def test_bind_device_to_gateway_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 @@ -4891,11 +5430,16 @@ async def test_bind_device_to_gateway_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_bind_device_to_gateway_flattened(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4927,7 +5471,9 @@ def test_bind_device_to_gateway_flattened(): def test_bind_device_to_gateway_flattened_error(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -4997,11 +5543,16 @@ async def test_bind_device_to_gateway_flattened_error_async(): @pytest.mark.parametrize( - "request_type", [device_manager.UnbindDeviceFromGatewayRequest, dict,] + "request_type", + [ + device_manager.UnbindDeviceFromGatewayRequest, + dict, + ], ) def test_unbind_device_from_gateway(request_type, transport: str = "grpc"): client = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5029,7 +5580,8 @@ def test_unbind_device_from_gateway_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 = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), transport="grpc", + credentials=ga_credentials.AnonymousCredentials(), + transport="grpc", ) # Mock the actual call within the gRPC stub, and fake the request. @@ -5048,7 +5600,8 @@ async def test_unbind_device_from_gateway_async( request_type=device_manager.UnbindDeviceFromGatewayRequest, ): client = DeviceManagerAsyncClient( - credentials=ga_credentials.AnonymousCredentials(), transport=transport, + credentials=ga_credentials.AnonymousCredentials(), + transport=transport, ) # Everything is optional in proto3 as far as the runtime is concerned, @@ -5080,7 +5633,9 @@ async def test_unbind_device_from_gateway_async_from_dict(): def test_unbind_device_from_gateway_field_headers(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + 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. @@ -5102,7 +5657,10 @@ def test_unbind_device_from_gateway_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 @@ -5133,11 +5691,16 @@ async def test_unbind_device_from_gateway_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_unbind_device_from_gateway_flattened(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5169,7 +5732,9 @@ def test_unbind_device_from_gateway_flattened(): def test_unbind_device_from_gateway_flattened_error(): - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) # Attempting to call a method with both a request object and flattened # fields is an error. @@ -5245,7 +5810,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = DeviceManagerClient( - 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. @@ -5265,7 +5831,10 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = DeviceManagerClient(client_options=options, transport=transport,) + client = DeviceManagerClient( + client_options=options, + transport=transport, + ) # It is an error to provide an api_key and a credential. options = mock.Mock() @@ -5281,7 +5850,8 @@ def test_credentials_transport_error(): ) with pytest.raises(ValueError): client = DeviceManagerClient( - client_options={"scopes": ["1", "2"]}, transport=transport, + client_options={"scopes": ["1", "2"]}, + transport=transport, ) @@ -5326,8 +5896,13 @@ def test_transport_adc(transport_class): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = DeviceManagerClient(credentials=ga_credentials.AnonymousCredentials(),) - assert isinstance(client.transport, transports.DeviceManagerGrpcTransport,) + client = DeviceManagerClient( + credentials=ga_credentials.AnonymousCredentials(), + ) + assert isinstance( + client.transport, + transports.DeviceManagerGrpcTransport, + ) def test_device_manager_base_transport_error(): @@ -5390,7 +5965,8 @@ def test_device_manager_base_transport_with_credentials_file(): Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) transport = transports.DeviceManagerTransport( - credentials_file="credentials.json", quota_project_id="octopus", + credentials_file="credentials.json", + quota_project_id="octopus", ) load_creds.assert_called_once_with( "credentials.json", @@ -5560,7 +6136,8 @@ def test_device_manager_grpc_transport_channel(): # Check that channel is used if provided. transport = transports.DeviceManagerGrpcTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -5572,7 +6149,8 @@ def test_device_manager_grpc_asyncio_transport_channel(): # Check that channel is used if provided. transport = transports.DeviceManagerGrpcAsyncIOTransport( - host="squid.clam.whelk", channel=channel, + host="squid.clam.whelk", + channel=channel, ) assert transport.grpc_channel == channel assert transport._host == "squid.clam.whelk:443" @@ -5683,7 +6261,10 @@ def test_device_path(): registry = "whelk" device = "octopus" expected = "projects/{project}/locations/{location}/registries/{registry}/devices/{device}".format( - project=project, location=location, registry=registry, device=device, + project=project, + location=location, + registry=registry, + device=device, ) actual = DeviceManagerClient.device_path(project, location, registry, device) assert expected == actual @@ -5708,7 +6289,9 @@ def test_registry_path(): location = "nautilus" registry = "scallop" expected = "projects/{project}/locations/{location}/registries/{registry}".format( - project=project, location=location, registry=registry, + project=project, + location=location, + registry=registry, ) actual = DeviceManagerClient.registry_path(project, location, registry) assert expected == actual @@ -5749,7 +6332,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 = DeviceManagerClient.common_folder_path(folder) assert expected == actual @@ -5767,7 +6352,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 = DeviceManagerClient.common_organization_path(organization) assert expected == actual @@ -5785,7 +6372,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 = DeviceManagerClient.common_project_path(project) assert expected == actual @@ -5805,7 +6394,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 = DeviceManagerClient.common_location_path(project, location) assert expected == actual @@ -5830,7 +6420,8 @@ def test_client_with_default_client_info(): transports.DeviceManagerTransport, "_prep_wrapped_messages" ) as prep: client = DeviceManagerClient( - credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, + credentials=ga_credentials.AnonymousCredentials(), + client_info=client_info, ) prep.assert_called_once_with(client_info) @@ -5839,7 +6430,8 @@ def test_client_with_default_client_info(): ) as prep: transport_class = DeviceManagerClient.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) @@ -5847,7 +6439,8 @@ def test_client_with_default_client_info(): @pytest.mark.asyncio async def test_transport_close_async(): client = DeviceManagerAsyncClient( - 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 9a24246165f54cc7a561536829ccd9a818fb4780 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:44:16 +0000 Subject: [PATCH 12/41] chore(python): add E231 to .flake8 ignore list (#288) 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 90abb18e5d5ac501923ad4e14e5a6eee495a0b37 Mon Sep 17 00:00:00 2001 From: "gcf-owl-bot[bot]" <78513119+gcf-owl-bot[bot]@users.noreply.github.com> Date: Thu, 31 Mar 2022 15:13:46 -0600 Subject: [PATCH 13/41] chore(python): update .pre-commit-config.yaml to use black==22.3.0 (#289) Source-Link: https://github.com/googleapis/synthtool/commit/7804ade3daae0d66649bee8df6c55484c6580b8d Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:eede5672562a32821444a8e803fb984a6f61f2237ea3de229d2de24453f4ae7d Co-authored-by: Owl Bot --- .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 93ee824a99817299be4cb9c6cac015c874b71a79 Mon Sep 17 00:00:00 2001 From: Anthonios Partheniou Date: Thu, 31 Mar 2022 19:08:18 -0400 Subject: [PATCH 14/41] chore: allow releases on previous majors (#284) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: allow releases on previous majors * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * Update .OwlBot.lock.yaml * 🦉 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 Co-authored-by: Bu Sun Kim <8822365+busunkim96@users.noreply.github.com> --- .github/release-please.yml | 9 +++++++++ owlbot.py | 1 + 2 files changed, 10 insertions(+) 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 diff --git a/owlbot.py b/owlbot.py index 5e3c46be..e4941d2e 100644 --- a/owlbot.py +++ b/owlbot.py @@ -48,6 +48,7 @@ # ---------------------------------------------------------------------------- python.py_samples() +python.configure_previous_major_version_branches() s.shell.run(["nox", "-s", "blacken"], hide_output=False) From a72fc91381546b4b332abd6139c5cd58b3f3f0a9 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:08:28 +0000 Subject: [PATCH 15/41] chore(python): Enable size-label bot (#291) 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 81c34bf6ae9093e6e6c2b5e8c79fa45e4d64b8d5 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:36:19 +0000 Subject: [PATCH 16/41] chore(python): refactor unit / system test dependency install (#293) 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 c6425127fccacf7f8455c64677703be7ce325e86 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 5 Apr 2022 22:27:09 +0200 Subject: [PATCH 17/41] chore(deps): update dependency google-api-python-client to v2.43.0 (#295) --- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index a5406339..d087d416 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -1,6 +1,6 @@ cryptography==36.0.2 flaky==3.7.0 -google-api-python-client==2.42.0 +google-api-python-client==2.43.0 google-auth-httplib2==0.1.0 google-auth==2.6.2 google-cloud-iot==2.4.1 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index a3107019..f1793672 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -1,6 +1,6 @@ cryptography==36.0.2 flaky==3.7.0 -google-api-python-client==2.42.0 +google-api-python-client==2.43.0 google-auth-httplib2==0.1.0 google-auth==2.6.2 google-cloud-iot==2.4.1 From 5110a78af3654f00114dd4c47988f828d9e6e950 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 07:13:25 -0400 Subject: [PATCH 18/41] chore(python): add license header to auto-label.yaml (#296) 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 8c3d896b48f313e887fcf3f1fc25f0594297a4d8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 7 Apr 2022 13:14:54 +0200 Subject: [PATCH 19/41] chore(deps): update dependency google-cloud-pubsub to v2.12.0 (#297) --- samples/api-client/accesstoken_example/requirements-test.txt | 2 +- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements-test.txt b/samples/api-client/accesstoken_example/requirements-test.txt index d2d75af4..ebe25dc9 100644 --- a/samples/api-client/accesstoken_example/requirements-test.txt +++ b/samples/api-client/accesstoken_example/requirements-test.txt @@ -1,3 +1,3 @@ pytest==7.1.1 -google-cloud-pubsub==2.11.0 +google-cloud-pubsub==2.12.0 google-cloud-storage==2.2.1 diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index d087d416..42641a7b 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -4,7 +4,7 @@ google-api-python-client==2.43.0 google-auth-httplib2==0.1.0 google-auth==2.6.2 google-cloud-iot==2.4.1 -google-cloud-pubsub==2.11.0 +google-cloud-pubsub==2.12.0 google-cloud-storage==2.2.1 paho-mqtt==1.6.1 pyjwt==2.3.0 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index f1793672..aa2ad370 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -4,6 +4,6 @@ google-api-python-client==2.43.0 google-auth-httplib2==0.1.0 google-auth==2.6.2 google-cloud-iot==2.4.1 -google-cloud-pubsub==2.11.0 +google-cloud-pubsub==2.12.0 paho-mqtt==1.6.1 pyjwt==2.3.0 From 38cc50a48356be4ac6484195ca5bbe85e20082d8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 7 Apr 2022 22:36:54 +0200 Subject: [PATCH 20/41] chore(deps): update dependency google-auth to v2.6.3 (#298) --- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index 42641a7b..d391a394 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -2,7 +2,7 @@ cryptography==36.0.2 flaky==3.7.0 google-api-python-client==2.43.0 google-auth-httplib2==0.1.0 -google-auth==2.6.2 +google-auth==2.6.3 google-cloud-iot==2.4.1 google-cloud-pubsub==2.12.0 google-cloud-storage==2.2.1 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index aa2ad370..eb049666 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -2,7 +2,7 @@ cryptography==36.0.2 flaky==3.7.0 google-api-python-client==2.43.0 google-auth-httplib2==0.1.0 -google-auth==2.6.2 +google-auth==2.6.3 google-cloud-iot==2.4.1 google-cloud-pubsub==2.12.0 paho-mqtt==1.6.1 From 5c654c194df152785ead134e63ae798af290ba62 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 13 Apr 2022 00:47:43 +0200 Subject: [PATCH 21/41] chore(deps): update all dependencies (#301) --- samples/api-client/accesstoken_example/requirements.txt | 4 ++-- samples/api-client/manager/requirements.txt | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index d391a394..4ad4b1a8 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -1,8 +1,8 @@ cryptography==36.0.2 flaky==3.7.0 -google-api-python-client==2.43.0 +google-api-python-client==2.44.0 google-auth-httplib2==0.1.0 -google-auth==2.6.3 +google-auth==2.6.4 google-cloud-iot==2.4.1 google-cloud-pubsub==2.12.0 google-cloud-storage==2.2.1 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index eb049666..96154c41 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -1,8 +1,8 @@ cryptography==36.0.2 flaky==3.7.0 -google-api-python-client==2.43.0 +google-api-python-client==2.44.0 google-auth-httplib2==0.1.0 -google-auth==2.6.3 +google-auth==2.6.4 google-cloud-iot==2.4.1 google-cloud-pubsub==2.12.0 paho-mqtt==1.6.1 From 74e91fa6637f98ddf9171a659b8381f312861164 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 14 Apr 2022 01:54:54 +0200 Subject: [PATCH 22/41] chore(deps): update dependency google-cloud-storage to v2.3.0 (#302) --- samples/api-client/accesstoken_example/requirements-test.txt | 2 +- samples/api-client/accesstoken_example/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements-test.txt b/samples/api-client/accesstoken_example/requirements-test.txt index ebe25dc9..e56a7887 100644 --- a/samples/api-client/accesstoken_example/requirements-test.txt +++ b/samples/api-client/accesstoken_example/requirements-test.txt @@ -1,3 +1,3 @@ pytest==7.1.1 google-cloud-pubsub==2.12.0 -google-cloud-storage==2.2.1 +google-cloud-storage==2.3.0 diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index 4ad4b1a8..7f19db46 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -5,6 +5,6 @@ google-auth-httplib2==0.1.0 google-auth==2.6.4 google-cloud-iot==2.4.1 google-cloud-pubsub==2.12.0 -google-cloud-storage==2.2.1 +google-cloud-storage==2.3.0 paho-mqtt==1.6.1 pyjwt==2.3.0 From bc445c6c8e90867b6c7d7d5bddab8abbc970deb3 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 11:50:11 +0000 Subject: [PATCH 23/41] chore: use gapic-generator-python 0.65.1 (#303) - [ ] 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/device_manager/async_client.py | 107 +- .../iot_v1/services/device_manager/client.py | 107 +- .../device_manager/transports/base.py | 5 + .../device_manager/transports/grpc.py | 4 + google/cloud/iot_v1/types/resources.py | 2 +- ...ted_device_manager_get_iam_policy_async.py | 3 +- ...ated_device_manager_get_iam_policy_sync.py | 3 +- ...ted_device_manager_set_iam_policy_async.py | 3 +- ...ated_device_manager_set_iam_policy_sync.py | 3 +- ...vice_manager_test_iam_permissions_async.py | 3 +- ...evice_manager_test_iam_permissions_sync.py | 3 +- .../snippet_metadata_iot_v1.json | 1742 +++++++++++++++-- scripts/fixup_iot_v1_keywords.py | 2 +- setup.py | 2 +- testing/constraints-3.6.txt | 2 +- .../unit/gapic/iot_v1/test_device_manager.py | 88 +- 16 files changed, 1812 insertions(+), 267 deletions(-) diff --git a/google/cloud/iot_v1/services/device_manager/async_client.py b/google/cloud/iot_v1/services/device_manager/async_client.py index 7a537fb0..19dbee96 100644 --- a/google/cloud/iot_v1/services/device_manager/async_client.py +++ b/google/cloud/iot_v1/services/device_manager/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 @@ -1280,7 +1280,6 @@ async def modify_cloud_to_device_config( eventually sent from the Cloud IoT Core servers. Returns the modified configuration version and its metadata. - .. code-block:: python from google.cloud import iot_v1 @@ -1400,7 +1399,6 @@ async def list_device_config_versions( r"""Lists the last few versions of the device configuration in descending order (i.e.: newest first). - .. code-block:: python from google.cloud import iot_v1 @@ -1507,7 +1505,6 @@ async def list_device_states( r"""Lists the last few versions of the device state in descending order (i.e.: newest first). - .. code-block:: python from google.cloud import iot_v1 @@ -1613,17 +1610,17 @@ async def set_iam_policy( r"""Sets the access control policy on the specified resource. Replaces any existing policy. - .. code-block:: python from google.cloud import iot_v1 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_set_iam_policy(): # Create a client client = iot_v1.DeviceManagerClient() # Initialize request argument(s) - request = iot_v1.SetIamPolicyRequest( + request = iam_policy_pb2.SetIamPolicyRequest( resource="resource_value", ) @@ -1654,21 +1651,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": [ @@ -1683,17 +1685,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 - @@ -1704,11 +1706,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. @@ -1768,17 +1771,17 @@ async def get_iam_policy( Returns an empty policy if the resource exists and does not have a policy set. - .. code-block:: python from google.cloud import iot_v1 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_get_iam_policy(): # Create a client client = iot_v1.DeviceManagerClient() # Initialize request argument(s) - request = iot_v1.GetIamPolicyRequest( + request = iam_policy_pb2.GetIamPolicyRequest( resource="resource_value", ) @@ -1809,21 +1812,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": [ @@ -1838,17 +1846,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 - @@ -1859,11 +1867,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. @@ -1924,17 +1933,17 @@ async def test_iam_permissions( If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. - .. code-block:: python from google.cloud import iot_v1 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_test_iam_permissions(): # Create a client client = iot_v1.DeviceManagerClient() # Initialize request argument(s) - request = iot_v1.TestIamPermissionsRequest( + request = iam_policy_pb2.TestIamPermissionsRequest( resource="resource_value", permissions=['permissions_value_1', 'permissions_value_2'], ) @@ -2051,7 +2060,6 @@ async def send_command_to_device( guaranteed; for QoS 0, no acknowledgment will be expected from the device. - .. code-block:: python from google.cloud import iot_v1 @@ -2303,7 +2311,6 @@ async def unbind_device_from_gateway( r"""Deletes the association between the device and the gateway. - .. code-block:: python from google.cloud import iot_v1 diff --git a/google/cloud/iot_v1/services/device_manager/client.py b/google/cloud/iot_v1/services/device_manager/client.py index e55d8e9e..12b0d66e 100644 --- a/google/cloud/iot_v1/services/device_manager/client.py +++ b/google/cloud/iot_v1/services/device_manager/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 @@ -1464,7 +1464,6 @@ def modify_cloud_to_device_config( eventually sent from the Cloud IoT Core servers. Returns the modified configuration version and its metadata. - .. code-block:: python from google.cloud import iot_v1 @@ -1575,7 +1574,6 @@ def list_device_config_versions( r"""Lists the last few versions of the device configuration in descending order (i.e.: newest first). - .. code-block:: python from google.cloud import iot_v1 @@ -1674,7 +1672,6 @@ def list_device_states( r"""Lists the last few versions of the device state in descending order (i.e.: newest first). - .. code-block:: python from google.cloud import iot_v1 @@ -1770,17 +1767,17 @@ def set_iam_policy( r"""Sets the access control policy on the specified resource. Replaces any existing policy. - .. code-block:: python from google.cloud import iot_v1 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_set_iam_policy(): # Create a client client = iot_v1.DeviceManagerClient() # Initialize request argument(s) - request = iot_v1.SetIamPolicyRequest( + request = iam_policy_pb2.SetIamPolicyRequest( resource="resource_value", ) @@ -1811,21 +1808,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": [ @@ -1840,17 +1842,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 - @@ -1861,11 +1863,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. @@ -1922,17 +1925,17 @@ def get_iam_policy( Returns an empty policy if the resource exists and does not have a policy set. - .. code-block:: python from google.cloud import iot_v1 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_get_iam_policy(): # Create a client client = iot_v1.DeviceManagerClient() # Initialize request argument(s) - request = iot_v1.GetIamPolicyRequest( + request = iam_policy_pb2.GetIamPolicyRequest( resource="resource_value", ) @@ -1963,21 +1966,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": [ @@ -1992,17 +2000,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 - @@ -2013,11 +2021,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. @@ -2075,17 +2084,17 @@ def test_iam_permissions( If the resource does not exist, this will return an empty set of permissions, not a NOT_FOUND error. - .. code-block:: python from google.cloud import iot_v1 + from google.iam.v1 import iam_policy_pb2 # type: ignore def sample_test_iam_permissions(): # Create a client client = iot_v1.DeviceManagerClient() # Initialize request argument(s) - request = iot_v1.TestIamPermissionsRequest( + request = iam_policy_pb2.TestIamPermissionsRequest( resource="resource_value", permissions=['permissions_value_1', 'permissions_value_2'], ) @@ -2200,7 +2209,6 @@ def send_command_to_device( guaranteed; for QoS 0, no acknowledgment will be expected from the device. - .. code-block:: python from google.cloud import iot_v1 @@ -2441,7 +2449,6 @@ def unbind_device_from_gateway( r"""Deletes the association between the device and the gateway. - .. code-block:: python from google.cloud import iot_v1 diff --git a/google/cloud/iot_v1/services/device_manager/transports/base.py b/google/cloud/iot_v1/services/device_manager/transports/base.py index 51fe3095..c7c50d56 100644 --- a/google/cloud/iot_v1/services/device_manager/transports/base.py +++ b/google/cloud/iot_v1/services/device_manager/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" @@ -530,5 +531,9 @@ def unbind_device_from_gateway( ]: raise NotImplementedError() + @property + def kind(self) -> str: + raise NotImplementedError() + __all__ = ("DeviceManagerTransport",) diff --git a/google/cloud/iot_v1/services/device_manager/transports/grpc.py b/google/cloud/iot_v1/services/device_manager/transports/grpc.py index ce42385c..c612d853 100644 --- a/google/cloud/iot_v1/services/device_manager/transports/grpc.py +++ b/google/cloud/iot_v1/services/device_manager/transports/grpc.py @@ -786,5 +786,9 @@ def unbind_device_from_gateway( def close(self): self.grpc_channel.close() + @property + def kind(self) -> str: + return "grpc" + __all__ = ("DeviceManagerGrpcTransport",) diff --git a/google/cloud/iot_v1/types/resources.py b/google/cloud/iot_v1/types/resources.py index 23c05a25..4637c7f3 100644 --- a/google/cloud/iot_v1/types/resources.py +++ b/google/cloud/iot_v1/types/resources.py @@ -195,7 +195,7 @@ class Device(proto.Message): The logging verbosity for device activity. If unspecified, DeviceRegistry.log_level will be used. - metadata (Sequence[google.cloud.iot_v1.types.Device.MetadataEntry]): + metadata (Mapping[str, str]): The metadata key-value pairs assigned to the device. This metadata is not interpreted or indexed by Cloud IoT Core. It can be used to add contextual information for the device. diff --git a/samples/generated_samples/cloudiot_v1_generated_device_manager_get_iam_policy_async.py b/samples/generated_samples/cloudiot_v1_generated_device_manager_get_iam_policy_async.py index 36f79b64..129e55b0 100644 --- a/samples/generated_samples/cloudiot_v1_generated_device_manager_get_iam_policy_async.py +++ b/samples/generated_samples/cloudiot_v1_generated_device_manager_get_iam_policy_async.py @@ -25,6 +25,7 @@ # [START cloudiot_v1_generated_DeviceManager_GetIamPolicy_async] from google.cloud import iot_v1 +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 = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) - request = iot_v1.GetIamPolicyRequest( + request = iam_policy_pb2.GetIamPolicyRequest( resource="resource_value", ) diff --git a/samples/generated_samples/cloudiot_v1_generated_device_manager_get_iam_policy_sync.py b/samples/generated_samples/cloudiot_v1_generated_device_manager_get_iam_policy_sync.py index f0e08a17..48e9dc9e 100644 --- a/samples/generated_samples/cloudiot_v1_generated_device_manager_get_iam_policy_sync.py +++ b/samples/generated_samples/cloudiot_v1_generated_device_manager_get_iam_policy_sync.py @@ -25,6 +25,7 @@ # [START cloudiot_v1_generated_DeviceManager_GetIamPolicy_sync] from google.cloud import iot_v1 +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 = iot_v1.DeviceManagerClient() # Initialize request argument(s) - request = iot_v1.GetIamPolicyRequest( + request = iam_policy_pb2.GetIamPolicyRequest( resource="resource_value", ) diff --git a/samples/generated_samples/cloudiot_v1_generated_device_manager_set_iam_policy_async.py b/samples/generated_samples/cloudiot_v1_generated_device_manager_set_iam_policy_async.py index 3209a09f..6e3785a8 100644 --- a/samples/generated_samples/cloudiot_v1_generated_device_manager_set_iam_policy_async.py +++ b/samples/generated_samples/cloudiot_v1_generated_device_manager_set_iam_policy_async.py @@ -25,6 +25,7 @@ # [START cloudiot_v1_generated_DeviceManager_SetIamPolicy_async] from google.cloud import iot_v1 +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 = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) - request = iot_v1.SetIamPolicyRequest( + request = iam_policy_pb2.SetIamPolicyRequest( resource="resource_value", ) diff --git a/samples/generated_samples/cloudiot_v1_generated_device_manager_set_iam_policy_sync.py b/samples/generated_samples/cloudiot_v1_generated_device_manager_set_iam_policy_sync.py index a23d1a10..a9b664bd 100644 --- a/samples/generated_samples/cloudiot_v1_generated_device_manager_set_iam_policy_sync.py +++ b/samples/generated_samples/cloudiot_v1_generated_device_manager_set_iam_policy_sync.py @@ -25,6 +25,7 @@ # [START cloudiot_v1_generated_DeviceManager_SetIamPolicy_sync] from google.cloud import iot_v1 +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 = iot_v1.DeviceManagerClient() # Initialize request argument(s) - request = iot_v1.SetIamPolicyRequest( + request = iam_policy_pb2.SetIamPolicyRequest( resource="resource_value", ) diff --git a/samples/generated_samples/cloudiot_v1_generated_device_manager_test_iam_permissions_async.py b/samples/generated_samples/cloudiot_v1_generated_device_manager_test_iam_permissions_async.py index eb6a4271..8eeab2a5 100644 --- a/samples/generated_samples/cloudiot_v1_generated_device_manager_test_iam_permissions_async.py +++ b/samples/generated_samples/cloudiot_v1_generated_device_manager_test_iam_permissions_async.py @@ -25,6 +25,7 @@ # [START cloudiot_v1_generated_DeviceManager_TestIamPermissions_async] from google.cloud import iot_v1 +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 = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) - request = iot_v1.TestIamPermissionsRequest( + request = iam_policy_pb2.TestIamPermissionsRequest( resource="resource_value", permissions=['permissions_value_1', 'permissions_value_2'], ) diff --git a/samples/generated_samples/cloudiot_v1_generated_device_manager_test_iam_permissions_sync.py b/samples/generated_samples/cloudiot_v1_generated_device_manager_test_iam_permissions_sync.py index 76603816..bcdee786 100644 --- a/samples/generated_samples/cloudiot_v1_generated_device_manager_test_iam_permissions_sync.py +++ b/samples/generated_samples/cloudiot_v1_generated_device_manager_test_iam_permissions_sync.py @@ -25,6 +25,7 @@ # [START cloudiot_v1_generated_DeviceManager_TestIamPermissions_sync] from google.cloud import iot_v1 +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 = iot_v1.DeviceManagerClient() # Initialize request argument(s) - request = iot_v1.TestIamPermissionsRequest( + request = iam_policy_pb2.TestIamPermissionsRequest( resource="resource_value", permissions=['permissions_value_1', 'permissions_value_2'], ) diff --git a/samples/generated_samples/snippet_metadata_iot_v1.json b/samples/generated_samples/snippet_metadata_iot_v1.json index 975ad0e3..b4128560 100644 --- a/samples/generated_samples/snippet_metadata_iot_v1.json +++ b/samples/generated_samples/snippet_metadata_iot_v1.json @@ -1,16 +1,69 @@ { + "clientLibrary": { + "apis": [ + { + "id": "google.cloud.iot.v1", + "version": "v1" + } + ], + "language": "PYTHON", + "name": "google-cloud-iot" + }, "snippets": [ { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient", + "shortName": "DeviceManagerAsyncClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient.bind_device_to_gateway", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.BindDeviceToGateway", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "BindDeviceToGateway" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.BindDeviceToGatewayRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "gateway_id", + "type": "str" + }, + { + "name": "device_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.iot_v1.types.BindDeviceToGatewayResponse", + "shortName": "bind_device_to_gateway" }, + "description": "Sample for BindDeviceToGateway", "file": "cloudiot_v1_generated_device_manager_bind_device_to_gateway_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_BindDeviceToGateway_async", "segments": [ { @@ -43,18 +96,62 @@ "start": 44, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_bind_device_to_gateway_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerClient", + "shortName": "DeviceManagerClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerClient.bind_device_to_gateway", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.BindDeviceToGateway", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "BindDeviceToGateway" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.BindDeviceToGatewayRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "gateway_id", + "type": "str" + }, + { + "name": "device_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.iot_v1.types.BindDeviceToGatewayResponse", + "shortName": "bind_device_to_gateway" }, + "description": "Sample for BindDeviceToGateway", "file": "cloudiot_v1_generated_device_manager_bind_device_to_gateway_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_BindDeviceToGateway_sync", "segments": [ { @@ -87,19 +184,59 @@ "start": 44, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_bind_device_to_gateway_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient", + "shortName": "DeviceManagerAsyncClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient.create_device_registry", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.CreateDeviceRegistry", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "CreateDeviceRegistry" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.CreateDeviceRegistryRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "device_registry", + "type": "google.cloud.iot_v1.types.DeviceRegistry" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.iot_v1.types.DeviceRegistry", + "shortName": "create_device_registry" }, + "description": "Sample for CreateDeviceRegistry", "file": "cloudiot_v1_generated_device_manager_create_device_registry_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_CreateDeviceRegistry_async", "segments": [ { @@ -132,18 +269,58 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_create_device_registry_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerClient", + "shortName": "DeviceManagerClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerClient.create_device_registry", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.CreateDeviceRegistry", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "CreateDeviceRegistry" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.CreateDeviceRegistryRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "device_registry", + "type": "google.cloud.iot_v1.types.DeviceRegistry" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.iot_v1.types.DeviceRegistry", + "shortName": "create_device_registry" }, + "description": "Sample for CreateDeviceRegistry", "file": "cloudiot_v1_generated_device_manager_create_device_registry_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_CreateDeviceRegistry_sync", "segments": [ { @@ -176,19 +353,59 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_create_device_registry_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient", + "shortName": "DeviceManagerAsyncClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient.create_device", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.CreateDevice", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "CreateDevice" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.CreateDeviceRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "device", + "type": "google.cloud.iot_v1.types.Device" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.iot_v1.types.Device", + "shortName": "create_device" }, + "description": "Sample for CreateDevice", "file": "cloudiot_v1_generated_device_manager_create_device_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_CreateDevice_async", "segments": [ { @@ -221,18 +438,58 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_create_device_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerClient", + "shortName": "DeviceManagerClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerClient.create_device", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.CreateDevice", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "CreateDevice" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.CreateDeviceRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "device", + "type": "google.cloud.iot_v1.types.Device" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.iot_v1.types.Device", + "shortName": "create_device" }, + "description": "Sample for CreateDevice", "file": "cloudiot_v1_generated_device_manager_create_device_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_CreateDevice_sync", "segments": [ { @@ -265,19 +522,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_create_device_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient", + "shortName": "DeviceManagerAsyncClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient.delete_device_registry", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.DeleteDeviceRegistry", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "DeleteDeviceRegistry" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.DeleteDeviceRegistryRequest" + }, + { + "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_device_registry" }, + "description": "Sample for DeleteDeviceRegistry", "file": "cloudiot_v1_generated_device_manager_delete_device_registry_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_DeleteDeviceRegistry_async", "segments": [ { @@ -308,18 +600,53 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_delete_device_registry_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerClient", + "shortName": "DeviceManagerClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerClient.delete_device_registry", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.DeleteDeviceRegistry", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "DeleteDeviceRegistry" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.DeleteDeviceRegistryRequest" + }, + { + "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_device_registry" }, + "description": "Sample for DeleteDeviceRegistry", "file": "cloudiot_v1_generated_device_manager_delete_device_registry_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_DeleteDeviceRegistry_sync", "segments": [ { @@ -350,19 +677,54 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_delete_device_registry_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient", + "shortName": "DeviceManagerAsyncClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient.delete_device", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.DeleteDevice", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "DeleteDevice" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.DeleteDeviceRequest" + }, + { + "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_device" }, + "description": "Sample for DeleteDevice", "file": "cloudiot_v1_generated_device_manager_delete_device_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_DeleteDevice_async", "segments": [ { @@ -393,18 +755,53 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_delete_device_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerClient", + "shortName": "DeviceManagerClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerClient.delete_device", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.DeleteDevice", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "DeleteDevice" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.DeleteDeviceRequest" + }, + { + "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_device" }, + "description": "Sample for DeleteDevice", "file": "cloudiot_v1_generated_device_manager_delete_device_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_DeleteDevice_sync", "segments": [ { @@ -435,19 +832,55 @@ "end": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_delete_device_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient", + "shortName": "DeviceManagerAsyncClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient.get_device_registry", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.GetDeviceRegistry", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "GetDeviceRegistry" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.GetDeviceRegistryRequest" + }, + { + "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.iot_v1.types.DeviceRegistry", + "shortName": "get_device_registry" }, + "description": "Sample for GetDeviceRegistry", "file": "cloudiot_v1_generated_device_manager_get_device_registry_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_GetDeviceRegistry_async", "segments": [ { @@ -480,18 +913,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_get_device_registry_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerClient", + "shortName": "DeviceManagerClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerClient.get_device_registry", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.GetDeviceRegistry", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "GetDeviceRegistry" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.GetDeviceRegistryRequest" + }, + { + "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.iot_v1.types.DeviceRegistry", + "shortName": "get_device_registry" }, + "description": "Sample for GetDeviceRegistry", "file": "cloudiot_v1_generated_device_manager_get_device_registry_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_GetDeviceRegistry_sync", "segments": [ { @@ -524,19 +993,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_get_device_registry_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient", + "shortName": "DeviceManagerAsyncClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient.get_device", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.GetDevice", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "GetDevice" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.GetDeviceRequest" + }, + { + "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.iot_v1.types.Device", + "shortName": "get_device" }, + "description": "Sample for GetDevice", "file": "cloudiot_v1_generated_device_manager_get_device_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_GetDevice_async", "segments": [ { @@ -569,18 +1074,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_get_device_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerClient", + "shortName": "DeviceManagerClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerClient.get_device", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.GetDevice", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "GetDevice" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.GetDeviceRequest" + }, + { + "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.iot_v1.types.Device", + "shortName": "get_device" }, + "description": "Sample for GetDevice", "file": "cloudiot_v1_generated_device_manager_get_device_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_GetDevice_sync", "segments": [ { @@ -613,108 +1154,216 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_get_device_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient", + "shortName": "DeviceManagerAsyncClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient.get_iam_policy", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.GetIamPolicy", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "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": "cloudiot_v1_generated_device_manager_get_iam_policy_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_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": "cloudiot_v1_generated_device_manager_get_iam_policy_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerClient", + "shortName": "DeviceManagerClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerClient.get_iam_policy", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.GetIamPolicy", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "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": "cloudiot_v1_generated_device_manager_get_iam_policy_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_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": "cloudiot_v1_generated_device_manager_get_iam_policy_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient", + "shortName": "DeviceManagerAsyncClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient.list_device_config_versions", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.ListDeviceConfigVersions", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "ListDeviceConfigVersions" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.ListDeviceConfigVersionsRequest" + }, + { + "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.iot_v1.types.ListDeviceConfigVersionsResponse", + "shortName": "list_device_config_versions" }, + "description": "Sample for ListDeviceConfigVersions", "file": "cloudiot_v1_generated_device_manager_list_device_config_versions_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_ListDeviceConfigVersions_async", "segments": [ { @@ -747,18 +1396,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_list_device_config_versions_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerClient", + "shortName": "DeviceManagerClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerClient.list_device_config_versions", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.ListDeviceConfigVersions", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "ListDeviceConfigVersions" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.ListDeviceConfigVersionsRequest" + }, + { + "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.iot_v1.types.ListDeviceConfigVersionsResponse", + "shortName": "list_device_config_versions" }, + "description": "Sample for ListDeviceConfigVersions", "file": "cloudiot_v1_generated_device_manager_list_device_config_versions_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_ListDeviceConfigVersions_sync", "segments": [ { @@ -791,19 +1476,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_list_device_config_versions_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient", + "shortName": "DeviceManagerAsyncClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient.list_device_registries", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.ListDeviceRegistries", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "ListDeviceRegistries" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.ListDeviceRegistriesRequest" + }, + { + "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.iot_v1.services.device_manager.pagers.ListDeviceRegistriesAsyncPager", + "shortName": "list_device_registries" }, + "description": "Sample for ListDeviceRegistries", "file": "cloudiot_v1_generated_device_manager_list_device_registries_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_ListDeviceRegistries_async", "segments": [ { @@ -836,18 +1557,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_list_device_registries_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerClient", + "shortName": "DeviceManagerClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerClient.list_device_registries", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.ListDeviceRegistries", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "ListDeviceRegistries" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.ListDeviceRegistriesRequest" + }, + { + "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.iot_v1.services.device_manager.pagers.ListDeviceRegistriesPager", + "shortName": "list_device_registries" }, + "description": "Sample for ListDeviceRegistries", "file": "cloudiot_v1_generated_device_manager_list_device_registries_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_ListDeviceRegistries_sync", "segments": [ { @@ -880,19 +1637,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_list_device_registries_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient", + "shortName": "DeviceManagerAsyncClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient.list_device_states", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.ListDeviceStates", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "ListDeviceStates" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.ListDeviceStatesRequest" + }, + { + "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.iot_v1.types.ListDeviceStatesResponse", + "shortName": "list_device_states" }, + "description": "Sample for ListDeviceStates", "file": "cloudiot_v1_generated_device_manager_list_device_states_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_ListDeviceStates_async", "segments": [ { @@ -925,18 +1718,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_list_device_states_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerClient", + "shortName": "DeviceManagerClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerClient.list_device_states", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.ListDeviceStates", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "ListDeviceStates" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.ListDeviceStatesRequest" + }, + { + "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.iot_v1.types.ListDeviceStatesResponse", + "shortName": "list_device_states" }, + "description": "Sample for ListDeviceStates", "file": "cloudiot_v1_generated_device_manager_list_device_states_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_ListDeviceStates_sync", "segments": [ { @@ -969,19 +1798,55 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_list_device_states_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient", + "shortName": "DeviceManagerAsyncClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient.list_devices", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.ListDevices", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "ListDevices" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.ListDevicesRequest" + }, + { + "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.iot_v1.services.device_manager.pagers.ListDevicesAsyncPager", + "shortName": "list_devices" }, + "description": "Sample for ListDevices", "file": "cloudiot_v1_generated_device_manager_list_devices_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_ListDevices_async", "segments": [ { @@ -1014,18 +1879,54 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_list_devices_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerClient", + "shortName": "DeviceManagerClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerClient.list_devices", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.ListDevices", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "ListDevices" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.ListDevicesRequest" + }, + { + "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.iot_v1.services.device_manager.pagers.ListDevicesPager", + "shortName": "list_devices" }, + "description": "Sample for ListDevices", "file": "cloudiot_v1_generated_device_manager_list_devices_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_ListDevices_sync", "segments": [ { @@ -1058,19 +1959,59 @@ "start": 42, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_list_devices_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient", + "shortName": "DeviceManagerAsyncClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient.modify_cloud_to_device_config", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.ModifyCloudToDeviceConfig", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "ModifyCloudToDeviceConfig" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.ModifyCloudToDeviceConfigRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "binary_data", + "type": "bytes" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.iot_v1.types.DeviceConfig", + "shortName": "modify_cloud_to_device_config" }, + "description": "Sample for ModifyCloudToDeviceConfig", "file": "cloudiot_v1_generated_device_manager_modify_cloud_to_device_config_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_ModifyCloudToDeviceConfig_async", "segments": [ { @@ -1103,18 +2044,58 @@ "start": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_modify_cloud_to_device_config_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerClient", + "shortName": "DeviceManagerClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerClient.modify_cloud_to_device_config", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.ModifyCloudToDeviceConfig", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "ModifyCloudToDeviceConfig" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.ModifyCloudToDeviceConfigRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "binary_data", + "type": "bytes" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.iot_v1.types.DeviceConfig", + "shortName": "modify_cloud_to_device_config" }, + "description": "Sample for ModifyCloudToDeviceConfig", "file": "cloudiot_v1_generated_device_manager_modify_cloud_to_device_config_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_ModifyCloudToDeviceConfig_sync", "segments": [ { @@ -1147,19 +2128,63 @@ "start": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_modify_cloud_to_device_config_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient", + "shortName": "DeviceManagerAsyncClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient.send_command_to_device", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.SendCommandToDevice", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "SendCommandToDevice" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.SendCommandToDeviceRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "binary_data", + "type": "bytes" + }, + { + "name": "subfolder", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.iot_v1.types.SendCommandToDeviceResponse", + "shortName": "send_command_to_device" }, + "description": "Sample for SendCommandToDevice", "file": "cloudiot_v1_generated_device_manager_send_command_to_device_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_SendCommandToDevice_async", "segments": [ { @@ -1192,18 +2217,62 @@ "start": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_send_command_to_device_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerClient", + "shortName": "DeviceManagerClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerClient.send_command_to_device", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.SendCommandToDevice", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "SendCommandToDevice" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.SendCommandToDeviceRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "binary_data", + "type": "bytes" + }, + { + "name": "subfolder", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.iot_v1.types.SendCommandToDeviceResponse", + "shortName": "send_command_to_device" }, + "description": "Sample for SendCommandToDevice", "file": "cloudiot_v1_generated_device_manager_send_command_to_device_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_SendCommandToDevice_sync", "segments": [ { @@ -1236,197 +2305,393 @@ "start": 43, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_send_command_to_device_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient", + "shortName": "DeviceManagerAsyncClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient.set_iam_policy", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.SetIamPolicy", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "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": "cloudiot_v1_generated_device_manager_set_iam_policy_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_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": "cloudiot_v1_generated_device_manager_set_iam_policy_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerClient", + "shortName": "DeviceManagerClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerClient.set_iam_policy", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.SetIamPolicy", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "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": "cloudiot_v1_generated_device_manager_set_iam_policy_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_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": "cloudiot_v1_generated_device_manager_set_iam_policy_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient", + "shortName": "DeviceManagerAsyncClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient.test_iam_permissions", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.TestIamPermissions", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "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": "cloudiot_v1_generated_device_manager_test_iam_permissions_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_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": "cloudiot_v1_generated_device_manager_test_iam_permissions_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerClient", + "shortName": "DeviceManagerClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerClient.test_iam_permissions", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.TestIamPermissions", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "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": "cloudiot_v1_generated_device_manager_test_iam_permissions_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_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": "cloudiot_v1_generated_device_manager_test_iam_permissions_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient", + "shortName": "DeviceManagerAsyncClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient.unbind_device_from_gateway", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.UnbindDeviceFromGateway", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "UnbindDeviceFromGateway" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.UnbindDeviceFromGatewayRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "gateway_id", + "type": "str" + }, + { + "name": "device_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.iot_v1.types.UnbindDeviceFromGatewayResponse", + "shortName": "unbind_device_from_gateway" }, + "description": "Sample for UnbindDeviceFromGateway", "file": "cloudiot_v1_generated_device_manager_unbind_device_from_gateway_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_UnbindDeviceFromGateway_async", "segments": [ { @@ -1459,18 +2724,62 @@ "start": 44, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_unbind_device_from_gateway_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerClient", + "shortName": "DeviceManagerClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerClient.unbind_device_from_gateway", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.UnbindDeviceFromGateway", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "UnbindDeviceFromGateway" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.UnbindDeviceFromGatewayRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "gateway_id", + "type": "str" + }, + { + "name": "device_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, str]" + } + ], + "resultType": "google.cloud.iot_v1.types.UnbindDeviceFromGatewayResponse", + "shortName": "unbind_device_from_gateway" }, + "description": "Sample for UnbindDeviceFromGateway", "file": "cloudiot_v1_generated_device_manager_unbind_device_from_gateway_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_UnbindDeviceFromGateway_sync", "segments": [ { @@ -1503,19 +2812,59 @@ "start": 44, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_unbind_device_from_gateway_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient", + "shortName": "DeviceManagerAsyncClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient.update_device_registry", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.UpdateDeviceRegistry", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "UpdateDeviceRegistry" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.UpdateDeviceRegistryRequest" + }, + { + "name": "device_registry", + "type": "google.cloud.iot_v1.types.DeviceRegistry" + }, + { + "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.iot_v1.types.DeviceRegistry", + "shortName": "update_device_registry" }, + "description": "Sample for UpdateDeviceRegistry", "file": "cloudiot_v1_generated_device_manager_update_device_registry_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_UpdateDeviceRegistry_async", "segments": [ { @@ -1548,18 +2897,58 @@ "start": 41, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_update_device_registry_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerClient", + "shortName": "DeviceManagerClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerClient.update_device_registry", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.UpdateDeviceRegistry", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "UpdateDeviceRegistry" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.UpdateDeviceRegistryRequest" + }, + { + "name": "device_registry", + "type": "google.cloud.iot_v1.types.DeviceRegistry" + }, + { + "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.iot_v1.types.DeviceRegistry", + "shortName": "update_device_registry" }, + "description": "Sample for UpdateDeviceRegistry", "file": "cloudiot_v1_generated_device_manager_update_device_registry_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_UpdateDeviceRegistry_sync", "segments": [ { @@ -1592,19 +2981,59 @@ "start": 41, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_update_device_registry_sync.py" }, { + "canonical": true, "clientMethod": { "async": true, + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient", + "shortName": "DeviceManagerAsyncClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerAsyncClient.update_device", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.UpdateDevice", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "UpdateDevice" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.UpdateDeviceRequest" + }, + { + "name": "device", + "type": "google.cloud.iot_v1.types.Device" + }, + { + "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.iot_v1.types.Device", + "shortName": "update_device" }, + "description": "Sample for UpdateDevice", "file": "cloudiot_v1_generated_device_manager_update_device_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_UpdateDevice_async", "segments": [ { @@ -1637,18 +3066,58 @@ "start": 41, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_update_device_async.py" }, { + "canonical": true, "clientMethod": { + "client": { + "fullName": "google.cloud.iot_v1.DeviceManagerClient", + "shortName": "DeviceManagerClient" + }, + "fullName": "google.cloud.iot_v1.DeviceManagerClient.update_device", "method": { + "fullName": "google.cloud.iot.v1.DeviceManager.UpdateDevice", "service": { + "fullName": "google.cloud.iot.v1.DeviceManager", "shortName": "DeviceManager" }, "shortName": "UpdateDevice" - } + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.iot_v1.types.UpdateDeviceRequest" + }, + { + "name": "device", + "type": "google.cloud.iot_v1.types.Device" + }, + { + "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.iot_v1.types.Device", + "shortName": "update_device" }, + "description": "Sample for UpdateDevice", "file": "cloudiot_v1_generated_device_manager_update_device_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", "regionTag": "cloudiot_v1_generated_DeviceManager_UpdateDevice_sync", "segments": [ { @@ -1681,7 +3150,8 @@ "start": 41, "type": "RESPONSE_HANDLING" } - ] + ], + "title": "cloudiot_v1_generated_device_manager_update_device_sync.py" } ] } diff --git a/scripts/fixup_iot_v1_keywords.py b/scripts/fixup_iot_v1_keywords.py index 41d74f8a..f59d0544 100644 --- a/scripts/fixup_iot_v1_keywords.py +++ b/scripts/fixup_iot_v1_keywords.py @@ -53,7 +53,7 @@ class iotCallTransformer(cst.CSTTransformer): 'list_device_states': ('name', 'num_states', ), 'modify_cloud_to_device_config': ('name', 'binary_data', 'version_to_update', ), 'send_command_to_device': ('name', 'binary_data', 'subfolder', ), - 'set_iam_policy': ('resource', 'policy', ), + 'set_iam_policy': ('resource', 'policy', 'update_mask', ), 'test_iam_permissions': ('resource', 'permissions', ), 'unbind_device_from_gateway': ('parent', 'gateway_id', 'device_id', ), 'update_device': ('device', 'update_mask', ), diff --git a/setup.py b/setup.py index 8ac8a75e..4d9703d4 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,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 97384ff6..5a93d69c 100644 --- a/testing/constraints-3.6.txt +++ b/testing/constraints-3.6.txt @@ -6,4 +6,4 @@ # Then this file should have google-cloud-foo==1.14.0 google-api-core==1.31.5 proto-plus==1.15.0 -grpc-google-iam-v1==0.12.3 +grpc-google-iam-v1==0.12.4 diff --git a/tests/unit/gapic/iot_v1/test_device_manager.py b/tests/unit/gapic/iot_v1/test_device_manager.py index 07bef675..229b982a 100644 --- a/tests/unit/gapic/iot_v1/test_device_manager.py +++ b/tests/unit/gapic/iot_v1/test_device_manager.py @@ -94,24 +94,24 @@ def test__get_default_mtls_endpoint(): @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - DeviceManagerClient, - DeviceManagerAsyncClient, + (DeviceManagerClient, "grpc"), + (DeviceManagerAsyncClient, "grpc_asyncio"), ], ) -def test_device_manager_client_from_service_account_info(client_class): +def test_device_manager_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 == "cloudiot.googleapis.com:443" + assert client.transport._host == ("cloudiot.googleapis.com:443") @pytest.mark.parametrize( @@ -140,27 +140,31 @@ def test_device_manager_client_service_account_always_use_jwt( @pytest.mark.parametrize( - "client_class", + "client_class,transport_name", [ - DeviceManagerClient, - DeviceManagerAsyncClient, + (DeviceManagerClient, "grpc"), + (DeviceManagerAsyncClient, "grpc_asyncio"), ], ) -def test_device_manager_client_from_service_account_file(client_class): +def test_device_manager_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 == "cloudiot.googleapis.com:443" + assert client.transport._host == ("cloudiot.googleapis.com:443") def test_device_manager_client_get_transport_class(): @@ -2060,7 +2064,7 @@ async def test_list_device_registries_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 @@ -2108,7 +2112,9 @@ async def test_list_device_registries_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_device_registries(request={})).pages: + async for page_ in ( + await client.list_device_registries(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 @@ -3452,7 +3458,7 @@ async def test_list_devices_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 @@ -3498,7 +3504,9 @@ async def test_list_devices_async_pages(): RuntimeError, ) pages = [] - async for page_ in (await client.list_devices(request={})).pages: + async for page_ in ( + await client.list_devices(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 @@ -4410,6 +4418,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() @@ -5894,6 +5903,19 @@ def test_transport_adc(transport_class): adc.assert_called_once() +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + ], +) +def test_transport_kind(transport_name): + transport = DeviceManagerClient.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 = DeviceManagerClient( @@ -5954,6 +5976,14 @@ def test_device_manager_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_device_manager_base_transport_with_credentials_file(): # Instantiate the base transport with a credentials file @@ -6111,24 +6141,40 @@ def test_device_manager_grpc_transport_client_cert_source_for_mtls(transport_cla ) -def test_device_manager_host_no_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_device_manager_host_no_port(transport_name): client = DeviceManagerClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="cloudiot.googleapis.com" ), + transport=transport_name, ) - assert client.transport._host == "cloudiot.googleapis.com:443" + assert client.transport._host == ("cloudiot.googleapis.com:443") -def test_device_manager_host_with_port(): +@pytest.mark.parametrize( + "transport_name", + [ + "grpc", + "grpc_asyncio", + ], +) +def test_device_manager_host_with_port(transport_name): client = DeviceManagerClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="cloudiot.googleapis.com:8000" ), + transport=transport_name, ) - assert client.transport._host == "cloudiot.googleapis.com:8000" + assert client.transport._host == ("cloudiot.googleapis.com:8000") def test_device_manager_grpc_transport_channel(): From 7787cb40977d2b3d3726f362d0fce00512316a44 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 15 Apr 2022 02:44:21 +0200 Subject: [PATCH 24/41] chore(deps): update dependency google-auth to v2.6.5 (#305) --- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index 7f19db46..a13c2754 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -2,7 +2,7 @@ cryptography==36.0.2 flaky==3.7.0 google-api-python-client==2.44.0 google-auth-httplib2==0.1.0 -google-auth==2.6.4 +google-auth==2.6.5 google-cloud-iot==2.4.1 google-cloud-pubsub==2.12.0 google-cloud-storage==2.3.0 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index 96154c41..aad69215 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -2,7 +2,7 @@ cryptography==36.0.2 flaky==3.7.0 google-api-python-client==2.44.0 google-auth-httplib2==0.1.0 -google-auth==2.6.4 +google-auth==2.6.5 google-cloud-iot==2.4.1 google-cloud-pubsub==2.12.0 paho-mqtt==1.6.1 From 7c77a5d5c121935455d418105386574b4508ee8a Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Wed, 20 Apr 2022 12:19:35 +0200 Subject: [PATCH 25/41] chore(deps): update dependency google-api-python-client to v2.45.0 (#306) --- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index a13c2754..9978d4d0 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -1,6 +1,6 @@ cryptography==36.0.2 flaky==3.7.0 -google-api-python-client==2.44.0 +google-api-python-client==2.45.0 google-auth-httplib2==0.1.0 google-auth==2.6.5 google-cloud-iot==2.4.1 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index aad69215..e596e832 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -1,6 +1,6 @@ cryptography==36.0.2 flaky==3.7.0 -google-api-python-client==2.44.0 +google-api-python-client==2.45.0 google-auth-httplib2==0.1.0 google-auth==2.6.5 google-cloud-iot==2.4.1 From cdd5301dc746d1f762a195011facf4e9e2e1ce20 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 20:19:47 -0400 Subject: [PATCH 26/41] chore(python): add nox session to sort python imports (#307) 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 +-- noxfile.py | 27 ++++++++++++++++--- .../api-client/accesstoken_example/noxfile.py | 21 +++++++++++++++ samples/api-client/manager/noxfile.py | 21 +++++++++++++++ samples/api-client/mqtt_example/noxfile.py | 21 +++++++++++++++ 5 files changed, 89 insertions(+), 5 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/noxfile.py b/noxfile.py index 6ee5e8ab..92da31f8 100644 --- a/noxfile.py +++ b/noxfile.py @@ -25,7 +25,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 +84,7 @@ def lint(session): session.run( "black", "--check", - *BLACK_PATHS, + *LINT_PATHS, ) session.run("flake8", "google", "tests") @@ -94,7 +95,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/api-client/accesstoken_example/noxfile.py b/samples/api-client/accesstoken_example/noxfile.py index 11c47695..cf218d85 100644 --- a/samples/api-client/accesstoken_example/noxfile.py +++ b/samples/api-client/accesstoken_example/noxfile.py @@ -30,6 +30,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 +169,32 @@ 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/samples/api-client/manager/noxfile.py b/samples/api-client/manager/noxfile.py index 949e0fde..38bb0a57 100644 --- a/samples/api-client/manager/noxfile.py +++ b/samples/api-client/manager/noxfile.py @@ -30,6 +30,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 +169,32 @@ 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/samples/api-client/mqtt_example/noxfile.py b/samples/api-client/mqtt_example/noxfile.py index 11c47695..cf218d85 100644 --- a/samples/api-client/mqtt_example/noxfile.py +++ b/samples/api-client/mqtt_example/noxfile.py @@ -30,6 +30,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 +169,32 @@ 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 # From af075a9d081189003e49f116e9a1c58f2d3939a6 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:20:31 +0000 Subject: [PATCH 27/41] chore(python): use ubuntu 22.04 in docs image (#309) 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 ac195da159de82bef4a2f2c25fb91fce20a6ed63 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 22 Apr 2022 10:28:27 +0200 Subject: [PATCH 28/41] chore(deps): update dependency google-auth to v2.6.6 (#310) --- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index 9978d4d0..2a081d40 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -2,7 +2,7 @@ cryptography==36.0.2 flaky==3.7.0 google-api-python-client==2.45.0 google-auth-httplib2==0.1.0 -google-auth==2.6.5 +google-auth==2.6.6 google-cloud-iot==2.4.1 google-cloud-pubsub==2.12.0 google-cloud-storage==2.3.0 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index e596e832..6062cda2 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -2,7 +2,7 @@ cryptography==36.0.2 flaky==3.7.0 google-api-python-client==2.45.0 google-auth-httplib2==0.1.0 -google-auth==2.6.5 +google-auth==2.6.6 google-cloud-iot==2.4.1 google-cloud-pubsub==2.12.0 paho-mqtt==1.6.1 From dcc9e7ab74ac5fa8f68c36b95d83223483d5d8f8 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Mon, 25 Apr 2022 16:58:46 +0200 Subject: [PATCH 29/41] chore(deps): update dependency pytest to v7.1.2 (#311) --- samples/api-client/accesstoken_example/requirements-test.txt | 2 +- samples/api-client/manager/requirements-test.txt | 2 +- samples/api-client/mqtt_example/requirements-test.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements-test.txt b/samples/api-client/accesstoken_example/requirements-test.txt index e56a7887..ebe3b3a6 100644 --- a/samples/api-client/accesstoken_example/requirements-test.txt +++ b/samples/api-client/accesstoken_example/requirements-test.txt @@ -1,3 +1,3 @@ -pytest==7.1.1 +pytest==7.1.2 google-cloud-pubsub==2.12.0 google-cloud-storage==2.3.0 diff --git a/samples/api-client/manager/requirements-test.txt b/samples/api-client/manager/requirements-test.txt index 4f6bf643..d00689e0 100644 --- a/samples/api-client/manager/requirements-test.txt +++ b/samples/api-client/manager/requirements-test.txt @@ -1 +1 @@ -pytest==7.1.1 +pytest==7.1.2 diff --git a/samples/api-client/mqtt_example/requirements-test.txt b/samples/api-client/mqtt_example/requirements-test.txt index 4f6bf643..d00689e0 100644 --- a/samples/api-client/mqtt_example/requirements-test.txt +++ b/samples/api-client/mqtt_example/requirements-test.txt @@ -1 +1 @@ -pytest==7.1.1 +pytest==7.1.2 From 60638c82567bbda66a2f44442fc57a3cbf21b231 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 26 Apr 2022 18:22:21 +0200 Subject: [PATCH 30/41] chore(deps): update dependency cryptography to v37 (#312) --- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index 2a081d40..72ccb8c3 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -1,4 +1,4 @@ -cryptography==36.0.2 +cryptography==37.0.0 flaky==3.7.0 google-api-python-client==2.45.0 google-auth-httplib2==0.1.0 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index 6062cda2..0d364aee 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -1,4 +1,4 @@ -cryptography==36.0.2 +cryptography==37.0.0 flaky==3.7.0 google-api-python-client==2.45.0 google-auth-httplib2==0.1.0 From 51e45195dfbbcefa703bbb684d905633701c1199 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 26 Apr 2022 23:18:58 +0200 Subject: [PATCH 31/41] chore(deps): update dependency google-api-python-client to v2.46.0 (#313) --- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index 72ccb8c3..e10938f1 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -1,6 +1,6 @@ cryptography==37.0.0 flaky==3.7.0 -google-api-python-client==2.45.0 +google-api-python-client==2.46.0 google-auth-httplib2==0.1.0 google-auth==2.6.6 google-cloud-iot==2.4.1 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index 0d364aee..ca385049 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -1,6 +1,6 @@ cryptography==37.0.0 flaky==3.7.0 -google-api-python-client==2.45.0 +google-api-python-client==2.46.0 google-auth-httplib2==0.1.0 google-auth==2.6.6 google-cloud-iot==2.4.1 From 052f9f0a08ce87d6d1a72bdd648a911515127d6c Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 28 Apr 2022 13:20:23 +0200 Subject: [PATCH 32/41] chore(deps): update dependency cryptography to v37.0.1 (#315) --- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index e10938f1..2e5fa6e1 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -1,4 +1,4 @@ -cryptography==37.0.0 +cryptography==37.0.1 flaky==3.7.0 google-api-python-client==2.46.0 google-auth-httplib2==0.1.0 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index ca385049..3b4898a4 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -1,4 +1,4 @@ -cryptography==37.0.0 +cryptography==37.0.1 flaky==3.7.0 google-api-python-client==2.46.0 google-auth-httplib2==0.1.0 From 3f8a374ec9f285676bf5ae4389e310000aa69833 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 08:05:09 -0400 Subject: [PATCH 33/41] chore: use gapic-generator-python 0.65.2 (#314) 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 Co-authored-by: Anthonios Partheniou --- .../services/device_manager/async_client.py | 114 ++++++------- .../unit/gapic/iot_v1/test_device_manager.py | 156 +++++++++--------- 2 files changed, 135 insertions(+), 135 deletions(-) diff --git a/google/cloud/iot_v1/services/device_manager/async_client.py b/google/cloud/iot_v1/services/device_manager/async_client.py index 19dbee96..96d34392 100644 --- a/google/cloud/iot_v1/services/device_manager/async_client.py +++ b/google/cloud/iot_v1/services/device_manager/async_client.py @@ -228,9 +228,9 @@ async def create_device_registry( from google.cloud import iot_v1 - def sample_create_device_registry(): + async def sample_create_device_registry(): # Create a client - client = iot_v1.DeviceManagerClient() + client = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) request = iot_v1.CreateDeviceRegistryRequest( @@ -238,7 +238,7 @@ def sample_create_device_registry(): ) # Make the request - response = client.create_device_registry(request=request) + response = await client.create_device_registry(request=request) # Handle the response print(response) @@ -332,9 +332,9 @@ async def get_device_registry( from google.cloud import iot_v1 - def sample_get_device_registry(): + async def sample_get_device_registry(): # Create a client - client = iot_v1.DeviceManagerClient() + client = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) request = iot_v1.GetDeviceRegistryRequest( @@ -342,7 +342,7 @@ def sample_get_device_registry(): ) # Make the request - response = client.get_device_registry(request=request) + response = await client.get_device_registry(request=request) # Handle the response print(response) @@ -435,16 +435,16 @@ async def update_device_registry( from google.cloud import iot_v1 - def sample_update_device_registry(): + async def sample_update_device_registry(): # Create a client - client = iot_v1.DeviceManagerClient() + client = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) request = iot_v1.UpdateDeviceRegistryRequest( ) # Make the request - response = client.update_device_registry(request=request) + response = await client.update_device_registry(request=request) # Handle the response print(response) @@ -543,9 +543,9 @@ async def delete_device_registry( from google.cloud import iot_v1 - def sample_delete_device_registry(): + async def sample_delete_device_registry(): # Create a client - client = iot_v1.DeviceManagerClient() + client = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) request = iot_v1.DeleteDeviceRegistryRequest( @@ -553,7 +553,7 @@ def sample_delete_device_registry(): ) # Make the request - client.delete_device_registry(request=request) + await client.delete_device_registry(request=request) Args: request (Union[google.cloud.iot_v1.types.DeleteDeviceRegistryRequest, dict]): @@ -635,9 +635,9 @@ async def list_device_registries( from google.cloud import iot_v1 - def sample_list_device_registries(): + async def sample_list_device_registries(): # Create a client - client = iot_v1.DeviceManagerClient() + client = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) request = iot_v1.ListDeviceRegistriesRequest( @@ -648,7 +648,7 @@ def sample_list_device_registries(): page_result = client.list_device_registries(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -753,9 +753,9 @@ async def create_device( from google.cloud import iot_v1 - def sample_create_device(): + async def sample_create_device(): # Create a client - client = iot_v1.DeviceManagerClient() + client = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) request = iot_v1.CreateDeviceRequest( @@ -763,7 +763,7 @@ def sample_create_device(): ) # Make the request - response = client.create_device(request=request) + response = await client.create_device(request=request) # Handle the response print(response) @@ -857,9 +857,9 @@ async def get_device( from google.cloud import iot_v1 - def sample_get_device(): + async def sample_get_device(): # Create a client - client = iot_v1.DeviceManagerClient() + client = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) request = iot_v1.GetDeviceRequest( @@ -867,7 +867,7 @@ def sample_get_device(): ) # Make the request - response = client.get_device(request=request) + response = await client.get_device(request=request) # Handle the response print(response) @@ -962,16 +962,16 @@ async def update_device( from google.cloud import iot_v1 - def sample_update_device(): + async def sample_update_device(): # Create a client - client = iot_v1.DeviceManagerClient() + client = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) request = iot_v1.UpdateDeviceRequest( ) # Make the request - response = client.update_device(request=request) + response = await client.update_device(request=request) # Handle the response print(response) @@ -1070,9 +1070,9 @@ async def delete_device( from google.cloud import iot_v1 - def sample_delete_device(): + async def sample_delete_device(): # Create a client - client = iot_v1.DeviceManagerClient() + client = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) request = iot_v1.DeleteDeviceRequest( @@ -1080,7 +1080,7 @@ def sample_delete_device(): ) # Make the request - client.delete_device(request=request) + await client.delete_device(request=request) Args: request (Union[google.cloud.iot_v1.types.DeleteDeviceRequest, dict]): @@ -1164,9 +1164,9 @@ async def list_devices( from google.cloud import iot_v1 - def sample_list_devices(): + async def sample_list_devices(): # Create a client - client = iot_v1.DeviceManagerClient() + client = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) request = iot_v1.ListDevicesRequest( @@ -1177,7 +1177,7 @@ def sample_list_devices(): page_result = client.list_devices(request=request) # Handle the response - for response in page_result: + async for response in page_result: print(response) Args: @@ -1284,9 +1284,9 @@ async def modify_cloud_to_device_config( from google.cloud import iot_v1 - def sample_modify_cloud_to_device_config(): + async def sample_modify_cloud_to_device_config(): # Create a client - client = iot_v1.DeviceManagerClient() + client = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) request = iot_v1.ModifyCloudToDeviceConfigRequest( @@ -1295,7 +1295,7 @@ def sample_modify_cloud_to_device_config(): ) # Make the request - response = client.modify_cloud_to_device_config(request=request) + response = await client.modify_cloud_to_device_config(request=request) # Handle the response print(response) @@ -1403,9 +1403,9 @@ async def list_device_config_versions( from google.cloud import iot_v1 - def sample_list_device_config_versions(): + async def sample_list_device_config_versions(): # Create a client - client = iot_v1.DeviceManagerClient() + client = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) request = iot_v1.ListDeviceConfigVersionsRequest( @@ -1413,7 +1413,7 @@ def sample_list_device_config_versions(): ) # Make the request - response = client.list_device_config_versions(request=request) + response = await client.list_device_config_versions(request=request) # Handle the response print(response) @@ -1509,9 +1509,9 @@ async def list_device_states( from google.cloud import iot_v1 - def sample_list_device_states(): + async def sample_list_device_states(): # Create a client - client = iot_v1.DeviceManagerClient() + client = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) request = iot_v1.ListDeviceStatesRequest( @@ -1519,7 +1519,7 @@ def sample_list_device_states(): ) # Make the request - response = client.list_device_states(request=request) + response = await client.list_device_states(request=request) # Handle the response print(response) @@ -1615,9 +1615,9 @@ async def set_iam_policy( from google.cloud import iot_v1 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 = iot_v1.DeviceManagerClient() + client = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.SetIamPolicyRequest( @@ -1625,7 +1625,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) @@ -1776,9 +1776,9 @@ async def get_iam_policy( from google.cloud import iot_v1 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 = iot_v1.DeviceManagerClient() + client = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.GetIamPolicyRequest( @@ -1786,7 +1786,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) @@ -1938,9 +1938,9 @@ async def test_iam_permissions( from google.cloud import iot_v1 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 = iot_v1.DeviceManagerClient() + client = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) request = iam_policy_pb2.TestIamPermissionsRequest( @@ -1949,7 +1949,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) @@ -2064,9 +2064,9 @@ async def send_command_to_device( from google.cloud import iot_v1 - def sample_send_command_to_device(): + async def sample_send_command_to_device(): # Create a client - client = iot_v1.DeviceManagerClient() + client = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) request = iot_v1.SendCommandToDeviceRequest( @@ -2075,7 +2075,7 @@ def sample_send_command_to_device(): ) # Make the request - response = client.send_command_to_device(request=request) + response = await client.send_command_to_device(request=request) # Handle the response print(response) @@ -2199,9 +2199,9 @@ async def bind_device_to_gateway( from google.cloud import iot_v1 - def sample_bind_device_to_gateway(): + async def sample_bind_device_to_gateway(): # Create a client - client = iot_v1.DeviceManagerClient() + client = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) request = iot_v1.BindDeviceToGatewayRequest( @@ -2211,7 +2211,7 @@ def sample_bind_device_to_gateway(): ) # Make the request - response = client.bind_device_to_gateway(request=request) + response = await client.bind_device_to_gateway(request=request) # Handle the response print(response) @@ -2315,9 +2315,9 @@ async def unbind_device_from_gateway( from google.cloud import iot_v1 - def sample_unbind_device_from_gateway(): + async def sample_unbind_device_from_gateway(): # Create a client - client = iot_v1.DeviceManagerClient() + client = iot_v1.DeviceManagerAsyncClient() # Initialize request argument(s) request = iot_v1.UnbindDeviceFromGatewayRequest( @@ -2327,7 +2327,7 @@ def sample_unbind_device_from_gateway(): ) # Make the request - response = client.unbind_device_from_gateway(request=request) + response = await client.unbind_device_from_gateway(request=request) # Handle the response print(response) diff --git a/tests/unit/gapic/iot_v1/test_device_manager.py b/tests/unit/gapic/iot_v1/test_device_manager.py index 229b982a..d60b8529 100644 --- a/tests/unit/gapic/iot_v1/test_device_manager.py +++ b/tests/unit/gapic/iot_v1/test_device_manager.py @@ -770,7 +770,7 @@ def test_create_device_registry_field_headers(): # a field header. Set these to a non-empty value. request = device_manager.CreateDeviceRegistryRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -788,7 +788,7 @@ def test_create_device_registry_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -802,7 +802,7 @@ async def test_create_device_registry_field_headers_async(): # a field header. Set these to a non-empty value. request = device_manager.CreateDeviceRegistryRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -822,7 +822,7 @@ async def test_create_device_registry_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1035,7 +1035,7 @@ def test_get_device_registry_field_headers(): # a field header. Set these to a non-empty value. request = device_manager.GetDeviceRegistryRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1053,7 +1053,7 @@ def test_get_device_registry_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1067,7 +1067,7 @@ async def test_get_device_registry_field_headers_async(): # a field header. Set these to a non-empty value. request = device_manager.GetDeviceRegistryRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1087,7 +1087,7 @@ async def test_get_device_registry_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1290,7 +1290,7 @@ def test_update_device_registry_field_headers(): # a field header. Set these to a non-empty value. request = device_manager.UpdateDeviceRegistryRequest() - request.device_registry.name = "device_registry.name/value" + request.device_registry.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1308,7 +1308,7 @@ def test_update_device_registry_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "device_registry.name=device_registry.name/value", + "device_registry.name=name_value", ) in kw["metadata"] @@ -1322,7 +1322,7 @@ async def test_update_device_registry_field_headers_async(): # a field header. Set these to a non-empty value. request = device_manager.UpdateDeviceRegistryRequest() - request.device_registry.name = "device_registry.name/value" + request.device_registry.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1342,7 +1342,7 @@ async def test_update_device_registry_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "device_registry.name=device_registry.name/value", + "device_registry.name=name_value", ) in kw["metadata"] @@ -1539,7 +1539,7 @@ def test_delete_device_registry_field_headers(): # a field header. Set these to a non-empty value. request = device_manager.DeleteDeviceRegistryRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1557,7 +1557,7 @@ def test_delete_device_registry_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1571,7 +1571,7 @@ async def test_delete_device_registry_field_headers_async(): # a field header. Set these to a non-empty value. request = device_manager.DeleteDeviceRegistryRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1589,7 +1589,7 @@ async def test_delete_device_registry_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -1782,7 +1782,7 @@ def test_list_device_registries_field_headers(): # a field header. Set these to a non-empty value. request = device_manager.ListDeviceRegistriesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1800,7 +1800,7 @@ def test_list_device_registries_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1814,7 +1814,7 @@ async def test_list_device_registries_field_headers_async(): # a field header. Set these to a non-empty value. request = device_manager.ListDeviceRegistriesRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -1834,7 +1834,7 @@ async def test_list_device_registries_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -1971,7 +1971,7 @@ def test_list_device_registries_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, resources.DeviceRegistry) for i in results) @@ -2234,7 +2234,7 @@ def test_create_device_field_headers(): # a field header. Set these to a non-empty value. request = device_manager.CreateDeviceRequest() - 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_device), "__call__") as call: @@ -2250,7 +2250,7 @@ def test_create_device_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2264,7 +2264,7 @@ async def test_create_device_field_headers_async(): # a field header. Set these to a non-empty value. request = device_manager.CreateDeviceRequest() - 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_device), "__call__") as call: @@ -2280,7 +2280,7 @@ async def test_create_device_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -2488,7 +2488,7 @@ def test_get_device_field_headers(): # a field header. Set these to a non-empty value. request = device_manager.GetDeviceRequest() - 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_device), "__call__") as call: @@ -2504,7 +2504,7 @@ def test_get_device_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2518,7 +2518,7 @@ async def test_get_device_field_headers_async(): # a field header. Set these to a non-empty value. request = device_manager.GetDeviceRequest() - 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_device), "__call__") as call: @@ -2534,7 +2534,7 @@ async def test_get_device_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2732,7 +2732,7 @@ def test_update_device_field_headers(): # a field header. Set these to a non-empty value. request = device_manager.UpdateDeviceRequest() - request.device.name = "device.name/value" + request.device.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_device), "__call__") as call: @@ -2748,7 +2748,7 @@ def test_update_device_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "device.name=device.name/value", + "device.name=name_value", ) in kw["metadata"] @@ -2762,7 +2762,7 @@ async def test_update_device_field_headers_async(): # a field header. Set these to a non-empty value. request = device_manager.UpdateDeviceRequest() - request.device.name = "device.name/value" + request.device.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.update_device), "__call__") as call: @@ -2778,7 +2778,7 @@ async def test_update_device_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "device.name=device.name/value", + "device.name=name_value", ) in kw["metadata"] @@ -2962,7 +2962,7 @@ def test_delete_device_field_headers(): # a field header. Set these to a non-empty value. request = device_manager.DeleteDeviceRequest() - 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_device), "__call__") as call: @@ -2978,7 +2978,7 @@ def test_delete_device_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -2992,7 +2992,7 @@ async def test_delete_device_field_headers_async(): # a field header. Set these to a non-empty value. request = device_manager.DeleteDeviceRequest() - 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_device), "__call__") as call: @@ -3008,7 +3008,7 @@ async def test_delete_device_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3190,7 +3190,7 @@ def test_list_devices_field_headers(): # a field header. Set these to a non-empty value. request = device_manager.ListDevicesRequest() - 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_devices), "__call__") as call: @@ -3206,7 +3206,7 @@ def test_list_devices_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3220,7 +3220,7 @@ async def test_list_devices_field_headers_async(): # a field header. Set these to a non-empty value. request = device_manager.ListDevicesRequest() - 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_devices), "__call__") as call: @@ -3238,7 +3238,7 @@ async def test_list_devices_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -3369,7 +3369,7 @@ def test_list_devices_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, resources.Device) for i in results) @@ -3621,7 +3621,7 @@ def test_modify_cloud_to_device_config_field_headers(): # a field header. Set these to a non-empty value. request = device_manager.ModifyCloudToDeviceConfigRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3639,7 +3639,7 @@ def test_modify_cloud_to_device_config_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3653,7 +3653,7 @@ async def test_modify_cloud_to_device_config_field_headers_async(): # a field header. Set these to a non-empty value. request = device_manager.ModifyCloudToDeviceConfigRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3673,7 +3673,7 @@ async def test_modify_cloud_to_device_config_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3872,7 +3872,7 @@ def test_list_device_config_versions_field_headers(): # a field header. Set these to a non-empty value. request = device_manager.ListDeviceConfigVersionsRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3890,7 +3890,7 @@ def test_list_device_config_versions_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -3904,7 +3904,7 @@ async def test_list_device_config_versions_field_headers_async(): # a field header. Set these to a non-empty value. request = device_manager.ListDeviceConfigVersionsRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -3924,7 +3924,7 @@ async def test_list_device_config_versions_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4112,7 +4112,7 @@ def test_list_device_states_field_headers(): # a field header. Set these to a non-empty value. request = device_manager.ListDeviceStatesRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4130,7 +4130,7 @@ def test_list_device_states_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4144,7 +4144,7 @@ async def test_list_device_states_field_headers_async(): # a field header. Set these to a non-empty value. request = device_manager.ListDeviceStatesRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -4164,7 +4164,7 @@ async def test_list_device_states_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -4356,7 +4356,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: @@ -4372,7 +4372,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"] @@ -4386,7 +4386,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: @@ -4402,7 +4402,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"] @@ -4606,7 +4606,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: @@ -4622,7 +4622,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"] @@ -4636,7 +4636,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: @@ -4652,7 +4652,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"] @@ -4858,7 +4858,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( @@ -4876,7 +4876,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"] @@ -4890,7 +4890,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( @@ -4910,7 +4910,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"] @@ -5128,7 +5128,7 @@ def test_send_command_to_device_field_headers(): # a field header. Set these to a non-empty value. request = device_manager.SendCommandToDeviceRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5146,7 +5146,7 @@ def test_send_command_to_device_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5160,7 +5160,7 @@ async def test_send_command_to_device_field_headers_async(): # a field header. Set these to a non-empty value. request = device_manager.SendCommandToDeviceRequest() - request.name = "name/value" + request.name = "name_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5180,7 +5180,7 @@ async def test_send_command_to_device_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "name=name/value", + "name=name_value", ) in kw["metadata"] @@ -5389,7 +5389,7 @@ def test_bind_device_to_gateway_field_headers(): # a field header. Set these to a non-empty value. request = device_manager.BindDeviceToGatewayRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5407,7 +5407,7 @@ def test_bind_device_to_gateway_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5421,7 +5421,7 @@ async def test_bind_device_to_gateway_field_headers_async(): # a field header. Set these to a non-empty value. request = device_manager.BindDeviceToGatewayRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5441,7 +5441,7 @@ async def test_bind_device_to_gateway_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5650,7 +5650,7 @@ def test_unbind_device_from_gateway_field_headers(): # a field header. Set these to a non-empty value. request = device_manager.UnbindDeviceFromGatewayRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5668,7 +5668,7 @@ def test_unbind_device_from_gateway_field_headers(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] @@ -5682,7 +5682,7 @@ async def test_unbind_device_from_gateway_field_headers_async(): # a field header. Set these to a non-empty value. request = device_manager.UnbindDeviceFromGatewayRequest() - request.parent = "parent/value" + request.parent = "parent_value" # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object( @@ -5702,7 +5702,7 @@ async def test_unbind_device_from_gateway_field_headers_async(): _, _, kw = call.mock_calls[0] assert ( "x-goog-request-params", - "parent=parent/value", + "parent=parent_value", ) in kw["metadata"] From 2e6777d8f58365f2addf1baf399693e6b309e74f Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 3 May 2022 20:18:43 +0200 Subject: [PATCH 34/41] chore(deps): update dependency google-api-python-client to v2.47.0 (#316) --- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index 2e5fa6e1..5a6db609 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -1,6 +1,6 @@ cryptography==37.0.1 flaky==3.7.0 -google-api-python-client==2.46.0 +google-api-python-client==2.47.0 google-auth-httplib2==0.1.0 google-auth==2.6.6 google-cloud-iot==2.4.1 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index 3b4898a4..7e2ad54e 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -1,6 +1,6 @@ cryptography==37.0.1 flaky==3.7.0 -google-api-python-client==2.46.0 +google-api-python-client==2.47.0 google-auth-httplib2==0.1.0 google-auth==2.6.6 google-cloud-iot==2.4.1 From 868eb89ec2a269abb0b727dea915be0ed55787e9 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 5 May 2022 02:43:55 +0200 Subject: [PATCH 35/41] chore(deps): update dependency cryptography to v37.0.2 (#317) --- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index 5a6db609..f924a596 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -1,4 +1,4 @@ -cryptography==37.0.1 +cryptography==37.0.2 flaky==3.7.0 google-api-python-client==2.47.0 google-auth-httplib2==0.1.0 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index 7e2ad54e..d5f35dc6 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -1,4 +1,4 @@ -cryptography==37.0.1 +cryptography==37.0.2 flaky==3.7.0 google-api-python-client==2.47.0 google-auth-httplib2==0.1.0 From 52d6bb2a0c2faec1365562a8580f526eebf84276 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 12:01:28 -0400 Subject: [PATCH 36/41] chore: [autoapprove] update readme_gen.py to include autoescape True (#318) Source-Link: https://github.com/googleapis/synthtool/commit/6b4d5a6407d740beb4158b302194a62a4108a8a6 Post-Processor: gcr.io/cloud-devrel-public-resources/owlbot-python:latest@sha256:f792ee1320e03eda2d13a5281a2989f7ed8a9e50b73ef6da97fac7e1e850b149 Co-authored-by: Owl Bot --- .github/.OwlBot.lock.yaml | 4 ++-- scripts/readme-gen/readme_gen.py | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index 64f82d6b..b631901e 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:f792ee1320e03eda2d13a5281a2989f7ed8a9e50b73ef6da97fac7e1e850b149 +# created: 2022-05-05T15:17:27.599381182Z 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 22ef533aec57e57ba419c39ebcbcc5a4cd9ea043 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:18:18 +0000 Subject: [PATCH 37/41] chore(python): auto approve template changes (#320) 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 +++ 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 .github/auto-approve.yml diff --git a/.github/.OwlBot.lock.yaml b/.github/.OwlBot.lock.yaml index b631901e..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:f792ee1320e03eda2d13a5281a2989f7ed8a9e50b73ef6da97fac7e1e850b149 -# created: 2022-05-05T15:17:27.599381182Z + 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" From a6d92758f4c749bfedd0697aa9b4cb0212d45513 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Thu, 12 May 2022 20:24:15 +0200 Subject: [PATCH 38/41] chore(deps): update dependency google-cloud-pubsub to v2.12.1 (#321) --- samples/api-client/accesstoken_example/requirements-test.txt | 2 +- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements-test.txt b/samples/api-client/accesstoken_example/requirements-test.txt index ebe3b3a6..c453d52e 100644 --- a/samples/api-client/accesstoken_example/requirements-test.txt +++ b/samples/api-client/accesstoken_example/requirements-test.txt @@ -1,3 +1,3 @@ pytest==7.1.2 -google-cloud-pubsub==2.12.0 +google-cloud-pubsub==2.12.1 google-cloud-storage==2.3.0 diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index f924a596..d0dedd10 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -4,7 +4,7 @@ google-api-python-client==2.47.0 google-auth-httplib2==0.1.0 google-auth==2.6.6 google-cloud-iot==2.4.1 -google-cloud-pubsub==2.12.0 +google-cloud-pubsub==2.12.1 google-cloud-storage==2.3.0 paho-mqtt==1.6.1 pyjwt==2.3.0 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index d5f35dc6..42552672 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -4,6 +4,6 @@ google-api-python-client==2.47.0 google-auth-httplib2==0.1.0 google-auth==2.6.6 google-cloud-iot==2.4.1 -google-cloud-pubsub==2.12.0 +google-cloud-pubsub==2.12.1 paho-mqtt==1.6.1 pyjwt==2.3.0 From a309da0d47ed8837699260546a1c139e3f732174 Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Fri, 13 May 2022 15:05:29 +0200 Subject: [PATCH 39/41] chore(deps): update dependency pyjwt to v2.4.0 (#322) --- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- samples/api-client/mqtt_example/requirements.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index d0dedd10..f56695d4 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -7,4 +7,4 @@ google-cloud-iot==2.4.1 google-cloud-pubsub==2.12.1 google-cloud-storage==2.3.0 paho-mqtt==1.6.1 -pyjwt==2.3.0 +pyjwt==2.4.0 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index 42552672..8d85f27b 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -6,4 +6,4 @@ google-auth==2.6.6 google-cloud-iot==2.4.1 google-cloud-pubsub==2.12.1 paho-mqtt==1.6.1 -pyjwt==2.3.0 +pyjwt==2.4.0 diff --git a/samples/api-client/mqtt_example/requirements.txt b/samples/api-client/mqtt_example/requirements.txt index 0779d49d..9f276ddf 100644 --- a/samples/api-client/mqtt_example/requirements.txt +++ b/samples/api-client/mqtt_example/requirements.txt @@ -1,2 +1,2 @@ paho-mqtt==1.6.1 -pyjwt==2.3.0 +pyjwt==2.4.0 From 4777836058d3765cf6aef7e08cd2117272066bff Mon Sep 17 00:00:00 2001 From: WhiteSource Renovate Date: Tue, 17 May 2022 20:49:12 +0200 Subject: [PATCH 40/41] chore(deps): update dependency google-api-python-client to v2.48.0 (#323) --- samples/api-client/accesstoken_example/requirements.txt | 2 +- samples/api-client/manager/requirements.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/samples/api-client/accesstoken_example/requirements.txt b/samples/api-client/accesstoken_example/requirements.txt index f56695d4..d4d8feff 100644 --- a/samples/api-client/accesstoken_example/requirements.txt +++ b/samples/api-client/accesstoken_example/requirements.txt @@ -1,6 +1,6 @@ cryptography==37.0.2 flaky==3.7.0 -google-api-python-client==2.47.0 +google-api-python-client==2.48.0 google-auth-httplib2==0.1.0 google-auth==2.6.6 google-cloud-iot==2.4.1 diff --git a/samples/api-client/manager/requirements.txt b/samples/api-client/manager/requirements.txt index 8d85f27b..f1fa1efa 100644 --- a/samples/api-client/manager/requirements.txt +++ b/samples/api-client/manager/requirements.txt @@ -1,6 +1,6 @@ cryptography==37.0.2 flaky==3.7.0 -google-api-python-client==2.47.0 +google-api-python-client==2.48.0 google-auth-httplib2==0.1.0 google-auth==2.6.6 google-cloud-iot==2.4.1 From be1b300039b6277d15e6547aebdac7ca5a591042 Mon Sep 17 00:00:00 2001 From: "release-please[bot]" <55107282+release-please[bot]@users.noreply.github.com> Date: Thu, 19 May 2022 08:52:48 -0400 Subject: [PATCH 41/41] chore(main): release 2.5.0 (#304) 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 a3eb5685..f6d52e25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,23 @@ [1]: https://pypi.org/project/google-cloud-iot/#history +## [2.5.0](https://github.com/googleapis/python-iot/compare/v2.4.1...v2.5.0) (2022-05-17) + + +### Features + +* AuditConfig for IAM v1 ([bc445c6](https://github.com/googleapis/python-iot/commit/bc445c6c8e90867b6c7d7d5bddab8abbc970deb3)) + + +### Bug Fixes + +* **deps:** require grpc-google-iam-v1 >=0.12.4 ([bc445c6](https://github.com/googleapis/python-iot/commit/bc445c6c8e90867b6c7d7d5bddab8abbc970deb3)) + + +### Documentation + +* fix type in docstring for map fields ([bc445c6](https://github.com/googleapis/python-iot/commit/bc445c6c8e90867b6c7d7d5bddab8abbc970deb3)) + ### [2.4.1](https://github.com/googleapis/python-iot/compare/v2.4.0...v2.4.1) (2022-03-05) diff --git a/setup.py b/setup.py index 4d9703d4..196dfb84 100644 --- a/setup.py +++ b/setup.py @@ -19,7 +19,7 @@ name = "google-cloud-iot" description = "Cloud IoT API API client library" -version = "2.4.1" +version = "2.5.0" release_status = "Development Status :: 5 - Production/Stable" dependencies = [ # NOTE: Maintainers, please do not require google-api-core>=2.x.x