From 5d7a613f54e5326adf719e7aeb9cac06ef64f48c Mon Sep 17 00:00:00 2001 From: Yoshi Automation Bot Date: Thu, 25 Jun 2020 11:13:46 -0700 Subject: [PATCH] fix: update retry configs (#19) --- .flake8 | 2 + .gitignore | 2 + .kokoro/publish-docs.sh | 2 - .kokoro/release.sh | 2 - .kokoro/samples/lint/common.cfg | 34 + .kokoro/samples/lint/continuous.cfg | 6 + .kokoro/samples/lint/periodic.cfg | 6 + .kokoro/samples/lint/presubmit.cfg | 6 + .kokoro/samples/python3.6/common.cfg | 34 + .kokoro/samples/python3.6/continuous.cfg | 7 + .kokoro/samples/python3.6/periodic.cfg | 6 + .kokoro/samples/python3.6/presubmit.cfg | 6 + .kokoro/samples/python3.7/common.cfg | 34 + .kokoro/samples/python3.7/continuous.cfg | 6 + .kokoro/samples/python3.7/periodic.cfg | 6 + .kokoro/samples/python3.7/presubmit.cfg | 6 + .kokoro/samples/python3.8/common.cfg | 34 + .kokoro/samples/python3.8/continuous.cfg | 6 + .kokoro/samples/python3.8/periodic.cfg | 6 + .kokoro/samples/python3.8/presubmit.cfg | 6 + .kokoro/test-samples.sh | 104 +++ MANIFEST.in | 3 + docs/conf.py | 11 +- docs/index.rst | 2 + docs/multiprocessing.rst | 7 + google/cloud/iot_v1/__init__.py | 10 +- .../iot_v1/gapic/device_manager_client.py | 755 +++++++++--------- .../gapic/device_manager_client_config.py | 58 +- google/cloud/iot_v1/gapic/enums.py | 8 +- .../device_manager_grpc_transport.py | 146 ++-- .../cloud/iot_v1/proto/device_manager_pb2.py | 582 ++++++++------ google/cloud/iot_v1/proto/resources_pb2.py | 445 +++++++---- google/cloud/iot_v1/types.py | 5 +- noxfile.py | 32 +- scripts/decrypt-secrets.sh | 33 + scripts/readme-gen/readme_gen.py | 66 ++ scripts/readme-gen/templates/README.tmpl.rst | 87 ++ scripts/readme-gen/templates/auth.tmpl.rst | 9 + .../templates/auth_api_key.tmpl.rst | 14 + .../templates/install_deps.tmpl.rst | 29 + .../templates/install_portaudio.tmpl.rst | 35 + synth.metadata | 18 +- synth.py | 3 + testing/.gitignore | 3 + .../gapic/v1/test_device_manager_client_v1.py | 296 +++---- 45 files changed, 1908 insertions(+), 1070 deletions(-) create mode 100644 .kokoro/samples/lint/common.cfg create mode 100644 .kokoro/samples/lint/continuous.cfg create mode 100644 .kokoro/samples/lint/periodic.cfg create mode 100644 .kokoro/samples/lint/presubmit.cfg create mode 100644 .kokoro/samples/python3.6/common.cfg create mode 100644 .kokoro/samples/python3.6/continuous.cfg create mode 100644 .kokoro/samples/python3.6/periodic.cfg create mode 100644 .kokoro/samples/python3.6/presubmit.cfg create mode 100644 .kokoro/samples/python3.7/common.cfg create mode 100644 .kokoro/samples/python3.7/continuous.cfg create mode 100644 .kokoro/samples/python3.7/periodic.cfg create mode 100644 .kokoro/samples/python3.7/presubmit.cfg create mode 100644 .kokoro/samples/python3.8/common.cfg create mode 100644 .kokoro/samples/python3.8/continuous.cfg create mode 100644 .kokoro/samples/python3.8/periodic.cfg create mode 100644 .kokoro/samples/python3.8/presubmit.cfg create mode 100755 .kokoro/test-samples.sh create mode 100644 docs/multiprocessing.rst create mode 100755 scripts/decrypt-secrets.sh create mode 100644 scripts/readme-gen/readme_gen.py create mode 100644 scripts/readme-gen/templates/README.tmpl.rst create mode 100644 scripts/readme-gen/templates/auth.tmpl.rst create mode 100644 scripts/readme-gen/templates/auth_api_key.tmpl.rst create mode 100644 scripts/readme-gen/templates/install_deps.tmpl.rst create mode 100644 scripts/readme-gen/templates/install_portaudio.tmpl.rst create mode 100644 testing/.gitignore diff --git a/.flake8 b/.flake8 index 20fe9bda..ed931638 100644 --- a/.flake8 +++ b/.flake8 @@ -21,6 +21,8 @@ exclude = # Exclude generated code. **/proto/** **/gapic/** + **/services/** + **/types/** *_pb2.py # Standard linting exemptions. diff --git a/.gitignore b/.gitignore index 3fb06e09..b87e1ed5 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ dist build eggs +.eggs parts bin var @@ -49,6 +50,7 @@ bigquery/docs/generated # Virtual environment env/ coverage.xml +sponge_log.xml # System test environment variables. system_tests/local_test_setup diff --git a/.kokoro/publish-docs.sh b/.kokoro/publish-docs.sh index 76cd90dd..6b91ee5f 100755 --- a/.kokoro/publish-docs.sh +++ b/.kokoro/publish-docs.sh @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash - set -eo pipefail # Disable buffering, so that the logs stream through. diff --git a/.kokoro/release.sh b/.kokoro/release.sh index a5df226c..04e563eb 100755 --- a/.kokoro/release.sh +++ b/.kokoro/release.sh @@ -13,8 +13,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -#!/bin/bash - set -eo pipefail # Start the releasetool reporter diff --git a/.kokoro/samples/lint/common.cfg b/.kokoro/samples/lint/common.cfg new file mode 100644 index 00000000..aef9ae58 --- /dev/null +++ b/.kokoro/samples/lint/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Specify which tests to run +env_vars: { + key: "RUN_TESTS_SESSION" + value: "lint" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/python-iot/.kokoro/test-samples.sh" +} + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" +} + +# Download secrets for samples +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "python-iot/.kokoro/trampoline.sh" \ No newline at end of file diff --git a/.kokoro/samples/lint/continuous.cfg b/.kokoro/samples/lint/continuous.cfg new file mode 100644 index 00000000..a1c8d975 --- /dev/null +++ b/.kokoro/samples/lint/continuous.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/.kokoro/samples/lint/periodic.cfg b/.kokoro/samples/lint/periodic.cfg new file mode 100644 index 00000000..50fec964 --- /dev/null +++ b/.kokoro/samples/lint/periodic.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "False" +} \ No newline at end of file diff --git a/.kokoro/samples/lint/presubmit.cfg b/.kokoro/samples/lint/presubmit.cfg new file mode 100644 index 00000000..a1c8d975 --- /dev/null +++ b/.kokoro/samples/lint/presubmit.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/.kokoro/samples/python3.6/common.cfg b/.kokoro/samples/python3.6/common.cfg new file mode 100644 index 00000000..48bcae3a --- /dev/null +++ b/.kokoro/samples/python3.6/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Specify which tests to run +env_vars: { + key: "RUN_TESTS_SESSION" + value: "py-3.6" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/python-iot/.kokoro/test-samples.sh" +} + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" +} + +# Download secrets for samples +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "python-iot/.kokoro/trampoline.sh" \ No newline at end of file diff --git a/.kokoro/samples/python3.6/continuous.cfg b/.kokoro/samples/python3.6/continuous.cfg new file mode 100644 index 00000000..7218af14 --- /dev/null +++ b/.kokoro/samples/python3.6/continuous.cfg @@ -0,0 +1,7 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} + diff --git a/.kokoro/samples/python3.6/periodic.cfg b/.kokoro/samples/python3.6/periodic.cfg new file mode 100644 index 00000000..50fec964 --- /dev/null +++ b/.kokoro/samples/python3.6/periodic.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "False" +} \ No newline at end of file diff --git a/.kokoro/samples/python3.6/presubmit.cfg b/.kokoro/samples/python3.6/presubmit.cfg new file mode 100644 index 00000000..a1c8d975 --- /dev/null +++ b/.kokoro/samples/python3.6/presubmit.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/.kokoro/samples/python3.7/common.cfg b/.kokoro/samples/python3.7/common.cfg new file mode 100644 index 00000000..c32738b9 --- /dev/null +++ b/.kokoro/samples/python3.7/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Specify which tests to run +env_vars: { + key: "RUN_TESTS_SESSION" + value: "py-3.7" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/python-iot/.kokoro/test-samples.sh" +} + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" +} + +# Download secrets for samples +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "python-iot/.kokoro/trampoline.sh" \ No newline at end of file diff --git a/.kokoro/samples/python3.7/continuous.cfg b/.kokoro/samples/python3.7/continuous.cfg new file mode 100644 index 00000000..a1c8d975 --- /dev/null +++ b/.kokoro/samples/python3.7/continuous.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/.kokoro/samples/python3.7/periodic.cfg b/.kokoro/samples/python3.7/periodic.cfg new file mode 100644 index 00000000..50fec964 --- /dev/null +++ b/.kokoro/samples/python3.7/periodic.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "False" +} \ No newline at end of file diff --git a/.kokoro/samples/python3.7/presubmit.cfg b/.kokoro/samples/python3.7/presubmit.cfg new file mode 100644 index 00000000..a1c8d975 --- /dev/null +++ b/.kokoro/samples/python3.7/presubmit.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/.kokoro/samples/python3.8/common.cfg b/.kokoro/samples/python3.8/common.cfg new file mode 100644 index 00000000..29f96249 --- /dev/null +++ b/.kokoro/samples/python3.8/common.cfg @@ -0,0 +1,34 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +# Build logs will be here +action { + define_artifacts { + regex: "**/*sponge_log.xml" + } +} + +# Specify which tests to run +env_vars: { + key: "RUN_TESTS_SESSION" + value: "py-3.8" +} + +env_vars: { + key: "TRAMPOLINE_BUILD_FILE" + value: "github/python-iot/.kokoro/test-samples.sh" +} + +# Configure the docker image for kokoro-trampoline. +env_vars: { + key: "TRAMPOLINE_IMAGE" + value: "gcr.io/cloud-devrel-kokoro-resources/python-samples-testing-docker" +} + +# Download secrets for samples +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/python-docs-samples" + +# Download trampoline resources. +gfile_resources: "/bigstore/cloud-devrel-kokoro-resources/trampoline" + +# Use the trampoline script to run in docker. +build_file: "python-iot/.kokoro/trampoline.sh" \ No newline at end of file diff --git a/.kokoro/samples/python3.8/continuous.cfg b/.kokoro/samples/python3.8/continuous.cfg new file mode 100644 index 00000000..a1c8d975 --- /dev/null +++ b/.kokoro/samples/python3.8/continuous.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/.kokoro/samples/python3.8/periodic.cfg b/.kokoro/samples/python3.8/periodic.cfg new file mode 100644 index 00000000..50fec964 --- /dev/null +++ b/.kokoro/samples/python3.8/periodic.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "False" +} \ No newline at end of file diff --git a/.kokoro/samples/python3.8/presubmit.cfg b/.kokoro/samples/python3.8/presubmit.cfg new file mode 100644 index 00000000..a1c8d975 --- /dev/null +++ b/.kokoro/samples/python3.8/presubmit.cfg @@ -0,0 +1,6 @@ +# Format: //devtools/kokoro/config/proto/build.proto + +env_vars: { + key: "INSTALL_LIBRARY_FROM_SOURCE" + value: "True" +} \ No newline at end of file diff --git a/.kokoro/test-samples.sh b/.kokoro/test-samples.sh new file mode 100755 index 00000000..331b2579 --- /dev/null +++ b/.kokoro/test-samples.sh @@ -0,0 +1,104 @@ +#!/bin/bash +# Copyright 2020 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://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. + + +# `-e` enables the script to automatically fail when a command fails +# `-o pipefail` sets the exit code to the rightmost comment to exit with a non-zero +set -eo pipefail +# Enables `**` to include files nested inside sub-folders +shopt -s globstar + +cd github/python-iot + +# Run periodic samples tests at latest release +if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then + LATEST_RELEASE=$(git describe --abbrev=0 --tags) + git checkout $LATEST_RELEASE +fi + +# Disable buffering, so that the logs stream through. +export PYTHONUNBUFFERED=1 + +# Debug: show build environment +env | grep KOKORO + +# Install nox +python3.6 -m pip install --upgrade --quiet nox + +# Use secrets acessor service account to get secrets +if [[ -f "${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" ]]; then + gcloud auth activate-service-account \ + --key-file="${KOKORO_GFILE_DIR}/secrets_viewer_service_account.json" \ + --project="cloud-devrel-kokoro-resources" +fi + +# This script will create 3 files: +# - testing/test-env.sh +# - testing/service-account.json +# - testing/client-secrets.json +./scripts/decrypt-secrets.sh + +source ./testing/test-env.sh +export GOOGLE_APPLICATION_CREDENTIALS=$(pwd)/testing/service-account.json + +# For cloud-run session, we activate the service account for gcloud sdk. +gcloud auth activate-service-account \ + --key-file "${GOOGLE_APPLICATION_CREDENTIALS}" + +export GOOGLE_CLIENT_SECRETS=$(pwd)/testing/client-secrets.json + +echo -e "\n******************** TESTING PROJECTS ********************" + +# Switch to 'fail at end' to allow all tests to complete before exiting. +set +e +# Use RTN to return a non-zero value if the test fails. +RTN=0 +ROOT=$(pwd) +# Find all requirements.txt in the samples directory (may break on whitespace). +for file in samples/**/requirements.txt; do + cd "$ROOT" + # Navigate to the project folder. + file=$(dirname "$file") + cd "$file" + + echo "------------------------------------------------------------" + echo "- testing $file" + echo "------------------------------------------------------------" + + # Use nox to execute the tests for the project. + python3.6 -m nox -s "$RUN_TESTS_SESSION" + EXIT=$? + + # If this is a periodic build, send the test log to the Build Cop Bot. + # See https://github.com/googleapis/repo-automation-bots/tree/master/packages/buildcop. + if [[ $KOKORO_BUILD_ARTIFACTS_SUBDIR = *"periodic"* ]]; then + chmod +x $KOKORO_GFILE_DIR/linux_amd64/buildcop + $KOKORO_GFILE_DIR/linux_amd64/buildcop + fi + + if [[ $EXIT -ne 0 ]]; then + RTN=1 + echo -e "\n Testing failed: Nox returned a non-zero exit code. \n" + else + echo -e "\n Testing completed.\n" + fi + +done +cd "$ROOT" + +# Workaround for Kokoro permissions issue: delete secrets +rm testing/{test-env.sh,client-secrets.json,service-account.json} + +exit "$RTN" \ No newline at end of file diff --git a/MANIFEST.in b/MANIFEST.in index 68855abc..e9e29d12 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -20,3 +20,6 @@ recursive-include google *.json *.proto recursive-include tests * global-exclude *.py[co] global-exclude __pycache__ + +# Exclude scripts for samples readmegen +prune scripts/readme-gen \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py index debac218..94f74897 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -38,21 +38,18 @@ "sphinx.ext.napoleon", "sphinx.ext.todo", "sphinx.ext.viewcode", + "recommonmark", ] # autodoc/autosummary flags autoclass_content = "both" -autodoc_default_flags = ["members"] +autodoc_default_options = {"members": True} autosummary_generate = True # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] -# Allow markdown includes (so releases.md can include CHANGLEOG.md) -# http://www.sphinx-doc.org/en/master/markdown.html -source_parsers = {".md": "recommonmark.parser.CommonMarkParser"} - # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # source_suffix = ['.rst', '.md'] @@ -293,7 +290,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (master_doc, "google-cloud-iot", u"google-cloud-iot Documentation", [author], 1) + (master_doc, "google-cloud-iot", u"google-cloud-iot Documentation", [author], 1,) ] # If true, show URL addresses after external links. @@ -334,7 +331,7 @@ intersphinx_mapping = { "python": ("http://python.readthedocs.org/en/latest/", None), "google-auth": ("https://google-auth.readthedocs.io/en/stable", 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.io/grpc/python/", None), } diff --git a/docs/index.rst b/docs/index.rst index 5ddf5ffe..2fafcc45 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,5 +1,7 @@ .. include:: README.rst +.. include:: multiprocessing.rst + Api Reference ------------- .. toctree:: diff --git a/docs/multiprocessing.rst b/docs/multiprocessing.rst new file mode 100644 index 00000000..1cb29d4c --- /dev/null +++ b/docs/multiprocessing.rst @@ -0,0 +1,7 @@ +.. note:: + + Because this client uses :mod:`grpcio` library, it is safe to + share instances across threads. In multiprocessing scenarios, the best + practice is to create client instances *after* the invocation of + :func:`os.fork` by :class:`multiprocessing.Pool` or + :class:`multiprocessing.Process`. diff --git a/google/cloud/iot_v1/__init__.py b/google/cloud/iot_v1/__init__.py index 293e7952..eb1976de 100644 --- a/google/cloud/iot_v1/__init__.py +++ b/google/cloud/iot_v1/__init__.py @@ -26,8 +26,8 @@ if sys.version_info[:2] == (2, 7): message = ( - "A future version of this library will drop support for Python 2.7." - "More details about Python 2 support for Google Cloud Client Libraries" + "A future version of this library will drop support for Python 2.7. " + "More details about Python 2 support for Google Cloud Client Libraries " "can be found at https://cloud.google.com/python/docs/python2-sunset/" ) warnings.warn(message, DeprecationWarning) @@ -38,4 +38,8 @@ class DeviceManagerClient(device_manager_client.DeviceManagerClient): enums = enums -__all__ = ("enums", "types", "DeviceManagerClient") +__all__ = ( + "enums", + "types", + "DeviceManagerClient", +) diff --git a/google/cloud/iot_v1/gapic/device_manager_client.py b/google/cloud/iot_v1/gapic/device_manager_client.py index 8507e331..0ab40a26 100644 --- a/google/cloud/iot_v1/gapic/device_manager_client.py +++ b/google/cloud/iot_v1/gapic/device_manager_client.py @@ -44,7 +44,7 @@ from google.protobuf import field_mask_pb2 -_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-iot").version +_GAPIC_LIBRARY_VERSION = pkg_resources.get_distribution("google-cloud-iot",).version class DeviceManagerClient(object): @@ -194,12 +194,12 @@ def __init__( self.transport = transport else: self.transport = device_manager_grpc_transport.DeviceManagerGrpcTransport( - address=api_endpoint, channel=channel, credentials=credentials + address=api_endpoint, channel=channel, credentials=credentials, ) if client_info is None: client_info = google.api_core.gapic_v1.client_info.ClientInfo( - gapic_version=_GAPIC_LIBRARY_VERSION + gapic_version=_GAPIC_LIBRARY_VERSION, ) else: client_info.gapic_version = _GAPIC_LIBRARY_VERSION @@ -210,7 +210,7 @@ def __init__( # (Ordinarily, these are the defaults specified in the `*_config.py` # file next to this one.) self._method_configs = google.api_core.gapic_v1.config.parse_method_configs( - client_config["interfaces"][self._INTERFACE_NAME] + client_config["interfaces"][self._INTERFACE_NAME], ) # Save a dictionary of cached API call functions. @@ -220,39 +220,179 @@ def __init__( self._inner_api_calls = {} # Service calls - def create_device_registry( + def delete_device_registry( self, - parent, - device_registry, + name, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Creates a device registry that contains devices. + Deletes a device registry configuration. Example: >>> from google.cloud import iot_v1 >>> >>> client = iot_v1.DeviceManagerClient() >>> - >>> parent = client.location_path('[PROJECT]', '[LOCATION]') + >>> name = client.registry_path('[PROJECT]', '[LOCATION]', '[REGISTRY]') >>> - >>> # TODO: Initialize `device_registry`: - >>> device_registry = {} + >>> client.delete_device_registry(name) + + Args: + name (str): Required. The name of the device registry. For example, + ``projects/example-project/locations/us-central1/registries/my-registry``. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "delete_device_registry" not in self._inner_api_calls: + self._inner_api_calls[ + "delete_device_registry" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.delete_device_registry, + default_retry=self._method_configs["DeleteDeviceRegistry"].retry, + default_timeout=self._method_configs["DeleteDeviceRegistry"].timeout, + client_info=self._client_info, + ) + + request = device_manager_pb2.DeleteDeviceRegistryRequest(name=name,) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + self._inner_api_calls["delete_device_registry"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def delete_device( + self, + name, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Deletes a device. + + Example: + >>> from google.cloud import iot_v1 >>> - >>> response = client.create_device_registry(parent, device_registry) + >>> client = iot_v1.DeviceManagerClient() + >>> + >>> name = client.device_path('[PROJECT]', '[LOCATION]', '[REGISTRY]', '[DEVICE]') + >>> + >>> client.delete_device(name) Args: - parent (str): Required. The project and cloud region where this device registry must - be created. For example, - ``projects/example-project/locations/us-central1``. - device_registry (Union[dict, ~google.cloud.iot_v1.types.DeviceRegistry]): Required. The device registry. The field ``name`` must be empty. The - server will generate that field from the device registry ``id`` provided - and the ``parent`` field. + name (str): Required. The name of the device. For example, + ``projects/p0/locations/us-central1/registries/registry0/devices/device0`` + or + ``projects/p0/locations/us-central1/registries/registry0/devices/{num_id}``. + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.iot_v1.types.DeviceRegistry` + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "delete_device" not in self._inner_api_calls: + self._inner_api_calls[ + "delete_device" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.delete_device, + default_retry=self._method_configs["DeleteDevice"].retry, + default_timeout=self._method_configs["DeleteDevice"].timeout, + client_info=self._client_info, + ) + + request = device_manager_pb2.DeleteDeviceRequest(name=name,) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("name", name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + self._inner_api_calls["delete_device"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def modify_cloud_to_device_config( + self, + name, + binary_data, + version_to_update=None, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Modifies the configuration for the device, which is eventually sent from + the Cloud IoT Core servers. Returns the modified configuration version and + its metadata. + + Example: + >>> from google.cloud import iot_v1 + >>> + >>> client = iot_v1.DeviceManagerClient() + >>> + >>> name = client.device_path('[PROJECT]', '[LOCATION]', '[REGISTRY]', '[DEVICE]') + >>> + >>> # TODO: Initialize `binary_data`: + >>> binary_data = b'' + >>> + >>> response = client.modify_cloud_to_device_config(name, binary_data) + + Args: + name (str): Required. The name of the device. For example, + ``projects/p0/locations/us-central1/registries/registry0/devices/device0`` + or + ``projects/p0/locations/us-central1/registries/registry0/devices/{num_id}``. + binary_data (bytes): Required. The configuration data for the device. + version_to_update (long): The version number to update. If this value is zero, it will not check the + version number of the server and will always update the current version; + otherwise, this update will fail if the version number found on the server + does not match this version number. This is used to support multiple + simultaneous updates without losing data. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -263,7 +403,7 @@ def create_device_registry( that is provided to the method. Returns: - A :class:`~google.cloud.iot_v1.types.DeviceRegistry` instance. + A :class:`~google.cloud.iot_v1.types.DeviceConfig` instance. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -273,24 +413,26 @@ def create_device_registry( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "create_device_registry" not in self._inner_api_calls: + if "modify_cloud_to_device_config" not in self._inner_api_calls: self._inner_api_calls[ - "create_device_registry" + "modify_cloud_to_device_config" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.create_device_registry, - default_retry=self._method_configs["CreateDeviceRegistry"].retry, - default_timeout=self._method_configs["CreateDeviceRegistry"].timeout, + self.transport.modify_cloud_to_device_config, + default_retry=self._method_configs["ModifyCloudToDeviceConfig"].retry, + default_timeout=self._method_configs[ + "ModifyCloudToDeviceConfig" + ].timeout, client_info=self._client_info, ) - request = device_manager_pb2.CreateDeviceRegistryRequest( - parent=parent, device_registry=device_registry + request = device_manager_pb2.ModifyCloudToDeviceConfigRequest( + name=name, binary_data=binary_data, version_to_update=version_to_update, ) if metadata is None: metadata = [] metadata = list(metadata) try: - routing_header = [("parent", parent)] + routing_header = [("name", name)] except AttributeError: pass else: @@ -299,32 +441,59 @@ def create_device_registry( ) metadata.append(routing_metadata) - return self._inner_api_calls["create_device_registry"]( + return self._inner_api_calls["modify_cloud_to_device_config"]( request, retry=retry, timeout=timeout, metadata=metadata ) - def get_device_registry( + def send_command_to_device( self, name, + binary_data, + subfolder=None, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Gets a device registry configuration. + Sends a command to the specified device. In order for a device to be + able to receive commands, it must: + + 1) be connected to Cloud IoT Core using the MQTT protocol, and + 2) be subscribed to the group of MQTT topics specified by + /devices/{device-id}/commands/#. This subscription will receive + commands at the top-level topic /devices/{device-id}/commands as well + as commands for subfolders, like + /devices/{device-id}/commands/subfolder. Note that subscribing to + specific subfolders is not supported. If the command could not be + delivered to the device, this method will return an error; in + particular, if the device is not subscribed, this method will return + FAILED_PRECONDITION. Otherwise, this method will return OK. If the + subscription is QoS 1, at least once delivery will be guaranteed; for + QoS 0, no acknowledgment will be expected from the device. Example: >>> from google.cloud import iot_v1 >>> >>> client = iot_v1.DeviceManagerClient() >>> - >>> name = client.registry_path('[PROJECT]', '[LOCATION]', '[REGISTRY]') + >>> name = client.device_path('[PROJECT]', '[LOCATION]', '[REGISTRY]', '[DEVICE]') >>> - >>> response = client.get_device_registry(name) + >>> # TODO: Initialize `binary_data`: + >>> binary_data = b'' + >>> + >>> response = client.send_command_to_device(name, binary_data) Args: - name (str): Required. The name of the device registry. For example, - ``projects/example-project/locations/us-central1/registries/my-registry``. + name (str): Required. The name of the device. For example, + ``projects/p0/locations/us-central1/registries/registry0/devices/device0`` + or + ``projects/p0/locations/us-central1/registries/registry0/devices/{num_id}``. + binary_data (bytes): Required. The command data to send to the device. + subfolder (str): Optional subfolder for the command. If empty, the command will be delivered + to the /devices/{device-id}/commands topic, otherwise it will be delivered + to the /devices/{device-id}/commands/{subfolder} topic. Multi-level + subfolders are allowed. This field must not have more than 256 characters, + and must not contain any MQTT wildcards ("+" or "#") or null characters. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -335,7 +504,7 @@ def get_device_registry( that is provided to the method. Returns: - A :class:`~google.cloud.iot_v1.types.DeviceRegistry` instance. + A :class:`~google.cloud.iot_v1.types.SendCommandToDeviceResponse` instance. Raises: google.api_core.exceptions.GoogleAPICallError: If the request @@ -345,17 +514,19 @@ def get_device_registry( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "get_device_registry" not in self._inner_api_calls: + if "send_command_to_device" not in self._inner_api_calls: self._inner_api_calls[ - "get_device_registry" + "send_command_to_device" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.get_device_registry, - default_retry=self._method_configs["GetDeviceRegistry"].retry, - default_timeout=self._method_configs["GetDeviceRegistry"].timeout, + self.transport.send_command_to_device, + default_retry=self._method_configs["SendCommandToDevice"].retry, + default_timeout=self._method_configs["SendCommandToDevice"].timeout, client_info=self._client_info, ) - request = device_manager_pb2.GetDeviceRegistryRequest(name=name) + request = device_manager_pb2.SendCommandToDeviceRequest( + name=name, binary_data=binary_data, subfolder=subfolder, + ) if metadata is None: metadata = [] metadata = list(metadata) @@ -369,50 +540,43 @@ def get_device_registry( ) metadata.append(routing_metadata) - return self._inner_api_calls["get_device_registry"]( + return self._inner_api_calls["send_command_to_device"]( request, retry=retry, timeout=timeout, metadata=metadata ) - def update_device_registry( + def create_device_registry( self, + parent, device_registry, - update_mask, retry=google.api_core.gapic_v1.method.DEFAULT, timeout=google.api_core.gapic_v1.method.DEFAULT, metadata=None, ): """ - Updates a device registry configuration. + Creates a device registry that contains devices. Example: >>> from google.cloud import iot_v1 >>> >>> client = iot_v1.DeviceManagerClient() >>> + >>> parent = client.location_path('[PROJECT]', '[LOCATION]') + >>> >>> # TODO: Initialize `device_registry`: >>> device_registry = {} >>> - >>> # TODO: Initialize `update_mask`: - >>> update_mask = {} - >>> - >>> response = client.update_device_registry(device_registry, update_mask) + >>> response = client.create_device_registry(parent, device_registry) Args: - device_registry (Union[dict, ~google.cloud.iot_v1.types.DeviceRegistry]): Required. The new values for the device registry. The ``id`` field must - be empty, and the ``name`` field must indicate the path of the resource. - For example, - ``projects/example-project/locations/us-central1/registries/my-registry``. + parent (str): Required. The project and cloud region where this device registry + must be created. For example, + ``projects/example-project/locations/us-central1``. + device_registry (Union[dict, ~google.cloud.iot_v1.types.DeviceRegistry]): Required. The device registry. The field ``name`` must be empty. The + server will generate that field from the device registry ``id`` provided + and the ``parent`` field. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.iot_v1.types.DeviceRegistry` - update_mask (Union[dict, ~google.cloud.iot_v1.types.FieldMask]): Required. Only updates the ``device_registry`` fields indicated by this - mask. The field mask must not be empty, and it must not contain fields - that are immutable or only set by the server. Mutable top-level fields: - ``event_notification_config``, ``http_config``, ``mqtt_config``, and - ``state_notification_config``. - - If a dict is provided, it must be of the same form as the protobuf - message :class:`~google.cloud.iot_v1.types.FieldMask` retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -433,24 +597,24 @@ def update_device_registry( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "update_device_registry" not in self._inner_api_calls: + if "create_device_registry" not in self._inner_api_calls: self._inner_api_calls[ - "update_device_registry" + "create_device_registry" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.update_device_registry, - default_retry=self._method_configs["UpdateDeviceRegistry"].retry, - default_timeout=self._method_configs["UpdateDeviceRegistry"].timeout, + self.transport.create_device_registry, + default_retry=self._method_configs["CreateDeviceRegistry"].retry, + default_timeout=self._method_configs["CreateDeviceRegistry"].timeout, client_info=self._client_info, ) - request = device_manager_pb2.UpdateDeviceRegistryRequest( - device_registry=device_registry, update_mask=update_mask + request = device_manager_pb2.CreateDeviceRegistryRequest( + parent=parent, device_registry=device_registry, ) if metadata is None: metadata = [] metadata = list(metadata) try: - routing_header = [("device_registry.name", device_registry.name)] + routing_header = [("parent", parent)] except AttributeError: pass else: @@ -459,11 +623,11 @@ def update_device_registry( ) metadata.append(routing_metadata) - return self._inner_api_calls["update_device_registry"]( + return self._inner_api_calls["create_device_registry"]( request, retry=retry, timeout=timeout, metadata=metadata ) - def delete_device_registry( + def get_device_registry( self, name, retry=google.api_core.gapic_v1.method.DEFAULT, @@ -471,7 +635,7 @@ def delete_device_registry( metadata=None, ): """ - Deletes a device registry configuration. + Gets a device registry configuration. Example: >>> from google.cloud import iot_v1 @@ -480,7 +644,7 @@ def delete_device_registry( >>> >>> name = client.registry_path('[PROJECT]', '[LOCATION]', '[REGISTRY]') >>> - >>> client.delete_device_registry(name) + >>> response = client.get_device_registry(name) Args: name (str): Required. The name of the device registry. For example, @@ -494,6 +658,9 @@ def delete_device_registry( metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata that is provided to the method. + Returns: + A :class:`~google.cloud.iot_v1.types.DeviceRegistry` instance. + Raises: google.api_core.exceptions.GoogleAPICallError: If the request failed for any reason. @@ -502,17 +669,17 @@ def delete_device_registry( ValueError: If the parameters are invalid. """ # Wrap the transport method to add retry and timeout logic. - if "delete_device_registry" not in self._inner_api_calls: + if "get_device_registry" not in self._inner_api_calls: self._inner_api_calls[ - "delete_device_registry" + "get_device_registry" ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_device_registry, - default_retry=self._method_configs["DeleteDeviceRegistry"].retry, - default_timeout=self._method_configs["DeleteDeviceRegistry"].timeout, + self.transport.get_device_registry, + default_retry=self._method_configs["GetDeviceRegistry"].retry, + default_timeout=self._method_configs["GetDeviceRegistry"].timeout, client_info=self._client_info, ) - request = device_manager_pb2.DeleteDeviceRegistryRequest(name=name) + request = device_manager_pb2.GetDeviceRegistryRequest(name=name,) if metadata is None: metadata = [] metadata = list(metadata) @@ -526,7 +693,97 @@ def delete_device_registry( ) metadata.append(routing_metadata) - self._inner_api_calls["delete_device_registry"]( + return self._inner_api_calls["get_device_registry"]( + request, retry=retry, timeout=timeout, metadata=metadata + ) + + def update_device_registry( + self, + device_registry, + update_mask, + retry=google.api_core.gapic_v1.method.DEFAULT, + timeout=google.api_core.gapic_v1.method.DEFAULT, + metadata=None, + ): + """ + Updates a device registry configuration. + + Example: + >>> from google.cloud import iot_v1 + >>> + >>> client = iot_v1.DeviceManagerClient() + >>> + >>> # TODO: Initialize `device_registry`: + >>> device_registry = {} + >>> + >>> # TODO: Initialize `update_mask`: + >>> update_mask = {} + >>> + >>> response = client.update_device_registry(device_registry, update_mask) + + Args: + device_registry (Union[dict, ~google.cloud.iot_v1.types.DeviceRegistry]): Required. The new values for the device registry. The ``id`` field + must be empty, and the ``name`` field must indicate the path of the + resource. For example, + ``projects/example-project/locations/us-central1/registries/my-registry``. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.iot_v1.types.DeviceRegistry` + update_mask (Union[dict, ~google.cloud.iot_v1.types.FieldMask]): Required. Only updates the ``device_registry`` fields indicated by + this mask. The field mask must not be empty, and it must not contain + fields that are immutable or only set by the server. Mutable top-level + fields: ``event_notification_config``, ``http_config``, ``mqtt_config``, + and ``state_notification_config``. + + If a dict is provided, it must be of the same form as the protobuf + message :class:`~google.cloud.iot_v1.types.FieldMask` + retry (Optional[google.api_core.retry.Retry]): A retry object used + to retry requests. If ``None`` is specified, requests will + be retried using a default configuration. + timeout (Optional[float]): The amount of time, in seconds, to wait + for the request to complete. Note that if ``retry`` is + specified, the timeout applies to each individual attempt. + metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata + that is provided to the method. + + Returns: + A :class:`~google.cloud.iot_v1.types.DeviceRegistry` instance. + + Raises: + google.api_core.exceptions.GoogleAPICallError: If the request + failed for any reason. + google.api_core.exceptions.RetryError: If the request failed due + to a retryable error and retry attempts failed. + ValueError: If the parameters are invalid. + """ + # Wrap the transport method to add retry and timeout logic. + if "update_device_registry" not in self._inner_api_calls: + self._inner_api_calls[ + "update_device_registry" + ] = google.api_core.gapic_v1.method.wrap_method( + self.transport.update_device_registry, + default_retry=self._method_configs["UpdateDeviceRegistry"].retry, + default_timeout=self._method_configs["UpdateDeviceRegistry"].timeout, + client_info=self._client_info, + ) + + request = device_manager_pb2.UpdateDeviceRegistryRequest( + device_registry=device_registry, update_mask=update_mask, + ) + if metadata is None: + metadata = [] + metadata = list(metadata) + try: + routing_header = [("device_registry.name", device_registry.name)] + except AttributeError: + pass + else: + routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( + routing_header + ) + metadata.append(routing_metadata) + + return self._inner_api_calls["update_device_registry"]( request, retry=retry, timeout=timeout, metadata=metadata ) @@ -604,7 +861,7 @@ def list_device_registries( ) request = device_manager_pb2.ListDeviceRegistriesRequest( - parent=parent, page_size=page_size + parent=parent, page_size=page_size, ) if metadata is None: metadata = [] @@ -658,12 +915,12 @@ def create_device( >>> response = client.create_device(parent, device) Args: - parent (str): Required. The name of the device registry where this device should be - created. For example, + parent (str): Required. The name of the device registry where this device should + be created. For example, ``projects/example-project/locations/us-central1/registries/my-registry``. - device (Union[dict, ~google.cloud.iot_v1.types.Device]): Required. The device registration details. The field ``name`` must be - empty. The server generates ``name`` from the device registry ``id`` and - the ``parent`` field. + device (Union[dict, ~google.cloud.iot_v1.types.Device]): Required. The device registration details. The field ``name`` must + be empty. The server generates ``name`` from the device registry ``id`` + and the ``parent`` field. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.iot_v1.types.Device` @@ -697,7 +954,7 @@ def create_device( client_info=self._client_info, ) - request = device_manager_pb2.CreateDeviceRequest(parent=parent, device=device) + request = device_manager_pb2.CreateDeviceRequest(parent=parent, device=device,) if metadata is None: metadata = [] metadata = list(metadata) @@ -740,8 +997,8 @@ def get_device( ``projects/p0/locations/us-central1/registries/registry0/devices/device0`` or ``projects/p0/locations/us-central1/registries/registry0/devices/{num_id}``. - field_mask (Union[dict, ~google.cloud.iot_v1.types.FieldMask]): The fields of the ``Device`` resource to be returned in the response. If - the field mask is unset or empty, all fields are returned. + field_mask (Union[dict, ~google.cloud.iot_v1.types.FieldMask]): The fields of the ``Device`` resource to be returned in the + response. If the field mask is unset or empty, all fields are returned. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.iot_v1.types.FieldMask` @@ -775,7 +1032,7 @@ def get_device( client_info=self._client_info, ) - request = device_manager_pb2.GetDeviceRequest(name=name, field_mask=field_mask) + request = device_manager_pb2.GetDeviceRequest(name=name, field_mask=field_mask,) if metadata is None: metadata = [] metadata = list(metadata) @@ -826,9 +1083,9 @@ def update_device( If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.iot_v1.types.Device` - update_mask (Union[dict, ~google.cloud.iot_v1.types.FieldMask]): Required. Only updates the ``device`` fields indicated by this mask. The - field mask must not be empty, and it must not contain fields that are - immutable or only set by the server. Mutable top-level fields: + update_mask (Union[dict, ~google.cloud.iot_v1.types.FieldMask]): Required. Only updates the ``device`` fields indicated by this mask. + The field mask must not be empty, and it must not contain fields that + are immutable or only set by the server. Mutable top-level fields: ``credentials``, ``blocked``, and ``metadata`` If a dict is provided, it must be of the same form as the protobuf @@ -864,7 +1121,7 @@ def update_device( ) request = device_manager_pb2.UpdateDeviceRequest( - device=device, update_mask=update_mask + device=device, update_mask=update_mask, ) if metadata is None: metadata = [] @@ -883,75 +1140,6 @@ def update_device( request, retry=retry, timeout=timeout, metadata=metadata ) - def delete_device( - self, - name, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Deletes a device. - - Example: - >>> from google.cloud import iot_v1 - >>> - >>> client = iot_v1.DeviceManagerClient() - >>> - >>> name = client.device_path('[PROJECT]', '[LOCATION]', '[REGISTRY]', '[DEVICE]') - >>> - >>> client.delete_device(name) - - Args: - name (str): Required. The name of the device. For example, - ``projects/p0/locations/us-central1/registries/registry0/devices/device0`` - or - ``projects/p0/locations/us-central1/registries/registry0/devices/{num_id}``. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "delete_device" not in self._inner_api_calls: - self._inner_api_calls[ - "delete_device" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.delete_device, - default_retry=self._method_configs["DeleteDevice"].retry, - default_timeout=self._method_configs["DeleteDevice"].timeout, - client_info=self._client_info, - ) - - request = device_manager_pb2.DeleteDeviceRequest(name=name) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - self._inner_api_calls["delete_device"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - def list_devices( self, parent, @@ -993,11 +1181,12 @@ def list_devices( ``projects/my-project/locations/us-central1/registries/my-registry``. device_num_ids (list[long]): A list of device numeric IDs. If empty, this field is ignored. Maximum IDs: 10,000. - device_ids (list[str]): A list of device string IDs. For example, ``['device0', 'device12']``. - If empty, this field is ignored. Maximum IDs: 10,000 - field_mask (Union[dict, ~google.cloud.iot_v1.types.FieldMask]): The fields of the ``Device`` resource to be returned in the response. - The fields ``id`` and ``num_id`` are always returned, along with any - other fields specified. + device_ids (list[str]): A list of device string IDs. For example, + ``['device0', 'device12']``. If empty, this field is ignored. Maximum + IDs: 10,000 + field_mask (Union[dict, ~google.cloud.iot_v1.types.FieldMask]): The fields of the ``Device`` resource to be returned in the + response. The fields ``id`` and ``num_id`` are always returned, along + with any other fields specified. If a dict is provided, it must be of the same form as the protobuf message :class:`~google.cloud.iot_v1.types.FieldMask` @@ -1079,95 +1268,6 @@ def list_devices( ) return iterator - def modify_cloud_to_device_config( - self, - name, - binary_data, - version_to_update=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Modifies the configuration for the device, which is eventually sent from - the Cloud IoT Core servers. Returns the modified configuration version and - its metadata. - - Example: - >>> from google.cloud import iot_v1 - >>> - >>> client = iot_v1.DeviceManagerClient() - >>> - >>> name = client.device_path('[PROJECT]', '[LOCATION]', '[REGISTRY]', '[DEVICE]') - >>> - >>> # TODO: Initialize `binary_data`: - >>> binary_data = b'' - >>> - >>> response = client.modify_cloud_to_device_config(name, binary_data) - - Args: - name (str): Required. The name of the device. For example, - ``projects/p0/locations/us-central1/registries/registry0/devices/device0`` - or - ``projects/p0/locations/us-central1/registries/registry0/devices/{num_id}``. - binary_data (bytes): Required. The configuration data for the device. - version_to_update (long): The version number to update. If this value is zero, it will not check the - version number of the server and will always update the current version; - otherwise, this update will fail if the version number found on the server - does not match this version number. This is used to support multiple - simultaneous updates without losing data. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.iot_v1.types.DeviceConfig` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "modify_cloud_to_device_config" not in self._inner_api_calls: - self._inner_api_calls[ - "modify_cloud_to_device_config" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.modify_cloud_to_device_config, - default_retry=self._method_configs["ModifyCloudToDeviceConfig"].retry, - default_timeout=self._method_configs[ - "ModifyCloudToDeviceConfig" - ].timeout, - client_info=self._client_info, - ) - - request = device_manager_pb2.ModifyCloudToDeviceConfigRequest( - name=name, binary_data=binary_data, version_to_update=version_to_update - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["modify_cloud_to_device_config"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - def list_device_config_versions( self, name, @@ -1230,7 +1330,7 @@ def list_device_config_versions( ) request = device_manager_pb2.ListDeviceConfigVersionsRequest( - name=name, num_versions=num_versions + name=name, num_versions=num_versions, ) if metadata is None: metadata = [] @@ -1309,7 +1409,7 @@ def list_device_states( ) request = device_manager_pb2.ListDeviceStatesRequest( - name=name, num_states=num_states + name=name, num_states=num_states, ) if metadata is None: metadata = [] @@ -1393,7 +1493,7 @@ def set_iam_policy( client_info=self._client_info, ) - request = iam_policy_pb2.SetIamPolicyRequest(resource=resource, policy=policy) + request = iam_policy_pb2.SetIamPolicyRequest(resource=resource, policy=policy,) if metadata is None: metadata = [] metadata = list(metadata) @@ -1473,7 +1573,7 @@ def get_iam_policy( ) request = iam_policy_pb2.GetIamPolicyRequest( - resource=resource, options=options_ + resource=resource, options=options_, ) if metadata is None: metadata = [] @@ -1501,9 +1601,9 @@ def test_iam_permissions( metadata=None, ): """ - Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of permissions, - not a NOT\_FOUND error. + Returns permissions that a caller has on the specified resource. If + the resource does not exist, this will return an empty set of + permissions, not a NOT_FOUND error. Example: >>> from google.cloud import iot_v1 @@ -1521,8 +1621,8 @@ def test_iam_permissions( Args: resource (str): REQUIRED: The resource for which the policy detail is being requested. See the operation documentation for the appropriate value for this field. - permissions (list[str]): The set of permissions to check for the ``resource``. Permissions with - wildcards (such as '*' or 'storage.*') are not allowed. For more + permissions (list[str]): The set of permissions to check for the ``resource``. Permissions + with wildcards (such as '*' or 'storage.*') are not allowed. For more information see `IAM Overview `__. retry (Optional[google.api_core.retry.Retry]): A retry object used @@ -1556,7 +1656,7 @@ def test_iam_permissions( ) request = iam_policy_pb2.TestIamPermissionsRequest( - resource=resource, permissions=permissions + resource=resource, permissions=permissions, ) if metadata is None: metadata = [] @@ -1575,105 +1675,6 @@ def test_iam_permissions( request, retry=retry, timeout=timeout, metadata=metadata ) - def send_command_to_device( - self, - name, - binary_data, - subfolder=None, - retry=google.api_core.gapic_v1.method.DEFAULT, - timeout=google.api_core.gapic_v1.method.DEFAULT, - metadata=None, - ): - """ - Sends a command to the specified device. In order for a device to be - able to receive commands, it must: - - 1) be connected to Cloud IoT Core using the MQTT protocol, and - 2) be subscribed to the group of MQTT topics specified by - /devices/{device-id}/commands/#. This subscription will receive - commands at the top-level topic /devices/{device-id}/commands as well - as commands for subfolders, like - /devices/{device-id}/commands/subfolder. Note that subscribing to - specific subfolders is not supported. If the command could not be - delivered to the device, this method will return an error; in - particular, if the device is not subscribed, this method will return - FAILED\_PRECONDITION. Otherwise, this method will return OK. If the - subscription is QoS 1, at least once delivery will be guaranteed; for - QoS 0, no acknowledgment will be expected from the device. - - Example: - >>> from google.cloud import iot_v1 - >>> - >>> client = iot_v1.DeviceManagerClient() - >>> - >>> name = client.device_path('[PROJECT]', '[LOCATION]', '[REGISTRY]', '[DEVICE]') - >>> - >>> # TODO: Initialize `binary_data`: - >>> binary_data = b'' - >>> - >>> response = client.send_command_to_device(name, binary_data) - - Args: - name (str): Required. The name of the device. For example, - ``projects/p0/locations/us-central1/registries/registry0/devices/device0`` - or - ``projects/p0/locations/us-central1/registries/registry0/devices/{num_id}``. - binary_data (bytes): Required. The command data to send to the device. - subfolder (str): Optional subfolder for the command. If empty, the command will be delivered - to the /devices/{device-id}/commands topic, otherwise it will be delivered - to the /devices/{device-id}/commands/{subfolder} topic. Multi-level - subfolders are allowed. This field must not have more than 256 characters, - and must not contain any MQTT wildcards ("+" or "#") or null characters. - retry (Optional[google.api_core.retry.Retry]): A retry object used - to retry requests. If ``None`` is specified, requests will - be retried using a default configuration. - timeout (Optional[float]): The amount of time, in seconds, to wait - for the request to complete. Note that if ``retry`` is - specified, the timeout applies to each individual attempt. - metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata - that is provided to the method. - - Returns: - A :class:`~google.cloud.iot_v1.types.SendCommandToDeviceResponse` instance. - - Raises: - google.api_core.exceptions.GoogleAPICallError: If the request - failed for any reason. - google.api_core.exceptions.RetryError: If the request failed due - to a retryable error and retry attempts failed. - ValueError: If the parameters are invalid. - """ - # Wrap the transport method to add retry and timeout logic. - if "send_command_to_device" not in self._inner_api_calls: - self._inner_api_calls[ - "send_command_to_device" - ] = google.api_core.gapic_v1.method.wrap_method( - self.transport.send_command_to_device, - default_retry=self._method_configs["SendCommandToDevice"].retry, - default_timeout=self._method_configs["SendCommandToDevice"].timeout, - client_info=self._client_info, - ) - - request = device_manager_pb2.SendCommandToDeviceRequest( - name=name, binary_data=binary_data, subfolder=subfolder - ) - if metadata is None: - metadata = [] - metadata = list(metadata) - try: - routing_header = [("name", name)] - except AttributeError: - pass - else: - routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata( - routing_header - ) - metadata.append(routing_metadata) - - return self._inner_api_calls["send_command_to_device"]( - request, retry=retry, timeout=timeout, metadata=metadata - ) - def bind_device_to_gateway( self, parent, @@ -1704,11 +1705,11 @@ def bind_device_to_gateway( Args: parent (str): Required. The name of the registry. For example, ``projects/example-project/locations/us-central1/registries/my-registry``. - gateway_id (str): Required. The value of ``gateway_id`` can be either the device numeric - ID or the user-defined device identifier. - device_id (str): Required. The device to associate with the specified gateway. The value - of ``device_id`` can be either the device numeric ID or the user-defined - device identifier. + gateway_id (str): Required. The value of ``gateway_id`` can be either the device + numeric ID or the user-defined device identifier. + device_id (str): Required. The device to associate with the specified gateway. The + value of ``device_id`` can be either the device numeric ID or the + user-defined device identifier. retry (Optional[google.api_core.retry.Retry]): A retry object used to retry requests. If ``None`` is specified, requests will be retried using a default configuration. @@ -1740,7 +1741,7 @@ def bind_device_to_gateway( ) request = device_manager_pb2.BindDeviceToGatewayRequest( - parent=parent, gateway_id=gateway_id, device_id=device_id + parent=parent, gateway_id=gateway_id, device_id=device_id, ) if metadata is None: metadata = [] @@ -1789,8 +1790,8 @@ def unbind_device_from_gateway( Args: parent (str): Required. The name of the registry. For example, ``projects/example-project/locations/us-central1/registries/my-registry``. - gateway_id (str): Required. The value of ``gateway_id`` can be either the device numeric - ID or the user-defined device identifier. + gateway_id (str): Required. The value of ``gateway_id`` can be either the device + numeric ID or the user-defined device identifier. device_id (str): Required. The device to disassociate from the specified gateway. The value of ``device_id`` can be either the device numeric ID or the user-defined device identifier. @@ -1825,7 +1826,7 @@ def unbind_device_from_gateway( ) request = device_manager_pb2.UnbindDeviceFromGatewayRequest( - parent=parent, gateway_id=gateway_id, device_id=device_id + parent=parent, gateway_id=gateway_id, device_id=device_id, ) if metadata is None: metadata = [] diff --git a/google/cloud/iot_v1/gapic/device_manager_client_config.py b/google/cloud/iot_v1/gapic/device_manager_client_config.py index ca24328a..84d8883c 100644 --- a/google/cloud/iot_v1/gapic/device_manager_client_config.py +++ b/google/cloud/iot_v1/gapic/device_manager_client_config.py @@ -4,6 +4,11 @@ "retry_codes": { "idempotent": ["DEADLINE_EXCEEDED", "UNAVAILABLE"], "non_idempotent": [], + "rate_limited_aware": [ + "DEADLINE_EXCEEDED", + "RESOURCE_EXHAUSTED", + "UNAVAILABLE", + ], }, "retry_params": { "default": { @@ -13,26 +18,50 @@ "initial_rpc_timeout_millis": 20000, "rpc_timeout_multiplier": 1.0, "max_rpc_timeout_millis": 20000, - "total_timeout_millis": 600000, - } + "total_timeout_millis": 120000, + }, + "rate_limited_aware": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 20000, + "rpc_timeout_multiplier": 1.0, + "max_rpc_timeout_millis": 20000, + "total_timeout_millis": 120000, + }, }, "methods": { - "CreateDeviceRegistry": { + "DeleteDeviceRegistry": { "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", + "retry_codes_name": "idempotent", "retry_params_name": "default", }, - "GetDeviceRegistry": { + "DeleteDevice": { "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, - "UpdateDeviceRegistry": { + "ModifyCloudToDeviceConfig": { + "timeout_millis": 60000, + "retry_codes_name": "rate_limited_aware", + "retry_params_name": "rate_limited_aware", + }, + "SendCommandToDevice": { + "timeout_millis": 60000, + "retry_codes_name": "rate_limited_aware", + "retry_params_name": "rate_limited_aware", + }, + "CreateDeviceRegistry": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, - "DeleteDeviceRegistry": { + "GetDeviceRegistry": { + "timeout_millis": 60000, + "retry_codes_name": "idempotent", + "retry_params_name": "default", + }, + "UpdateDeviceRegistry": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", "retry_params_name": "default", @@ -57,21 +86,11 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, - "DeleteDevice": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, "ListDevices": { "timeout_millis": 60000, "retry_codes_name": "idempotent", "retry_params_name": "default", }, - "ModifyCloudToDeviceConfig": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, "ListDeviceConfigVersions": { "timeout_millis": 60000, "retry_codes_name": "idempotent", @@ -97,11 +116,6 @@ "retry_codes_name": "non_idempotent", "retry_params_name": "default", }, - "SendCommandToDevice": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default", - }, "BindDeviceToGateway": { "timeout_millis": 60000, "retry_codes_name": "non_idempotent", diff --git a/google/cloud/iot_v1/gapic/enums.py b/google/cloud/iot_v1/gapic/enums.py index ce3a12ee..cb5d17f8 100644 --- a/google/cloud/iot_v1/gapic/enums.py +++ b/google/cloud/iot_v1/gapic/enums.py @@ -143,18 +143,18 @@ class PublicKeyFormat(enum.IntEnum): ``-----BEGIN PUBLIC KEY-----`` and ``-----END PUBLIC KEY-----``. This can be used to verify ``RS256`` signatures in JWT tokens (`RFC7518 `__). - RSA_X509_PEM (int): As RSA\_PEM, but wrapped in an X.509v3 certificate + RSA_X509_PEM (int): As RSA_PEM, but wrapped in an X.509v3 certificate (`RFC5280 `__), encoded in base64, and wrapped by ``-----BEGIN CERTIFICATE-----`` and ``-----END CERTIFICATE-----``. - ES256_PEM (int): Public key for the ECDSA algorithm using P-256 and SHA-256, encoded in - base64, and wrapped by ``-----BEGIN PUBLIC KEY-----`` and + ES256_PEM (int): Public key for the ECDSA algorithm using P-256 and SHA-256, encoded + in base64, and wrapped by ``-----BEGIN PUBLIC KEY-----`` and ``-----END PUBLIC KEY-----``. This can be used to verify JWT tokens with the ``ES256`` algorithm (`RFC7518 `__). This curve is defined in `OpenSSL `__ as the ``prime256v1`` curve. - ES256_X509_PEM (int): As ES256\_PEM, but wrapped in an X.509v3 certificate + ES256_X509_PEM (int): As ES256_PEM, but wrapped in an X.509v3 certificate (`RFC5280 `__), encoded in base64, and wrapped by ``-----BEGIN CERTIFICATE-----`` and ``-----END CERTIFICATE-----``. diff --git a/google/cloud/iot_v1/gapic/transports/device_manager_grpc_transport.py b/google/cloud/iot_v1/gapic/transports/device_manager_grpc_transport.py index 35495761..8deb721d 100644 --- a/google/cloud/iot_v1/gapic/transports/device_manager_grpc_transport.py +++ b/google/cloud/iot_v1/gapic/transports/device_manager_grpc_transport.py @@ -56,7 +56,7 @@ def __init__( # exception (channels come with credentials baked in already). if channel is not None and credentials is not None: raise ValueError( - "The `channel` and `credentials` arguments are mutually " "exclusive." + "The `channel` and `credentials` arguments are mutually " "exclusive.", ) # Create the channel. @@ -75,7 +75,7 @@ def __init__( # gRPC uses objects called "stubs" that are bound to the # channel and provide a basic method for each RPC. self._stubs = { - "device_manager_stub": device_manager_pb2_grpc.DeviceManagerStub(channel) + "device_manager_stub": device_manager_pb2_grpc.DeviceManagerStub(channel), } @classmethod @@ -110,6 +110,74 @@ def channel(self): """ return self._channel + @property + def delete_device_registry(self): + """Return the gRPC stub for :meth:`DeviceManagerClient.delete_device_registry`. + + Deletes a device registry configuration. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["device_manager_stub"].DeleteDeviceRegistry + + @property + def delete_device(self): + """Return the gRPC stub for :meth:`DeviceManagerClient.delete_device`. + + Deletes a device. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["device_manager_stub"].DeleteDevice + + @property + def modify_cloud_to_device_config(self): + """Return the gRPC stub for :meth:`DeviceManagerClient.modify_cloud_to_device_config`. + + Modifies the configuration for the device, which is eventually sent from + the Cloud IoT Core servers. Returns the modified configuration version and + its metadata. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["device_manager_stub"].ModifyCloudToDeviceConfig + + @property + def send_command_to_device(self): + """Return the gRPC stub for :meth:`DeviceManagerClient.send_command_to_device`. + + Sends a command to the specified device. In order for a device to be + able to receive commands, it must: + + 1) be connected to Cloud IoT Core using the MQTT protocol, and + 2) be subscribed to the group of MQTT topics specified by + /devices/{device-id}/commands/#. This subscription will receive + commands at the top-level topic /devices/{device-id}/commands as well + as commands for subfolders, like + /devices/{device-id}/commands/subfolder. Note that subscribing to + specific subfolders is not supported. If the command could not be + delivered to the device, this method will return an error; in + particular, if the device is not subscribed, this method will return + FAILED_PRECONDITION. Otherwise, this method will return OK. If the + subscription is QoS 1, at least once delivery will be guaranteed; for + QoS 0, no acknowledgment will be expected from the device. + + Returns: + Callable: A callable which accepts the appropriate + deserialized request object and returns a + deserialized response object. + """ + return self._stubs["device_manager_stub"].SendCommandToDevice + @property def create_device_registry(self): """Return the gRPC stub for :meth:`DeviceManagerClient.create_device_registry`. @@ -149,19 +217,6 @@ def update_device_registry(self): """ return self._stubs["device_manager_stub"].UpdateDeviceRegistry - @property - def delete_device_registry(self): - """Return the gRPC stub for :meth:`DeviceManagerClient.delete_device_registry`. - - Deletes a device registry configuration. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["device_manager_stub"].DeleteDeviceRegistry - @property def list_device_registries(self): """Return the gRPC stub for :meth:`DeviceManagerClient.list_device_registries`. @@ -214,19 +269,6 @@ def update_device(self): """ return self._stubs["device_manager_stub"].UpdateDevice - @property - def delete_device(self): - """Return the gRPC stub for :meth:`DeviceManagerClient.delete_device`. - - Deletes a device. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["device_manager_stub"].DeleteDevice - @property def list_devices(self): """Return the gRPC stub for :meth:`DeviceManagerClient.list_devices`. @@ -240,21 +282,6 @@ def list_devices(self): """ return self._stubs["device_manager_stub"].ListDevices - @property - def modify_cloud_to_device_config(self): - """Return the gRPC stub for :meth:`DeviceManagerClient.modify_cloud_to_device_config`. - - Modifies the configuration for the device, which is eventually sent from - the Cloud IoT Core servers. Returns the modified configuration version and - its metadata. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["device_manager_stub"].ModifyCloudToDeviceConfig - @property def list_device_config_versions(self): """Return the gRPC stub for :meth:`DeviceManagerClient.list_device_config_versions`. @@ -316,9 +343,9 @@ def get_iam_policy(self): def test_iam_permissions(self): """Return the gRPC stub for :meth:`DeviceManagerClient.test_iam_permissions`. - Returns permissions that a caller has on the specified resource. If the - resource does not exist, this will return an empty set of permissions, - not a NOT\_FOUND error. + Returns permissions that a caller has on the specified resource. If + the resource does not exist, this will return an empty set of + permissions, not a NOT_FOUND error. Returns: Callable: A callable which accepts the appropriate @@ -327,33 +354,6 @@ def test_iam_permissions(self): """ return self._stubs["device_manager_stub"].TestIamPermissions - @property - def send_command_to_device(self): - """Return the gRPC stub for :meth:`DeviceManagerClient.send_command_to_device`. - - Sends a command to the specified device. In order for a device to be - able to receive commands, it must: - - 1) be connected to Cloud IoT Core using the MQTT protocol, and - 2) be subscribed to the group of MQTT topics specified by - /devices/{device-id}/commands/#. This subscription will receive - commands at the top-level topic /devices/{device-id}/commands as well - as commands for subfolders, like - /devices/{device-id}/commands/subfolder. Note that subscribing to - specific subfolders is not supported. If the command could not be - delivered to the device, this method will return an error; in - particular, if the device is not subscribed, this method will return - FAILED\_PRECONDITION. Otherwise, this method will return OK. If the - subscription is QoS 1, at least once delivery will be guaranteed; for - QoS 0, no acknowledgment will be expected from the device. - - Returns: - Callable: A callable which accepts the appropriate - deserialized request object and returns a - deserialized response object. - """ - return self._stubs["device_manager_stub"].SendCommandToDevice - @property def bind_device_to_gateway(self): """Return the gRPC stub for :meth:`DeviceManagerClient.bind_device_to_gateway`. diff --git a/google/cloud/iot_v1/proto/device_manager_pb2.py b/google/cloud/iot_v1/proto/device_manager_pb2.py index ddc07102..c728deca 100644 --- a/google/cloud/iot_v1/proto/device_manager_pb2.py +++ b/google/cloud/iot_v1/proto/device_manager_pb2.py @@ -2,9 +2,6 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/iot_v1/proto/device_manager.proto -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection @@ -33,12 +30,9 @@ name="google/cloud/iot_v1/proto/device_manager.proto", package="google.cloud.iot.v1", syntax="proto3", - serialized_options=_b( - "\n\027com.google.cloud.iot.v1B\022DeviceManagerProtoP\001Z6google.golang.org/genproto/googleapis/cloud/iot/v1;iot\370\001\001" - ), - serialized_pb=_b( - '\n.google/cloud/iot_v1/proto/device_manager.proto\x12\x13google.cloud.iot.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a)google/cloud/iot_v1/proto/resources.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto"\x9b\x01\n\x1b\x43reateDeviceRegistryRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x41\n\x0f\x64\x65vice_registry\x18\x02 \x01(\x0b\x32#.google.cloud.iot.v1.DeviceRegistryB\x03\xe0\x41\x02"R\n\x18GetDeviceRegistryRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n cloudiot.googleapis.com/Registry"U\n\x1b\x44\x65leteDeviceRegistryRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n cloudiot.googleapis.com/Registry"\x96\x01\n\x1bUpdateDeviceRegistryRequest\x12\x41\n\x0f\x64\x65vice_registry\x18\x01 \x01(\x0b\x32#.google.cloud.iot.v1.DeviceRegistryB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02"\x7f\n\x1bListDeviceRegistriesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"w\n\x1cListDeviceRegistriesResponse\x12>\n\x11\x64\x65vice_registries\x18\x01 \x03(\x0b\x32#.google.cloud.iot.v1.DeviceRegistry\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\x81\x01\n\x13\x43reateDeviceRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n cloudiot.googleapis.com/Registry\x12\x30\n\x06\x64\x65vice\x18\x02 \x01(\x0b\x32\x1b.google.cloud.iot.v1.DeviceB\x03\xe0\x41\x02"x\n\x10GetDeviceRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudiot.googleapis.com/Device\x12.\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"}\n\x13UpdateDeviceRequest\x12\x30\n\x06\x64\x65vice\x18\x02 \x01(\x0b\x32\x1b.google.cloud.iot.v1.DeviceB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02"K\n\x13\x44\x65leteDeviceRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudiot.googleapis.com/Device"\x98\x02\n\x12ListDevicesRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n cloudiot.googleapis.com/Registry\x12\x16\n\x0e\x64\x65vice_num_ids\x18\x02 \x03(\x04\x12\x12\n\ndevice_ids\x18\x03 \x03(\t\x12.\n\nfield_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x45\n\x14gateway_list_options\x18\x06 \x01(\x0b\x32\'.google.cloud.iot.v1.GatewayListOptions\x12\x11\n\tpage_size\x18\x64 \x01(\x05\x12\x12\n\npage_token\x18\x65 \x01(\t"\x9d\x01\n\x12GatewayListOptions\x12\x38\n\x0cgateway_type\x18\x01 \x01(\x0e\x32 .google.cloud.iot.v1.GatewayTypeH\x00\x12!\n\x17\x61ssociations_gateway_id\x18\x02 \x01(\tH\x00\x12 \n\x16\x61ssociations_device_id\x18\x03 \x01(\tH\x00\x42\x08\n\x06\x66ilter"\\\n\x13ListDevicesResponse\x12,\n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x1b.google.cloud.iot.v1.Device\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\x8d\x01\n ModifyCloudToDeviceConfigRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudiot.googleapis.com/Device\x12\x19\n\x11version_to_update\x18\x02 \x01(\x03\x12\x18\n\x0b\x62inary_data\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x02"m\n\x1fListDeviceConfigVersionsRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudiot.googleapis.com/Device\x12\x14\n\x0cnum_versions\x18\x02 \x01(\x05"]\n ListDeviceConfigVersionsResponse\x12\x39\n\x0e\x64\x65vice_configs\x18\x01 \x03(\x0b\x32!.google.cloud.iot.v1.DeviceConfig"c\n\x17ListDeviceStatesRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudiot.googleapis.com/Device\x12\x12\n\nnum_states\x18\x02 \x01(\x05"S\n\x18ListDeviceStatesResponse\x12\x37\n\rdevice_states\x18\x01 \x03(\x0b\x32 .google.cloud.iot.v1.DeviceState"\x7f\n\x1aSendCommandToDeviceRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudiot.googleapis.com/Device\x12\x18\n\x0b\x62inary_data\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x11\n\tsubfolder\x18\x03 \x01(\t"\x1d\n\x1bSendCommandToDeviceResponse"\x87\x01\n\x1a\x42indDeviceToGatewayRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n cloudiot.googleapis.com/Registry\x12\x17\n\ngateway_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tdevice_id\x18\x03 \x01(\tB\x03\xe0\x41\x02"\x1d\n\x1b\x42indDeviceToGatewayResponse"\x8b\x01\n\x1eUnbindDeviceFromGatewayRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n cloudiot.googleapis.com/Registry\x12\x17\n\ngateway_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tdevice_id\x18\x03 \x01(\tB\x03\xe0\x41\x02"!\n\x1fUnbindDeviceFromGatewayResponse2\xa6&\n\rDeviceManager\x12\xcf\x01\n\x14\x43reateDeviceRegistry\x12\x30.google.cloud.iot.v1.CreateDeviceRegistryRequest\x1a#.google.cloud.iot.v1.DeviceRegistry"`\x82\xd3\xe4\x93\x02\x41"./v1/{parent=projects/*/locations/*}/registries:\x0f\x64\x65vice_registry\xda\x41\x16parent,device_registry\x12\xa6\x01\n\x11GetDeviceRegistry\x12-.google.cloud.iot.v1.GetDeviceRegistryRequest\x1a#.google.cloud.iot.v1.DeviceRegistry"=\x82\xd3\xe4\x93\x02\x30\x12./v1/{name=projects/*/locations/*/registries/*}\xda\x41\x04name\x12\xe4\x01\n\x14UpdateDeviceRegistry\x12\x30.google.cloud.iot.v1.UpdateDeviceRegistryRequest\x1a#.google.cloud.iot.v1.DeviceRegistry"u\x82\xd3\xe4\x93\x02Q2>/v1/{device_registry.name=projects/*/locations/*/registries/*}:\x0f\x64\x65vice_registry\xda\x41\x1b\x64\x65vice_registry,update_mask\x12\x9f\x01\n\x14\x44\x65leteDeviceRegistry\x12\x30.google.cloud.iot.v1.DeleteDeviceRegistryRequest\x1a\x16.google.protobuf.Empty"=\x82\xd3\xe4\x93\x02\x30*./v1/{name=projects/*/locations/*/registries/*}\xda\x41\x04name\x12\xbc\x01\n\x14ListDeviceRegistries\x12\x30.google.cloud.iot.v1.ListDeviceRegistriesRequest\x1a\x31.google.cloud.iot.v1.ListDeviceRegistriesResponse"?\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/locations/*}/registries\xda\x41\x06parent\x12\xaf\x01\n\x0c\x43reateDevice\x12(.google.cloud.iot.v1.CreateDeviceRequest\x1a\x1b.google.cloud.iot.v1.Device"X\x82\xd3\xe4\x93\x02\x42"8/v1/{parent=projects/*/locations/*/registries/*}/devices:\x06\x64\x65vice\xda\x41\rparent,device\x12\xde\x01\n\tGetDevice\x12%.google.cloud.iot.v1.GetDeviceRequest\x1a\x1b.google.cloud.iot.v1.Device"\x8c\x01\x82\xd3\xe4\x93\x02\x7f\x12\x38/v1/{name=projects/*/locations/*/registries/*/devices/*}ZC\x12\x41/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}\xda\x41\x04name\x12\x91\x02\n\x0cUpdateDevice\x12(.google.cloud.iot.v1.UpdateDeviceRequest\x1a\x1b.google.cloud.iot.v1.Device"\xb9\x01\x82\xd3\xe4\x93\x02\x9d\x01\x32?/v1/{device.name=projects/*/locations/*/registries/*/devices/*}:\x06\x64\x65viceZR2H/v1/{device.name=projects/*/locations/*/registries/*/groups/*/devices/*}:\x06\x64\x65vice\xda\x41\x12\x64\x65vice,update_mask\x12\x99\x01\n\x0c\x44\x65leteDevice\x12(.google.cloud.iot.v1.DeleteDeviceRequest\x1a\x16.google.protobuf.Empty"G\x82\xd3\xe4\x93\x02:*8/v1/{name=projects/*/locations/*/registries/*/devices/*}\xda\x41\x04name\x12\xf1\x01\n\x0bListDevices\x12\'.google.cloud.iot.v1.ListDevicesRequest\x1a(.google.cloud.iot.v1.ListDevicesResponse"\x8e\x01\x82\xd3\xe4\x93\x02\x7f\x12\x38/v1/{parent=projects/*/locations/*/registries/*}/devicesZC\x12\x41/v1/{parent=projects/*/locations/*/registries/*/groups/*}/devices\xda\x41\x06parent\x12\xcb\x02\n\x19ModifyCloudToDeviceConfig\x12\x35.google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest\x1a!.google.cloud.iot.v1.DeviceConfig"\xd3\x01\x82\xd3\xe4\x93\x02\xb9\x01"R/v1/{name=projects/*/locations/*/registries/*/devices/*}:modifyCloudToDeviceConfig:\x01*Z`"[/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}:modifyCloudToDeviceConfig:\x01*\xda\x41\x10name,binary_data\x12\xb5\x02\n\x18ListDeviceConfigVersions\x12\x34.google.cloud.iot.v1.ListDeviceConfigVersionsRequest\x1a\x35.google.cloud.iot.v1.ListDeviceConfigVersionsResponse"\xab\x01\x82\xd3\xe4\x93\x02\x9d\x01\x12G/v1/{name=projects/*/locations/*/registries/*/devices/*}/configVersionsZR\x12P/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}/configVersions\xda\x41\x04name\x12\x8d\x02\n\x10ListDeviceStates\x12,.google.cloud.iot.v1.ListDeviceStatesRequest\x1a-.google.cloud.iot.v1.ListDeviceStatesResponse"\x9b\x01\x82\xd3\xe4\x93\x02\x8d\x01\x12?/v1/{name=projects/*/locations/*/registries/*/devices/*}/statesZJ\x12H/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}/states\xda\x41\x04name\x12\xf8\x01\n\x0cSetIamPolicy\x12".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy"\xac\x01\x82\xd3\xe4\x93\x02\x93\x01"?/v1/{resource=projects/*/locations/*/registries/*}:setIamPolicy:\x01*ZM"H/v1/{resource=projects/*/locations/*/registries/*/groups/*}:setIamPolicy:\x01*\xda\x41\x0fresource,policy\x12\xf1\x01\n\x0cGetIamPolicy\x12".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy"\xa5\x01\x82\xd3\xe4\x93\x02\x93\x01"?/v1/{resource=projects/*/locations/*/registries/*}:getIamPolicy:\x01*ZM"H/v1/{resource=projects/*/locations/*/registries/*/groups/*}:getIamPolicy:\x01*\xda\x41\x08resource\x12\xa9\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse"\xbd\x01\x82\xd3\xe4\x93\x02\x9f\x01"E/v1/{resource=projects/*/locations/*/registries/*}:testIamPermissions:\x01*ZS"N/v1/{resource=projects/*/locations/*/registries/*/groups/*}:testIamPermissions:\x01*\xda\x41\x14resource,permissions\x12\xdf\x02\n\x13SendCommandToDevice\x12/.google.cloud.iot.v1.SendCommandToDeviceRequest\x1a\x30.google.cloud.iot.v1.SendCommandToDeviceResponse"\xe4\x01\x82\xd3\xe4\x93\x02\xad\x01"L/v1/{name=projects/*/locations/*/registries/*/devices/*}:sendCommandToDevice:\x01*ZZ"U/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}:sendCommandToDevice:\x01*\xda\x41\x10name,binary_data\xda\x41\x1aname,binary_data,subfolder\x12\xbd\x02\n\x13\x42indDeviceToGateway\x12/.google.cloud.iot.v1.BindDeviceToGatewayRequest\x1a\x30.google.cloud.iot.v1.BindDeviceToGatewayResponse"\xc2\x01\x82\xd3\xe4\x93\x02\x9d\x01"D/v1/{parent=projects/*/locations/*/registries/*}:bindDeviceToGateway:\x01*ZR"M/v1/{parent=projects/*/locations/*/registries/*/groups/*}:bindDeviceToGateway:\x01*\xda\x41\x1bparent,gateway_id,device_id\x12\xd1\x02\n\x17UnbindDeviceFromGateway\x12\x33.google.cloud.iot.v1.UnbindDeviceFromGatewayRequest\x1a\x34.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse"\xca\x01\x82\xd3\xe4\x93\x02\xa5\x01"H/v1/{parent=projects/*/locations/*/registries/*}:unbindDeviceFromGateway:\x01*ZV"Q/v1/{parent=projects/*/locations/*/registries/*/groups/*}:unbindDeviceFromGateway:\x01*\xda\x41\x1bparent,gateway_id,device_id\x1at\xca\x41\x17\x63loudiot.googleapis.com\xd2\x41Whttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudiotBj\n\x17\x63om.google.cloud.iot.v1B\x12\x44\x65viceManagerProtoP\x01Z6google.golang.org/genproto/googleapis/cloud/iot/v1;iot\xf8\x01\x01\x62\x06proto3' - ), + serialized_options=b"\n\027com.google.cloud.iot.v1B\022DeviceManagerProtoP\001Z6google.golang.org/genproto/googleapis/cloud/iot/v1;iot\370\001\001", + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n.google/cloud/iot_v1/proto/device_manager.proto\x12\x13google.cloud.iot.v1\x1a\x1cgoogle/api/annotations.proto\x1a\x17google/api/client.proto\x1a\x1fgoogle/api/field_behavior.proto\x1a\x19google/api/resource.proto\x1a)google/cloud/iot_v1/proto/resources.proto\x1a\x1egoogle/iam/v1/iam_policy.proto\x1a\x1agoogle/iam/v1/policy.proto\x1a\x1bgoogle/protobuf/empty.proto\x1a google/protobuf/field_mask.proto\x1a\x17google/rpc/status.proto"\x9b\x01\n\x1b\x43reateDeviceRegistryRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x41\n\x0f\x64\x65vice_registry\x18\x02 \x01(\x0b\x32#.google.cloud.iot.v1.DeviceRegistryB\x03\xe0\x41\x02"R\n\x18GetDeviceRegistryRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n cloudiot.googleapis.com/Registry"U\n\x1b\x44\x65leteDeviceRegistryRequest\x12\x36\n\x04name\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n cloudiot.googleapis.com/Registry"\x96\x01\n\x1bUpdateDeviceRegistryRequest\x12\x41\n\x0f\x64\x65vice_registry\x18\x01 \x01(\x0b\x32#.google.cloud.iot.v1.DeviceRegistryB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02"\x7f\n\x1bListDeviceRegistriesRequest\x12\x39\n\x06parent\x18\x01 \x01(\tB)\xe0\x41\x02\xfa\x41#\n!locations.googleapis.com/Location\x12\x11\n\tpage_size\x18\x02 \x01(\x05\x12\x12\n\npage_token\x18\x03 \x01(\t"w\n\x1cListDeviceRegistriesResponse\x12>\n\x11\x64\x65vice_registries\x18\x01 \x03(\x0b\x32#.google.cloud.iot.v1.DeviceRegistry\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\x81\x01\n\x13\x43reateDeviceRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n cloudiot.googleapis.com/Registry\x12\x30\n\x06\x64\x65vice\x18\x02 \x01(\x0b\x32\x1b.google.cloud.iot.v1.DeviceB\x03\xe0\x41\x02"x\n\x10GetDeviceRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudiot.googleapis.com/Device\x12.\n\nfield_mask\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.FieldMask"}\n\x13UpdateDeviceRequest\x12\x30\n\x06\x64\x65vice\x18\x02 \x01(\x0b\x32\x1b.google.cloud.iot.v1.DeviceB\x03\xe0\x41\x02\x12\x34\n\x0bupdate_mask\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.FieldMaskB\x03\xe0\x41\x02"K\n\x13\x44\x65leteDeviceRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudiot.googleapis.com/Device"\x98\x02\n\x12ListDevicesRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n cloudiot.googleapis.com/Registry\x12\x16\n\x0e\x64\x65vice_num_ids\x18\x02 \x03(\x04\x12\x12\n\ndevice_ids\x18\x03 \x03(\t\x12.\n\nfield_mask\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.FieldMask\x12\x45\n\x14gateway_list_options\x18\x06 \x01(\x0b\x32\'.google.cloud.iot.v1.GatewayListOptions\x12\x11\n\tpage_size\x18\x64 \x01(\x05\x12\x12\n\npage_token\x18\x65 \x01(\t"\x9d\x01\n\x12GatewayListOptions\x12\x38\n\x0cgateway_type\x18\x01 \x01(\x0e\x32 .google.cloud.iot.v1.GatewayTypeH\x00\x12!\n\x17\x61ssociations_gateway_id\x18\x02 \x01(\tH\x00\x12 \n\x16\x61ssociations_device_id\x18\x03 \x01(\tH\x00\x42\x08\n\x06\x66ilter"\\\n\x13ListDevicesResponse\x12,\n\x07\x64\x65vices\x18\x01 \x03(\x0b\x32\x1b.google.cloud.iot.v1.Device\x12\x17\n\x0fnext_page_token\x18\x02 \x01(\t"\x8d\x01\n ModifyCloudToDeviceConfigRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudiot.googleapis.com/Device\x12\x19\n\x11version_to_update\x18\x02 \x01(\x03\x12\x18\n\x0b\x62inary_data\x18\x03 \x01(\x0c\x42\x03\xe0\x41\x02"m\n\x1fListDeviceConfigVersionsRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudiot.googleapis.com/Device\x12\x14\n\x0cnum_versions\x18\x02 \x01(\x05"]\n ListDeviceConfigVersionsResponse\x12\x39\n\x0e\x64\x65vice_configs\x18\x01 \x03(\x0b\x32!.google.cloud.iot.v1.DeviceConfig"c\n\x17ListDeviceStatesRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudiot.googleapis.com/Device\x12\x12\n\nnum_states\x18\x02 \x01(\x05"S\n\x18ListDeviceStatesResponse\x12\x37\n\rdevice_states\x18\x01 \x03(\x0b\x32 .google.cloud.iot.v1.DeviceState"\x7f\n\x1aSendCommandToDeviceRequest\x12\x34\n\x04name\x18\x01 \x01(\tB&\xe0\x41\x02\xfa\x41 \n\x1e\x63loudiot.googleapis.com/Device\x12\x18\n\x0b\x62inary_data\x18\x02 \x01(\x0c\x42\x03\xe0\x41\x02\x12\x11\n\tsubfolder\x18\x03 \x01(\t"\x1d\n\x1bSendCommandToDeviceResponse"\x87\x01\n\x1a\x42indDeviceToGatewayRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n cloudiot.googleapis.com/Registry\x12\x17\n\ngateway_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tdevice_id\x18\x03 \x01(\tB\x03\xe0\x41\x02"\x1d\n\x1b\x42indDeviceToGatewayResponse"\x8b\x01\n\x1eUnbindDeviceFromGatewayRequest\x12\x38\n\x06parent\x18\x01 \x01(\tB(\xe0\x41\x02\xfa\x41"\n cloudiot.googleapis.com/Registry\x12\x17\n\ngateway_id\x18\x02 \x01(\tB\x03\xe0\x41\x02\x12\x16\n\tdevice_id\x18\x03 \x01(\tB\x03\xe0\x41\x02"!\n\x1fUnbindDeviceFromGatewayResponse2\xa6&\n\rDeviceManager\x12\xcf\x01\n\x14\x43reateDeviceRegistry\x12\x30.google.cloud.iot.v1.CreateDeviceRegistryRequest\x1a#.google.cloud.iot.v1.DeviceRegistry"`\x82\xd3\xe4\x93\x02\x41"./v1/{parent=projects/*/locations/*}/registries:\x0f\x64\x65vice_registry\xda\x41\x16parent,device_registry\x12\xa6\x01\n\x11GetDeviceRegistry\x12-.google.cloud.iot.v1.GetDeviceRegistryRequest\x1a#.google.cloud.iot.v1.DeviceRegistry"=\x82\xd3\xe4\x93\x02\x30\x12./v1/{name=projects/*/locations/*/registries/*}\xda\x41\x04name\x12\xe4\x01\n\x14UpdateDeviceRegistry\x12\x30.google.cloud.iot.v1.UpdateDeviceRegistryRequest\x1a#.google.cloud.iot.v1.DeviceRegistry"u\x82\xd3\xe4\x93\x02Q2>/v1/{device_registry.name=projects/*/locations/*/registries/*}:\x0f\x64\x65vice_registry\xda\x41\x1b\x64\x65vice_registry,update_mask\x12\x9f\x01\n\x14\x44\x65leteDeviceRegistry\x12\x30.google.cloud.iot.v1.DeleteDeviceRegistryRequest\x1a\x16.google.protobuf.Empty"=\x82\xd3\xe4\x93\x02\x30*./v1/{name=projects/*/locations/*/registries/*}\xda\x41\x04name\x12\xbc\x01\n\x14ListDeviceRegistries\x12\x30.google.cloud.iot.v1.ListDeviceRegistriesRequest\x1a\x31.google.cloud.iot.v1.ListDeviceRegistriesResponse"?\x82\xd3\xe4\x93\x02\x30\x12./v1/{parent=projects/*/locations/*}/registries\xda\x41\x06parent\x12\xaf\x01\n\x0c\x43reateDevice\x12(.google.cloud.iot.v1.CreateDeviceRequest\x1a\x1b.google.cloud.iot.v1.Device"X\x82\xd3\xe4\x93\x02\x42"8/v1/{parent=projects/*/locations/*/registries/*}/devices:\x06\x64\x65vice\xda\x41\rparent,device\x12\xde\x01\n\tGetDevice\x12%.google.cloud.iot.v1.GetDeviceRequest\x1a\x1b.google.cloud.iot.v1.Device"\x8c\x01\x82\xd3\xe4\x93\x02\x7f\x12\x38/v1/{name=projects/*/locations/*/registries/*/devices/*}ZC\x12\x41/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}\xda\x41\x04name\x12\x91\x02\n\x0cUpdateDevice\x12(.google.cloud.iot.v1.UpdateDeviceRequest\x1a\x1b.google.cloud.iot.v1.Device"\xb9\x01\x82\xd3\xe4\x93\x02\x9d\x01\x32?/v1/{device.name=projects/*/locations/*/registries/*/devices/*}:\x06\x64\x65viceZR2H/v1/{device.name=projects/*/locations/*/registries/*/groups/*/devices/*}:\x06\x64\x65vice\xda\x41\x12\x64\x65vice,update_mask\x12\x99\x01\n\x0c\x44\x65leteDevice\x12(.google.cloud.iot.v1.DeleteDeviceRequest\x1a\x16.google.protobuf.Empty"G\x82\xd3\xe4\x93\x02:*8/v1/{name=projects/*/locations/*/registries/*/devices/*}\xda\x41\x04name\x12\xf1\x01\n\x0bListDevices\x12\'.google.cloud.iot.v1.ListDevicesRequest\x1a(.google.cloud.iot.v1.ListDevicesResponse"\x8e\x01\x82\xd3\xe4\x93\x02\x7f\x12\x38/v1/{parent=projects/*/locations/*/registries/*}/devicesZC\x12\x41/v1/{parent=projects/*/locations/*/registries/*/groups/*}/devices\xda\x41\x06parent\x12\xcb\x02\n\x19ModifyCloudToDeviceConfig\x12\x35.google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest\x1a!.google.cloud.iot.v1.DeviceConfig"\xd3\x01\x82\xd3\xe4\x93\x02\xb9\x01"R/v1/{name=projects/*/locations/*/registries/*/devices/*}:modifyCloudToDeviceConfig:\x01*Z`"[/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}:modifyCloudToDeviceConfig:\x01*\xda\x41\x10name,binary_data\x12\xb5\x02\n\x18ListDeviceConfigVersions\x12\x34.google.cloud.iot.v1.ListDeviceConfigVersionsRequest\x1a\x35.google.cloud.iot.v1.ListDeviceConfigVersionsResponse"\xab\x01\x82\xd3\xe4\x93\x02\x9d\x01\x12G/v1/{name=projects/*/locations/*/registries/*/devices/*}/configVersionsZR\x12P/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}/configVersions\xda\x41\x04name\x12\x8d\x02\n\x10ListDeviceStates\x12,.google.cloud.iot.v1.ListDeviceStatesRequest\x1a-.google.cloud.iot.v1.ListDeviceStatesResponse"\x9b\x01\x82\xd3\xe4\x93\x02\x8d\x01\x12?/v1/{name=projects/*/locations/*/registries/*/devices/*}/statesZJ\x12H/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}/states\xda\x41\x04name\x12\xf8\x01\n\x0cSetIamPolicy\x12".google.iam.v1.SetIamPolicyRequest\x1a\x15.google.iam.v1.Policy"\xac\x01\x82\xd3\xe4\x93\x02\x93\x01"?/v1/{resource=projects/*/locations/*/registries/*}:setIamPolicy:\x01*ZM"H/v1/{resource=projects/*/locations/*/registries/*/groups/*}:setIamPolicy:\x01*\xda\x41\x0fresource,policy\x12\xf1\x01\n\x0cGetIamPolicy\x12".google.iam.v1.GetIamPolicyRequest\x1a\x15.google.iam.v1.Policy"\xa5\x01\x82\xd3\xe4\x93\x02\x93\x01"?/v1/{resource=projects/*/locations/*/registries/*}:getIamPolicy:\x01*ZM"H/v1/{resource=projects/*/locations/*/registries/*/groups/*}:getIamPolicy:\x01*\xda\x41\x08resource\x12\xa9\x02\n\x12TestIamPermissions\x12(.google.iam.v1.TestIamPermissionsRequest\x1a).google.iam.v1.TestIamPermissionsResponse"\xbd\x01\x82\xd3\xe4\x93\x02\x9f\x01"E/v1/{resource=projects/*/locations/*/registries/*}:testIamPermissions:\x01*ZS"N/v1/{resource=projects/*/locations/*/registries/*/groups/*}:testIamPermissions:\x01*\xda\x41\x14resource,permissions\x12\xdf\x02\n\x13SendCommandToDevice\x12/.google.cloud.iot.v1.SendCommandToDeviceRequest\x1a\x30.google.cloud.iot.v1.SendCommandToDeviceResponse"\xe4\x01\x82\xd3\xe4\x93\x02\xad\x01"L/v1/{name=projects/*/locations/*/registries/*/devices/*}:sendCommandToDevice:\x01*ZZ"U/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}:sendCommandToDevice:\x01*\xda\x41\x10name,binary_data\xda\x41\x1aname,binary_data,subfolder\x12\xbd\x02\n\x13\x42indDeviceToGateway\x12/.google.cloud.iot.v1.BindDeviceToGatewayRequest\x1a\x30.google.cloud.iot.v1.BindDeviceToGatewayResponse"\xc2\x01\x82\xd3\xe4\x93\x02\x9d\x01"D/v1/{parent=projects/*/locations/*/registries/*}:bindDeviceToGateway:\x01*ZR"M/v1/{parent=projects/*/locations/*/registries/*/groups/*}:bindDeviceToGateway:\x01*\xda\x41\x1bparent,gateway_id,device_id\x12\xd1\x02\n\x17UnbindDeviceFromGateway\x12\x33.google.cloud.iot.v1.UnbindDeviceFromGatewayRequest\x1a\x34.google.cloud.iot.v1.UnbindDeviceFromGatewayResponse"\xca\x01\x82\xd3\xe4\x93\x02\xa5\x01"H/v1/{parent=projects/*/locations/*/registries/*}:unbindDeviceFromGateway:\x01*ZV"Q/v1/{parent=projects/*/locations/*/registries/*/groups/*}:unbindDeviceFromGateway:\x01*\xda\x41\x1bparent,gateway_id,device_id\x1at\xca\x41\x17\x63loudiot.googleapis.com\xd2\x41Whttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudiotBj\n\x17\x63om.google.cloud.iot.v1B\x12\x44\x65viceManagerProtoP\x01Z6google.golang.org/genproto/googleapis/cloud/iot/v1;iot\xf8\x01\x01\x62\x06proto3', dependencies=[ google_dot_api_dot_annotations__pb2.DESCRIPTOR, google_dot_api_dot_client__pb2.DESCRIPTOR, @@ -60,6 +54,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="parent", @@ -70,16 +65,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!locations.googleapis.com/Location" - ), + serialized_options=b"\340A\002\372A#\n!locations.googleapis.com/Location", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="device_registry", @@ -96,8 +90,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -119,6 +114,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -129,15 +125,16 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b('\340A\002\372A"\n cloudiot.googleapis.com/Registry'), + serialized_options=b'\340A\002\372A"\n cloudiot.googleapis.com/Registry', file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -158,6 +155,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -168,15 +166,16 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b('\340A\002\372A"\n cloudiot.googleapis.com/Registry'), + serialized_options=b'\340A\002\372A"\n cloudiot.googleapis.com/Registry', file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -197,6 +196,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="device_registry", @@ -213,8 +213,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="update_mask", @@ -231,8 +232,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -254,6 +256,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="parent", @@ -264,16 +267,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A#\n!locations.googleapis.com/Location" - ), + serialized_options=b"\340A\002\372A#\n!locations.googleapis.com/Location", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="page_size", @@ -292,6 +294,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="page_token", @@ -302,7 +305,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -310,6 +313,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -331,6 +335,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="device_registries", @@ -349,6 +354,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="next_page_token", @@ -359,7 +365,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -367,6 +373,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -388,6 +395,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="parent", @@ -398,14 +406,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b('\340A\002\372A"\n cloudiot.googleapis.com/Registry'), + serialized_options=b'\340A\002\372A"\n cloudiot.googleapis.com/Registry', file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="device", @@ -422,8 +431,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -445,6 +455,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -455,16 +466,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A \n\036cloudiot.googleapis.com/Device" - ), + serialized_options=b"\340A\002\372A \n\036cloudiot.googleapis.com/Device", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="field_mask", @@ -483,6 +493,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -504,6 +515,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="device", @@ -520,8 +532,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="update_mask", @@ -538,8 +551,9 @@ containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -561,6 +575,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -571,17 +586,16 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A \n\036cloudiot.googleapis.com/Device" - ), + serialized_options=b"\340A\002\372A \n\036cloudiot.googleapis.com/Device", file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -602,6 +616,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="parent", @@ -612,14 +627,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b('\340A\002\372A"\n cloudiot.googleapis.com/Registry'), + serialized_options=b'\340A\002\372A"\n cloudiot.googleapis.com/Registry', file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="device_num_ids", @@ -638,6 +654,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="device_ids", @@ -656,6 +673,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="field_mask", @@ -674,6 +692,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="gateway_list_options", @@ -692,6 +711,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="page_size", @@ -710,6 +730,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="page_token", @@ -720,7 +741,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -728,6 +749,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -749,6 +771,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="gateway_type", @@ -767,6 +790,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="associations_gateway_id", @@ -777,7 +801,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -785,6 +809,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="associations_device_id", @@ -795,7 +820,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -803,6 +828,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -818,8 +844,9 @@ full_name="google.cloud.iot.v1.GatewayListOptions.filter", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=1851, serialized_end=2008, @@ -832,6 +859,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="devices", @@ -850,6 +878,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="next_page_token", @@ -860,7 +889,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -868,6 +897,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -889,6 +919,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -899,16 +930,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A \n\036cloudiot.googleapis.com/Device" - ), + serialized_options=b"\340A\002\372A \n\036cloudiot.googleapis.com/Device", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="version_to_update", @@ -927,6 +957,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="binary_data", @@ -937,14 +968,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b(""), + default_value=b"", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -966,6 +998,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -976,16 +1009,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A \n\036cloudiot.googleapis.com/Device" - ), + serialized_options=b"\340A\002\372A \n\036cloudiot.googleapis.com/Device", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="num_versions", @@ -1004,6 +1036,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -1025,6 +1058,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="device_configs", @@ -1043,7 +1077,8 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -1064,6 +1099,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -1074,16 +1110,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A \n\036cloudiot.googleapis.com/Device" - ), + serialized_options=b"\340A\002\372A \n\036cloudiot.googleapis.com/Device", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="num_states", @@ -1102,6 +1137,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -1123,6 +1159,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="device_states", @@ -1141,7 +1178,8 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -1162,6 +1200,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="name", @@ -1172,16 +1211,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b( - "\340A\002\372A \n\036cloudiot.googleapis.com/Device" - ), + serialized_options=b"\340A\002\372A \n\036cloudiot.googleapis.com/Device", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="binary_data", @@ -1192,14 +1230,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b(""), + default_value=b"", message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="subfolder", @@ -1210,7 +1249,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -1218,6 +1257,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -1239,6 +1279,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], extensions=[], nested_types=[], @@ -1259,6 +1300,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="parent", @@ -1269,14 +1311,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b('\340A\002\372A"\n cloudiot.googleapis.com/Registry'), + serialized_options=b'\340A\002\372A"\n cloudiot.googleapis.com/Registry', file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="gateway_id", @@ -1287,14 +1330,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="device_id", @@ -1305,14 +1349,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -1334,6 +1379,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], extensions=[], nested_types=[], @@ -1354,6 +1400,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="parent", @@ -1364,14 +1411,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b('\340A\002\372A"\n cloudiot.googleapis.com/Registry'), + serialized_options=b'\340A\002\372A"\n cloudiot.googleapis.com/Registry', file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="gateway_id", @@ -1382,14 +1430,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="device_id", @@ -1400,14 +1449,15 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, - serialized_options=_b("\340A\002"), + serialized_options=b"\340A\002", file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -1429,6 +1479,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], extensions=[], nested_types=[], @@ -1565,10 +1616,11 @@ CreateDeviceRegistryRequest = _reflection.GeneratedProtocolMessageType( "CreateDeviceRegistryRequest", (_message.Message,), - dict( - DESCRIPTOR=_CREATEDEVICEREGISTRYREQUEST, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Request for ``CreateDeviceRegistry``. + { + "DESCRIPTOR": _CREATEDEVICEREGISTRYREQUEST, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Request for ``CreateDeviceRegistry``. + Attributes: parent: Required. The project and cloud region where this device @@ -1580,17 +1632,18 @@ registry ``id`` provided and the ``parent`` field. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.CreateDeviceRegistryRequest) - ), + }, ) _sym_db.RegisterMessage(CreateDeviceRegistryRequest) GetDeviceRegistryRequest = _reflection.GeneratedProtocolMessageType( "GetDeviceRegistryRequest", (_message.Message,), - dict( - DESCRIPTOR=_GETDEVICEREGISTRYREQUEST, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Request for ``GetDeviceRegistry``. + { + "DESCRIPTOR": _GETDEVICEREGISTRYREQUEST, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Request for ``GetDeviceRegistry``. + Attributes: name: Required. The name of the device registry. For example, @@ -1598,17 +1651,18 @@ central1/registries/my-registry``. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.GetDeviceRegistryRequest) - ), + }, ) _sym_db.RegisterMessage(GetDeviceRegistryRequest) DeleteDeviceRegistryRequest = _reflection.GeneratedProtocolMessageType( "DeleteDeviceRegistryRequest", (_message.Message,), - dict( - DESCRIPTOR=_DELETEDEVICEREGISTRYREQUEST, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Request for ``DeleteDeviceRegistry``. + { + "DESCRIPTOR": _DELETEDEVICEREGISTRYREQUEST, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Request for ``DeleteDeviceRegistry``. + Attributes: name: Required. The name of the device registry. For example, @@ -1616,17 +1670,18 @@ central1/registries/my-registry``. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.DeleteDeviceRegistryRequest) - ), + }, ) _sym_db.RegisterMessage(DeleteDeviceRegistryRequest) UpdateDeviceRegistryRequest = _reflection.GeneratedProtocolMessageType( "UpdateDeviceRegistryRequest", (_message.Message,), - dict( - DESCRIPTOR=_UPDATEDEVICEREGISTRYREQUEST, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Request for ``UpdateDeviceRegistry``. + { + "DESCRIPTOR": _UPDATEDEVICEREGISTRYREQUEST, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Request for ``UpdateDeviceRegistry``. + Attributes: device_registry: Required. The new values for the device registry. The ``id`` @@ -1642,17 +1697,18 @@ ``mqtt_config``, and ``state_notification_config``. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.UpdateDeviceRegistryRequest) - ), + }, ) _sym_db.RegisterMessage(UpdateDeviceRegistryRequest) ListDeviceRegistriesRequest = _reflection.GeneratedProtocolMessageType( "ListDeviceRegistriesRequest", (_message.Message,), - dict( - DESCRIPTOR=_LISTDEVICEREGISTRIESREQUEST, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Request for ``ListDeviceRegistries``. + { + "DESCRIPTOR": _LISTDEVICEREGISTRIESREQUEST, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Request for ``ListDeviceRegistries``. + Attributes: parent: Required. The project and cloud region path. For example, @@ -1670,17 +1726,18 @@ system should return the next page of data. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.ListDeviceRegistriesRequest) - ), + }, ) _sym_db.RegisterMessage(ListDeviceRegistriesRequest) ListDeviceRegistriesResponse = _reflection.GeneratedProtocolMessageType( "ListDeviceRegistriesResponse", (_message.Message,), - dict( - DESCRIPTOR=_LISTDEVICEREGISTRIESRESPONSE, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Response for ``ListDeviceRegistries``. + { + "DESCRIPTOR": _LISTDEVICEREGISTRIESRESPONSE, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Response for ``ListDeviceRegistries``. + Attributes: device_registries: The registries that matched the query. @@ -1690,17 +1747,18 @@ ``ListDeviceRegistriesRequest``. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.ListDeviceRegistriesResponse) - ), + }, ) _sym_db.RegisterMessage(ListDeviceRegistriesResponse) CreateDeviceRequest = _reflection.GeneratedProtocolMessageType( "CreateDeviceRequest", (_message.Message,), - dict( - DESCRIPTOR=_CREATEDEVICEREQUEST, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Request for ``CreateDevice``. + { + "DESCRIPTOR": _CREATEDEVICEREQUEST, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Request for ``CreateDevice``. + Attributes: parent: Required. The name of the device registry where this device @@ -1712,17 +1770,18 @@ registry ``id`` and the ``parent`` field. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.CreateDeviceRequest) - ), + }, ) _sym_db.RegisterMessage(CreateDeviceRequest) GetDeviceRequest = _reflection.GeneratedProtocolMessageType( "GetDeviceRequest", (_message.Message,), - dict( - DESCRIPTOR=_GETDEVICEREQUEST, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Request for ``GetDevice``. + { + "DESCRIPTOR": _GETDEVICEREQUEST, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Request for ``GetDevice``. + Attributes: name: Required. The name of the device. For example, @@ -1736,17 +1795,18 @@ returned. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.GetDeviceRequest) - ), + }, ) _sym_db.RegisterMessage(GetDeviceRequest) UpdateDeviceRequest = _reflection.GeneratedProtocolMessageType( "UpdateDeviceRequest", (_message.Message,), - dict( - DESCRIPTOR=_UPDATEDEVICEREQUEST, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Request for ``UpdateDevice``. + { + "DESCRIPTOR": _UPDATEDEVICEREQUEST, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Request for ``UpdateDevice``. + Attributes: device: Required. The new values for the device. The ``id`` and @@ -1764,17 +1824,18 @@ ``metadata`` """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.UpdateDeviceRequest) - ), + }, ) _sym_db.RegisterMessage(UpdateDeviceRequest) DeleteDeviceRequest = _reflection.GeneratedProtocolMessageType( "DeleteDeviceRequest", (_message.Message,), - dict( - DESCRIPTOR=_DELETEDEVICEREQUEST, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Request for ``DeleteDevice``. + { + "DESCRIPTOR": _DELETEDEVICEREQUEST, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Request for ``DeleteDevice``. + Attributes: name: Required. The name of the device. For example, @@ -1784,17 +1845,18 @@ central1/registries/registry0/devices/{num_id}``. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.DeleteDeviceRequest) - ), + }, ) _sym_db.RegisterMessage(DeleteDeviceRequest) ListDevicesRequest = _reflection.GeneratedProtocolMessageType( "ListDevicesRequest", (_message.Message,), - dict( - DESCRIPTOR=_LISTDEVICESREQUEST, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Request for ``ListDevices``. + { + "DESCRIPTOR": _LISTDEVICESREQUEST, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Request for ``ListDevices``. + Attributes: parent: Required. The device registry path. Required. For example, @@ -1826,17 +1888,18 @@ page of data. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.ListDevicesRequest) - ), + }, ) _sym_db.RegisterMessage(ListDevicesRequest) GatewayListOptions = _reflection.GeneratedProtocolMessageType( "GatewayListOptions", (_message.Message,), - dict( - DESCRIPTOR=_GATEWAYLISTOPTIONS, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Options for limiting the list based on gateway type and associations. + { + "DESCRIPTOR": _GATEWAYLISTOPTIONS, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Options for limiting the list based on gateway type and associations. + Attributes: filter: If not set, all devices and gateways are returned. If set, the @@ -1860,17 +1923,18 @@ the device with ``num_id`` 456 is bound. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.GatewayListOptions) - ), + }, ) _sym_db.RegisterMessage(GatewayListOptions) ListDevicesResponse = _reflection.GeneratedProtocolMessageType( "ListDevicesResponse", (_message.Message,), - dict( - DESCRIPTOR=_LISTDEVICESRESPONSE, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Response for ``ListDevices``. + { + "DESCRIPTOR": _LISTDEVICESRESPONSE, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Response for ``ListDevices``. + Attributes: devices: The devices that match the request. @@ -1880,17 +1944,18 @@ ``ListDevicesRequest``. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.ListDevicesResponse) - ), + }, ) _sym_db.RegisterMessage(ListDevicesResponse) ModifyCloudToDeviceConfigRequest = _reflection.GeneratedProtocolMessageType( "ModifyCloudToDeviceConfigRequest", (_message.Message,), - dict( - DESCRIPTOR=_MODIFYCLOUDTODEVICECONFIGREQUEST, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Request for ``ModifyCloudToDeviceConfig``. + { + "DESCRIPTOR": _MODIFYCLOUDTODEVICECONFIGREQUEST, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Request for ``ModifyCloudToDeviceConfig``. + Attributes: name: Required. The name of the device. For example, @@ -1909,17 +1974,18 @@ Required. The configuration data for the device. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest) - ), + }, ) _sym_db.RegisterMessage(ModifyCloudToDeviceConfigRequest) ListDeviceConfigVersionsRequest = _reflection.GeneratedProtocolMessageType( "ListDeviceConfigVersionsRequest", (_message.Message,), - dict( - DESCRIPTOR=_LISTDEVICECONFIGVERSIONSREQUEST, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Request for ``ListDeviceConfigVersions``. + { + "DESCRIPTOR": _LISTDEVICECONFIGVERSIONSREQUEST, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Request for ``ListDeviceConfigVersions``. + Attributes: name: Required. The name of the device. For example, @@ -1934,17 +2000,18 @@ all the versions available. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.ListDeviceConfigVersionsRequest) - ), + }, ) _sym_db.RegisterMessage(ListDeviceConfigVersionsRequest) ListDeviceConfigVersionsResponse = _reflection.GeneratedProtocolMessageType( "ListDeviceConfigVersionsResponse", (_message.Message,), - dict( - DESCRIPTOR=_LISTDEVICECONFIGVERSIONSRESPONSE, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Response for ``ListDeviceConfigVersions``. + { + "DESCRIPTOR": _LISTDEVICECONFIGVERSIONSRESPONSE, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Response for ``ListDeviceConfigVersions``. + Attributes: device_configs: The device configuration for the last few versions. Versions @@ -1952,17 +2019,18 @@ one. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.ListDeviceConfigVersionsResponse) - ), + }, ) _sym_db.RegisterMessage(ListDeviceConfigVersionsResponse) ListDeviceStatesRequest = _reflection.GeneratedProtocolMessageType( "ListDeviceStatesRequest", (_message.Message,), - dict( - DESCRIPTOR=_LISTDEVICESTATESREQUEST, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Request for ``ListDeviceStates``. + { + "DESCRIPTOR": _LISTDEVICESTATESREQUEST, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Request for ``ListDeviceStates``. + Attributes: name: Required. The name of the device. For example, @@ -1977,17 +2045,18 @@ available. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.ListDeviceStatesRequest) - ), + }, ) _sym_db.RegisterMessage(ListDeviceStatesRequest) ListDeviceStatesResponse = _reflection.GeneratedProtocolMessageType( "ListDeviceStatesResponse", (_message.Message,), - dict( - DESCRIPTOR=_LISTDEVICESTATESRESPONSE, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Response for ``ListDeviceStates``. + { + "DESCRIPTOR": _LISTDEVICESTATESRESPONSE, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Response for ``ListDeviceStates``. + Attributes: device_states: The last few device states. States are listed in descending @@ -1995,17 +2064,18 @@ one. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.ListDeviceStatesResponse) - ), + }, ) _sym_db.RegisterMessage(ListDeviceStatesResponse) SendCommandToDeviceRequest = _reflection.GeneratedProtocolMessageType( "SendCommandToDeviceRequest", (_message.Message,), - dict( - DESCRIPTOR=_SENDCOMMANDTODEVICEREQUEST, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Request for ``SendCommandToDevice``. + { + "DESCRIPTOR": _SENDCOMMANDTODEVICEREQUEST, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Request for ``SendCommandToDevice``. + Attributes: name: Required. The name of the device. For example, @@ -2021,33 +2091,34 @@ otherwise it will be delivered to the /devices/{device- id}/commands/{subfolder} topic. Multi-level subfolders are allowed. This field must not have more than 256 characters, - and must not contain any MQTT wildcards ("+" or "#") or null + and must not contain any MQTT wildcards (“+” or “#”) or null characters. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.SendCommandToDeviceRequest) - ), + }, ) _sym_db.RegisterMessage(SendCommandToDeviceRequest) SendCommandToDeviceResponse = _reflection.GeneratedProtocolMessageType( "SendCommandToDeviceResponse", (_message.Message,), - dict( - DESCRIPTOR=_SENDCOMMANDTODEVICERESPONSE, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Response for ``SendCommandToDevice``.""", + { + "DESCRIPTOR": _SENDCOMMANDTODEVICERESPONSE, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Response for ``SendCommandToDevice``.""", # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.SendCommandToDeviceResponse) - ), + }, ) _sym_db.RegisterMessage(SendCommandToDeviceResponse) BindDeviceToGatewayRequest = _reflection.GeneratedProtocolMessageType( "BindDeviceToGatewayRequest", (_message.Message,), - dict( - DESCRIPTOR=_BINDDEVICETOGATEWAYREQUEST, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Request for ``BindDeviceToGateway``. + { + "DESCRIPTOR": _BINDDEVICETOGATEWAYREQUEST, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Request for ``BindDeviceToGateway``. + Attributes: parent: Required. The name of the registry. For example, @@ -2062,29 +2133,30 @@ or the user-defined device identifier. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.BindDeviceToGatewayRequest) - ), + }, ) _sym_db.RegisterMessage(BindDeviceToGatewayRequest) BindDeviceToGatewayResponse = _reflection.GeneratedProtocolMessageType( "BindDeviceToGatewayResponse", (_message.Message,), - dict( - DESCRIPTOR=_BINDDEVICETOGATEWAYRESPONSE, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Response for ``BindDeviceToGateway``.""", + { + "DESCRIPTOR": _BINDDEVICETOGATEWAYRESPONSE, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Response for ``BindDeviceToGateway``.""", # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.BindDeviceToGatewayResponse) - ), + }, ) _sym_db.RegisterMessage(BindDeviceToGatewayResponse) UnbindDeviceFromGatewayRequest = _reflection.GeneratedProtocolMessageType( "UnbindDeviceFromGatewayRequest", (_message.Message,), - dict( - DESCRIPTOR=_UNBINDDEVICEFROMGATEWAYREQUEST, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Request for ``UnbindDeviceFromGateway``. + { + "DESCRIPTOR": _UNBINDDEVICEFROMGATEWAYREQUEST, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Request for ``UnbindDeviceFromGateway``. + Attributes: parent: Required. The name of the registry. For example, @@ -2099,19 +2171,19 @@ numeric ID or the user-defined device identifier. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.UnbindDeviceFromGatewayRequest) - ), + }, ) _sym_db.RegisterMessage(UnbindDeviceFromGatewayRequest) UnbindDeviceFromGatewayResponse = _reflection.GeneratedProtocolMessageType( "UnbindDeviceFromGatewayResponse", (_message.Message,), - dict( - DESCRIPTOR=_UNBINDDEVICEFROMGATEWAYRESPONSE, - __module__="google.cloud.iot_v1.proto.device_manager_pb2", - __doc__="""Response for ``UnbindDeviceFromGateway``.""", + { + "DESCRIPTOR": _UNBINDDEVICEFROMGATEWAYRESPONSE, + "__module__": "google.cloud.iot_v1.proto.device_manager_pb2", + "__doc__": """Response for ``UnbindDeviceFromGateway``.""", # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.UnbindDeviceFromGatewayResponse) - ), + }, ) _sym_db.RegisterMessage(UnbindDeviceFromGatewayResponse) @@ -2149,9 +2221,8 @@ full_name="google.cloud.iot.v1.DeviceManager", file=DESCRIPTOR, index=0, - serialized_options=_b( - "\312A\027cloudiot.googleapis.com\322AWhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudiot" - ), + serialized_options=b"\312A\027cloudiot.googleapis.com\322AWhttps://www.googleapis.com/auth/cloud-platform,https://www.googleapis.com/auth/cloudiot", + create_key=_descriptor._internal_create_key, serialized_start=3147, serialized_end=8049, methods=[ @@ -2162,9 +2233,8 @@ containing_service=None, input_type=_CREATEDEVICEREGISTRYREQUEST, output_type=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2._DEVICEREGISTRY, - serialized_options=_b( - '\202\323\344\223\002A"./v1/{parent=projects/*/locations/*}/registries:\017device_registry\332A\026parent,device_registry' - ), + serialized_options=b'\202\323\344\223\002A"./v1/{parent=projects/*/locations/*}/registries:\017device_registry\332A\026parent,device_registry', + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="GetDeviceRegistry", @@ -2173,9 +2243,8 @@ containing_service=None, input_type=_GETDEVICEREGISTRYREQUEST, output_type=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2._DEVICEREGISTRY, - serialized_options=_b( - "\202\323\344\223\0020\022./v1/{name=projects/*/locations/*/registries/*}\332A\004name" - ), + serialized_options=b"\202\323\344\223\0020\022./v1/{name=projects/*/locations/*/registries/*}\332A\004name", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="UpdateDeviceRegistry", @@ -2184,9 +2253,8 @@ containing_service=None, input_type=_UPDATEDEVICEREGISTRYREQUEST, output_type=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2._DEVICEREGISTRY, - serialized_options=_b( - "\202\323\344\223\002Q2>/v1/{device_registry.name=projects/*/locations/*/registries/*}:\017device_registry\332A\033device_registry,update_mask" - ), + serialized_options=b"\202\323\344\223\002Q2>/v1/{device_registry.name=projects/*/locations/*/registries/*}:\017device_registry\332A\033device_registry,update_mask", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="DeleteDeviceRegistry", @@ -2195,9 +2263,8 @@ containing_service=None, input_type=_DELETEDEVICEREGISTRYREQUEST, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\0020*./v1/{name=projects/*/locations/*/registries/*}\332A\004name" - ), + serialized_options=b"\202\323\344\223\0020*./v1/{name=projects/*/locations/*/registries/*}\332A\004name", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="ListDeviceRegistries", @@ -2206,9 +2273,8 @@ containing_service=None, input_type=_LISTDEVICEREGISTRIESREQUEST, output_type=_LISTDEVICEREGISTRIESRESPONSE, - serialized_options=_b( - "\202\323\344\223\0020\022./v1/{parent=projects/*/locations/*}/registries\332A\006parent" - ), + serialized_options=b"\202\323\344\223\0020\022./v1/{parent=projects/*/locations/*}/registries\332A\006parent", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="CreateDevice", @@ -2217,9 +2283,8 @@ containing_service=None, input_type=_CREATEDEVICEREQUEST, output_type=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2._DEVICE, - serialized_options=_b( - '\202\323\344\223\002B"8/v1/{parent=projects/*/locations/*/registries/*}/devices:\006device\332A\rparent,device' - ), + serialized_options=b'\202\323\344\223\002B"8/v1/{parent=projects/*/locations/*/registries/*}/devices:\006device\332A\rparent,device', + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="GetDevice", @@ -2228,9 +2293,8 @@ containing_service=None, input_type=_GETDEVICEREQUEST, output_type=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2._DEVICE, - serialized_options=_b( - "\202\323\344\223\002\177\0228/v1/{name=projects/*/locations/*/registries/*/devices/*}ZC\022A/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}\332A\004name" - ), + serialized_options=b"\202\323\344\223\002\177\0228/v1/{name=projects/*/locations/*/registries/*/devices/*}ZC\022A/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}\332A\004name", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="UpdateDevice", @@ -2239,9 +2303,8 @@ containing_service=None, input_type=_UPDATEDEVICEREQUEST, output_type=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2._DEVICE, - serialized_options=_b( - "\202\323\344\223\002\235\0012?/v1/{device.name=projects/*/locations/*/registries/*/devices/*}:\006deviceZR2H/v1/{device.name=projects/*/locations/*/registries/*/groups/*/devices/*}:\006device\332A\022device,update_mask" - ), + serialized_options=b"\202\323\344\223\002\235\0012?/v1/{device.name=projects/*/locations/*/registries/*/devices/*}:\006deviceZR2H/v1/{device.name=projects/*/locations/*/registries/*/groups/*/devices/*}:\006device\332A\022device,update_mask", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="DeleteDevice", @@ -2250,9 +2313,8 @@ containing_service=None, input_type=_DELETEDEVICEREQUEST, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, - serialized_options=_b( - "\202\323\344\223\002:*8/v1/{name=projects/*/locations/*/registries/*/devices/*}\332A\004name" - ), + serialized_options=b"\202\323\344\223\002:*8/v1/{name=projects/*/locations/*/registries/*/devices/*}\332A\004name", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="ListDevices", @@ -2261,9 +2323,8 @@ containing_service=None, input_type=_LISTDEVICESREQUEST, output_type=_LISTDEVICESRESPONSE, - serialized_options=_b( - "\202\323\344\223\002\177\0228/v1/{parent=projects/*/locations/*/registries/*}/devicesZC\022A/v1/{parent=projects/*/locations/*/registries/*/groups/*}/devices\332A\006parent" - ), + serialized_options=b"\202\323\344\223\002\177\0228/v1/{parent=projects/*/locations/*/registries/*}/devicesZC\022A/v1/{parent=projects/*/locations/*/registries/*/groups/*}/devices\332A\006parent", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="ModifyCloudToDeviceConfig", @@ -2272,9 +2333,8 @@ containing_service=None, input_type=_MODIFYCLOUDTODEVICECONFIGREQUEST, output_type=google_dot_cloud_dot_iot__v1_dot_proto_dot_resources__pb2._DEVICECONFIG, - serialized_options=_b( - '\202\323\344\223\002\271\001"R/v1/{name=projects/*/locations/*/registries/*/devices/*}:modifyCloudToDeviceConfig:\001*Z`"[/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}:modifyCloudToDeviceConfig:\001*\332A\020name,binary_data' - ), + serialized_options=b'\202\323\344\223\002\271\001"R/v1/{name=projects/*/locations/*/registries/*/devices/*}:modifyCloudToDeviceConfig:\001*Z`"[/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}:modifyCloudToDeviceConfig:\001*\332A\020name,binary_data', + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="ListDeviceConfigVersions", @@ -2283,9 +2343,8 @@ containing_service=None, input_type=_LISTDEVICECONFIGVERSIONSREQUEST, output_type=_LISTDEVICECONFIGVERSIONSRESPONSE, - serialized_options=_b( - "\202\323\344\223\002\235\001\022G/v1/{name=projects/*/locations/*/registries/*/devices/*}/configVersionsZR\022P/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}/configVersions\332A\004name" - ), + serialized_options=b"\202\323\344\223\002\235\001\022G/v1/{name=projects/*/locations/*/registries/*/devices/*}/configVersionsZR\022P/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}/configVersions\332A\004name", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="ListDeviceStates", @@ -2294,9 +2353,8 @@ containing_service=None, input_type=_LISTDEVICESTATESREQUEST, output_type=_LISTDEVICESTATESRESPONSE, - serialized_options=_b( - "\202\323\344\223\002\215\001\022?/v1/{name=projects/*/locations/*/registries/*/devices/*}/statesZJ\022H/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}/states\332A\004name" - ), + serialized_options=b"\202\323\344\223\002\215\001\022?/v1/{name=projects/*/locations/*/registries/*/devices/*}/statesZJ\022H/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}/states\332A\004name", + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="SetIamPolicy", @@ -2305,9 +2363,8 @@ containing_service=None, input_type=google_dot_iam_dot_v1_dot_iam__policy__pb2._SETIAMPOLICYREQUEST, output_type=google_dot_iam_dot_v1_dot_policy__pb2._POLICY, - serialized_options=_b( - '\202\323\344\223\002\223\001"?/v1/{resource=projects/*/locations/*/registries/*}:setIamPolicy:\001*ZM"H/v1/{resource=projects/*/locations/*/registries/*/groups/*}:setIamPolicy:\001*\332A\017resource,policy' - ), + serialized_options=b'\202\323\344\223\002\223\001"?/v1/{resource=projects/*/locations/*/registries/*}:setIamPolicy:\001*ZM"H/v1/{resource=projects/*/locations/*/registries/*/groups/*}:setIamPolicy:\001*\332A\017resource,policy', + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="GetIamPolicy", @@ -2316,9 +2373,8 @@ containing_service=None, input_type=google_dot_iam_dot_v1_dot_iam__policy__pb2._GETIAMPOLICYREQUEST, output_type=google_dot_iam_dot_v1_dot_policy__pb2._POLICY, - serialized_options=_b( - '\202\323\344\223\002\223\001"?/v1/{resource=projects/*/locations/*/registries/*}:getIamPolicy:\001*ZM"H/v1/{resource=projects/*/locations/*/registries/*/groups/*}:getIamPolicy:\001*\332A\010resource' - ), + serialized_options=b'\202\323\344\223\002\223\001"?/v1/{resource=projects/*/locations/*/registries/*}:getIamPolicy:\001*ZM"H/v1/{resource=projects/*/locations/*/registries/*/groups/*}:getIamPolicy:\001*\332A\010resource', + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="TestIamPermissions", @@ -2327,9 +2383,8 @@ containing_service=None, input_type=google_dot_iam_dot_v1_dot_iam__policy__pb2._TESTIAMPERMISSIONSREQUEST, output_type=google_dot_iam_dot_v1_dot_iam__policy__pb2._TESTIAMPERMISSIONSRESPONSE, - serialized_options=_b( - '\202\323\344\223\002\237\001"E/v1/{resource=projects/*/locations/*/registries/*}:testIamPermissions:\001*ZS"N/v1/{resource=projects/*/locations/*/registries/*/groups/*}:testIamPermissions:\001*\332A\024resource,permissions' - ), + serialized_options=b'\202\323\344\223\002\237\001"E/v1/{resource=projects/*/locations/*/registries/*}:testIamPermissions:\001*ZS"N/v1/{resource=projects/*/locations/*/registries/*/groups/*}:testIamPermissions:\001*\332A\024resource,permissions', + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="SendCommandToDevice", @@ -2338,9 +2393,8 @@ containing_service=None, input_type=_SENDCOMMANDTODEVICEREQUEST, output_type=_SENDCOMMANDTODEVICERESPONSE, - serialized_options=_b( - '\202\323\344\223\002\255\001"L/v1/{name=projects/*/locations/*/registries/*/devices/*}:sendCommandToDevice:\001*ZZ"U/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}:sendCommandToDevice:\001*\332A\020name,binary_data\332A\032name,binary_data,subfolder' - ), + serialized_options=b'\202\323\344\223\002\255\001"L/v1/{name=projects/*/locations/*/registries/*/devices/*}:sendCommandToDevice:\001*ZZ"U/v1/{name=projects/*/locations/*/registries/*/groups/*/devices/*}:sendCommandToDevice:\001*\332A\020name,binary_data\332A\032name,binary_data,subfolder', + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="BindDeviceToGateway", @@ -2349,9 +2403,8 @@ containing_service=None, input_type=_BINDDEVICETOGATEWAYREQUEST, output_type=_BINDDEVICETOGATEWAYRESPONSE, - serialized_options=_b( - '\202\323\344\223\002\235\001"D/v1/{parent=projects/*/locations/*/registries/*}:bindDeviceToGateway:\001*ZR"M/v1/{parent=projects/*/locations/*/registries/*/groups/*}:bindDeviceToGateway:\001*\332A\033parent,gateway_id,device_id' - ), + serialized_options=b'\202\323\344\223\002\235\001"D/v1/{parent=projects/*/locations/*/registries/*}:bindDeviceToGateway:\001*ZR"M/v1/{parent=projects/*/locations/*/registries/*/groups/*}:bindDeviceToGateway:\001*\332A\033parent,gateway_id,device_id', + create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name="UnbindDeviceFromGateway", @@ -2360,9 +2413,8 @@ containing_service=None, input_type=_UNBINDDEVICEFROMGATEWAYREQUEST, output_type=_UNBINDDEVICEFROMGATEWAYRESPONSE, - serialized_options=_b( - '\202\323\344\223\002\245\001"H/v1/{parent=projects/*/locations/*/registries/*}:unbindDeviceFromGateway:\001*ZV"Q/v1/{parent=projects/*/locations/*/registries/*/groups/*}:unbindDeviceFromGateway:\001*\332A\033parent,gateway_id,device_id' - ), + serialized_options=b'\202\323\344\223\002\245\001"H/v1/{parent=projects/*/locations/*/registries/*}:unbindDeviceFromGateway:\001*ZV"Q/v1/{parent=projects/*/locations/*/registries/*/groups/*}:unbindDeviceFromGateway:\001*\332A\033parent,gateway_id,device_id', + create_key=_descriptor._internal_create_key, ), ], ) diff --git a/google/cloud/iot_v1/proto/resources_pb2.py b/google/cloud/iot_v1/proto/resources_pb2.py index 04eb2320..110f647a 100644 --- a/google/cloud/iot_v1/proto/resources_pb2.py +++ b/google/cloud/iot_v1/proto/resources_pb2.py @@ -2,9 +2,6 @@ # Generated by the protocol buffer compiler. DO NOT EDIT! # source: google/cloud/iot_v1/proto/resources.proto -import sys - -_b = sys.version_info[0] < 3 and (lambda x: x) or (lambda x: x.encode("latin1")) from google.protobuf.internal import enum_type_wrapper from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message @@ -25,12 +22,9 @@ name="google/cloud/iot_v1/proto/resources.proto", package="google.cloud.iot.v1", syntax="proto3", - serialized_options=_b( - "\n\027com.google.cloud.iot.v1B\016ResourcesProtoP\001Z6google.golang.org/genproto/googleapis/cloud/iot/v1;iot\370\001\001" - ), - serialized_pb=_b( - '\n)google/cloud/iot_v1/proto/resources.proto\x12\x13google.cloud.iot.v1\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto"\xb0\x07\n\x06\x44\x65vice\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0e\n\x06num_id\x18\x03 \x01(\x04\x12:\n\x0b\x63redentials\x18\x0c \x03(\x0b\x32%.google.cloud.iot.v1.DeviceCredential\x12\x37\n\x13last_heartbeat_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x0flast_event_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x0flast_state_time\x18\x14 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\x14last_config_ack_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x39\n\x15last_config_send_time\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07\x62locked\x18\x13 \x01(\x08\x12\x33\n\x0flast_error_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\x11last_error_status\x18\x0b \x01(\x0b\x32\x12.google.rpc.Status\x12\x31\n\x06\x63onfig\x18\r \x01(\x0b\x32!.google.cloud.iot.v1.DeviceConfig\x12/\n\x05state\x18\x10 \x01(\x0b\x32 .google.cloud.iot.v1.DeviceState\x12\x30\n\tlog_level\x18\x15 \x01(\x0e\x32\x1d.google.cloud.iot.v1.LogLevel\x12;\n\x08metadata\x18\x11 \x03(\x0b\x32).google.cloud.iot.v1.Device.MetadataEntry\x12:\n\x0egateway_config\x18\x18 \x01(\x0b\x32".google.cloud.iot.v1.GatewayConfig\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:s\xea\x41p\n\x1e\x63loudiot.googleapis.com/Device\x12Nprojects/{project}/locations/{location}/registries/{registry}/devices/{device}"\xee\x01\n\rGatewayConfig\x12\x36\n\x0cgateway_type\x18\x01 \x01(\x0e\x32 .google.cloud.iot.v1.GatewayType\x12\x43\n\x13gateway_auth_method\x18\x02 \x01(\x0e\x32&.google.cloud.iot.v1.GatewayAuthMethod\x12 \n\x18last_accessed_gateway_id\x18\x03 \x01(\t\x12>\n\x1alast_accessed_gateway_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"\x8f\x04\n\x0e\x44\x65viceRegistry\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12P\n\x1a\x65vent_notification_configs\x18\n \x03(\x0b\x32,.google.cloud.iot.v1.EventNotificationConfig\x12O\n\x19state_notification_config\x18\x07 \x01(\x0b\x32,.google.cloud.iot.v1.StateNotificationConfig\x12\x34\n\x0bmqtt_config\x18\x04 \x01(\x0b\x32\x1f.google.cloud.iot.v1.MqttConfig\x12\x34\n\x0bhttp_config\x18\t \x01(\x0b\x32\x1f.google.cloud.iot.v1.HttpConfig\x12\x30\n\tlog_level\x18\x0b \x01(\x0e\x32\x1d.google.cloud.iot.v1.LogLevel\x12<\n\x0b\x63redentials\x18\x08 \x03(\x0b\x32\'.google.cloud.iot.v1.RegistryCredential:d\xea\x41\x61\n cloudiot.googleapis.com/Registry\x12=projects/{project}/locations/{location}/registries/{registry}"H\n\nMqttConfig\x12:\n\x12mqtt_enabled_state\x18\x01 \x01(\x0e\x32\x1e.google.cloud.iot.v1.MqttState"H\n\nHttpConfig\x12:\n\x12http_enabled_state\x18\x01 \x01(\x0e\x32\x1e.google.cloud.iot.v1.HttpState"O\n\x17\x45ventNotificationConfig\x12\x19\n\x11subfolder_matches\x18\x02 \x01(\t\x12\x19\n\x11pubsub_topic_name\x18\x01 \x01(\t"4\n\x17StateNotificationConfig\x12\x19\n\x11pubsub_topic_name\x18\x01 \x01(\t"o\n\x12RegistryCredential\x12K\n\x16public_key_certificate\x18\x01 \x01(\x0b\x32).google.cloud.iot.v1.PublicKeyCertificateH\x00\x42\x0c\n\ncredential"\xd0\x01\n\x16X509CertificateDetails\x12\x0e\n\x06issuer\x18\x01 \x01(\t\x12\x0f\n\x07subject\x18\x02 \x01(\t\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x65xpiry_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1b\n\x13signature_algorithm\x18\x05 \x01(\t\x12\x17\n\x0fpublic_key_type\x18\x06 \x01(\t"\xaf\x01\n\x14PublicKeyCertificate\x12?\n\x06\x66ormat\x18\x01 \x01(\x0e\x32/.google.cloud.iot.v1.PublicKeyCertificateFormat\x12\x13\n\x0b\x63\x65rtificate\x18\x02 \x01(\t\x12\x41\n\x0cx509_details\x18\x03 \x01(\x0b\x32+.google.cloud.iot.v1.X509CertificateDetails"\x95\x01\n\x10\x44\x65viceCredential\x12>\n\npublic_key\x18\x02 \x01(\x0b\x32(.google.cloud.iot.v1.PublicKeyCredentialH\x00\x12\x33\n\x0f\x65xpiration_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x0c\n\ncredential"X\n\x13PublicKeyCredential\x12\x34\n\x06\x66ormat\x18\x01 \x01(\x0e\x32$.google.cloud.iot.v1.PublicKeyFormat\x12\x0b\n\x03key\x18\x02 \x01(\t"\xa0\x01\n\x0c\x44\x65viceConfig\x12\x0f\n\x07version\x18\x01 \x01(\x03\x12\x35\n\x11\x63loud_update_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x0f\x64\x65vice_ack_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x13\n\x0b\x62inary_data\x18\x04 \x01(\x0c"S\n\x0b\x44\x65viceState\x12/\n\x0bupdate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x13\n\x0b\x62inary_data\x18\x02 \x01(\x0c*L\n\tMqttState\x12\x1a\n\x16MQTT_STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cMQTT_ENABLED\x10\x01\x12\x11\n\rMQTT_DISABLED\x10\x02*L\n\tHttpState\x12\x1a\n\x16HTTP_STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cHTTP_ENABLED\x10\x01\x12\x11\n\rHTTP_DISABLED\x10\x02*O\n\x08LogLevel\x12\x19\n\x15LOG_LEVEL_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\n\x12\t\n\x05\x45RROR\x10\x14\x12\x08\n\x04INFO\x10\x1e\x12\t\n\x05\x44\x45\x42UG\x10(*I\n\x0bGatewayType\x12\x1c\n\x18GATEWAY_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07GATEWAY\x10\x01\x12\x0f\n\x0bNON_GATEWAY\x10\x02*\x91\x01\n\x11GatewayAuthMethod\x12#\n\x1fGATEWAY_AUTH_METHOD_UNSPECIFIED\x10\x00\x12\x14\n\x10\x41SSOCIATION_ONLY\x10\x01\x12\x1a\n\x16\x44\x45VICE_AUTH_TOKEN_ONLY\x10\x02\x12%\n!ASSOCIATION_AND_DEVICE_AUTH_TOKEN\x10\x03*e\n\x1aPublicKeyCertificateFormat\x12-\n)UNSPECIFIED_PUBLIC_KEY_CERTIFICATE_FORMAT\x10\x00\x12\x18\n\x14X509_CERTIFICATE_PEM\x10\x01*v\n\x0fPublicKeyFormat\x12!\n\x1dUNSPECIFIED_PUBLIC_KEY_FORMAT\x10\x00\x12\x0b\n\x07RSA_PEM\x10\x03\x12\x10\n\x0cRSA_X509_PEM\x10\x01\x12\r\n\tES256_PEM\x10\x02\x12\x12\n\x0e\x45S256_X509_PEM\x10\x04\x42\x66\n\x17\x63om.google.cloud.iot.v1B\x0eResourcesProtoP\x01Z6google.golang.org/genproto/googleapis/cloud/iot/v1;iot\xf8\x01\x01\x62\x06proto3' - ), + serialized_options=b"\n\027com.google.cloud.iot.v1B\016ResourcesProtoP\001Z6google.golang.org/genproto/googleapis/cloud/iot/v1;iot\370\001\001", + create_key=_descriptor._internal_create_key, + serialized_pb=b'\n)google/cloud/iot_v1/proto/resources.proto\x12\x13google.cloud.iot.v1\x1a\x19google/api/resource.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x17google/rpc/status.proto"\xb0\x07\n\x06\x44\x65vice\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12\x0e\n\x06num_id\x18\x03 \x01(\x04\x12:\n\x0b\x63redentials\x18\x0c \x03(\x0b\x32%.google.cloud.iot.v1.DeviceCredential\x12\x37\n\x13last_heartbeat_time\x18\x07 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x0flast_event_time\x18\x08 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x0flast_state_time\x18\x14 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x38\n\x14last_config_ack_time\x18\x0e \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x39\n\x15last_config_send_time\x18\x12 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x0f\n\x07\x62locked\x18\x13 \x01(\x08\x12\x33\n\x0flast_error_time\x18\n \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12-\n\x11last_error_status\x18\x0b \x01(\x0b\x32\x12.google.rpc.Status\x12\x31\n\x06\x63onfig\x18\r \x01(\x0b\x32!.google.cloud.iot.v1.DeviceConfig\x12/\n\x05state\x18\x10 \x01(\x0b\x32 .google.cloud.iot.v1.DeviceState\x12\x30\n\tlog_level\x18\x15 \x01(\x0e\x32\x1d.google.cloud.iot.v1.LogLevel\x12;\n\x08metadata\x18\x11 \x03(\x0b\x32).google.cloud.iot.v1.Device.MetadataEntry\x12:\n\x0egateway_config\x18\x18 \x01(\x0b\x32".google.cloud.iot.v1.GatewayConfig\x1a/\n\rMetadataEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12\r\n\x05value\x18\x02 \x01(\t:\x02\x38\x01:s\xea\x41p\n\x1e\x63loudiot.googleapis.com/Device\x12Nprojects/{project}/locations/{location}/registries/{registry}/devices/{device}"\xee\x01\n\rGatewayConfig\x12\x36\n\x0cgateway_type\x18\x01 \x01(\x0e\x32 .google.cloud.iot.v1.GatewayType\x12\x43\n\x13gateway_auth_method\x18\x02 \x01(\x0e\x32&.google.cloud.iot.v1.GatewayAuthMethod\x12 \n\x18last_accessed_gateway_id\x18\x03 \x01(\t\x12>\n\x1alast_accessed_gateway_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp"\x8f\x04\n\x0e\x44\x65viceRegistry\x12\n\n\x02id\x18\x01 \x01(\t\x12\x0c\n\x04name\x18\x02 \x01(\t\x12P\n\x1a\x65vent_notification_configs\x18\n \x03(\x0b\x32,.google.cloud.iot.v1.EventNotificationConfig\x12O\n\x19state_notification_config\x18\x07 \x01(\x0b\x32,.google.cloud.iot.v1.StateNotificationConfig\x12\x34\n\x0bmqtt_config\x18\x04 \x01(\x0b\x32\x1f.google.cloud.iot.v1.MqttConfig\x12\x34\n\x0bhttp_config\x18\t \x01(\x0b\x32\x1f.google.cloud.iot.v1.HttpConfig\x12\x30\n\tlog_level\x18\x0b \x01(\x0e\x32\x1d.google.cloud.iot.v1.LogLevel\x12<\n\x0b\x63redentials\x18\x08 \x03(\x0b\x32\'.google.cloud.iot.v1.RegistryCredential:d\xea\x41\x61\n cloudiot.googleapis.com/Registry\x12=projects/{project}/locations/{location}/registries/{registry}"H\n\nMqttConfig\x12:\n\x12mqtt_enabled_state\x18\x01 \x01(\x0e\x32\x1e.google.cloud.iot.v1.MqttState"H\n\nHttpConfig\x12:\n\x12http_enabled_state\x18\x01 \x01(\x0e\x32\x1e.google.cloud.iot.v1.HttpState"O\n\x17\x45ventNotificationConfig\x12\x19\n\x11subfolder_matches\x18\x02 \x01(\t\x12\x19\n\x11pubsub_topic_name\x18\x01 \x01(\t"4\n\x17StateNotificationConfig\x12\x19\n\x11pubsub_topic_name\x18\x01 \x01(\t"o\n\x12RegistryCredential\x12K\n\x16public_key_certificate\x18\x01 \x01(\x0b\x32).google.cloud.iot.v1.PublicKeyCertificateH\x00\x42\x0c\n\ncredential"\xd0\x01\n\x16X509CertificateDetails\x12\x0e\n\x06issuer\x18\x01 \x01(\t\x12\x0f\n\x07subject\x18\x02 \x01(\t\x12.\n\nstart_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0b\x65xpiry_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x1b\n\x13signature_algorithm\x18\x05 \x01(\t\x12\x17\n\x0fpublic_key_type\x18\x06 \x01(\t"\xaf\x01\n\x14PublicKeyCertificate\x12?\n\x06\x66ormat\x18\x01 \x01(\x0e\x32/.google.cloud.iot.v1.PublicKeyCertificateFormat\x12\x13\n\x0b\x63\x65rtificate\x18\x02 \x01(\t\x12\x41\n\x0cx509_details\x18\x03 \x01(\x0b\x32+.google.cloud.iot.v1.X509CertificateDetails"\x95\x01\n\x10\x44\x65viceCredential\x12>\n\npublic_key\x18\x02 \x01(\x0b\x32(.google.cloud.iot.v1.PublicKeyCredentialH\x00\x12\x33\n\x0f\x65xpiration_time\x18\x06 \x01(\x0b\x32\x1a.google.protobuf.TimestampB\x0c\n\ncredential"X\n\x13PublicKeyCredential\x12\x34\n\x06\x66ormat\x18\x01 \x01(\x0e\x32$.google.cloud.iot.v1.PublicKeyFormat\x12\x0b\n\x03key\x18\x02 \x01(\t"\xa0\x01\n\x0c\x44\x65viceConfig\x12\x0f\n\x07version\x18\x01 \x01(\x03\x12\x35\n\x11\x63loud_update_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x33\n\x0f\x64\x65vice_ack_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x13\n\x0b\x62inary_data\x18\x04 \x01(\x0c"S\n\x0b\x44\x65viceState\x12/\n\x0bupdate_time\x18\x01 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12\x13\n\x0b\x62inary_data\x18\x02 \x01(\x0c*L\n\tMqttState\x12\x1a\n\x16MQTT_STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cMQTT_ENABLED\x10\x01\x12\x11\n\rMQTT_DISABLED\x10\x02*L\n\tHttpState\x12\x1a\n\x16HTTP_STATE_UNSPECIFIED\x10\x00\x12\x10\n\x0cHTTP_ENABLED\x10\x01\x12\x11\n\rHTTP_DISABLED\x10\x02*O\n\x08LogLevel\x12\x19\n\x15LOG_LEVEL_UNSPECIFIED\x10\x00\x12\x08\n\x04NONE\x10\n\x12\t\n\x05\x45RROR\x10\x14\x12\x08\n\x04INFO\x10\x1e\x12\t\n\x05\x44\x45\x42UG\x10(*I\n\x0bGatewayType\x12\x1c\n\x18GATEWAY_TYPE_UNSPECIFIED\x10\x00\x12\x0b\n\x07GATEWAY\x10\x01\x12\x0f\n\x0bNON_GATEWAY\x10\x02*\x91\x01\n\x11GatewayAuthMethod\x12#\n\x1fGATEWAY_AUTH_METHOD_UNSPECIFIED\x10\x00\x12\x14\n\x10\x41SSOCIATION_ONLY\x10\x01\x12\x1a\n\x16\x44\x45VICE_AUTH_TOKEN_ONLY\x10\x02\x12%\n!ASSOCIATION_AND_DEVICE_AUTH_TOKEN\x10\x03*e\n\x1aPublicKeyCertificateFormat\x12-\n)UNSPECIFIED_PUBLIC_KEY_CERTIFICATE_FORMAT\x10\x00\x12\x18\n\x14X509_CERTIFICATE_PEM\x10\x01*v\n\x0fPublicKeyFormat\x12!\n\x1dUNSPECIFIED_PUBLIC_KEY_FORMAT\x10\x00\x12\x0b\n\x07RSA_PEM\x10\x03\x12\x10\n\x0cRSA_X509_PEM\x10\x01\x12\r\n\tES256_PEM\x10\x02\x12\x12\n\x0e\x45S256_X509_PEM\x10\x04\x42\x66\n\x17\x63om.google.cloud.iot.v1B\x0eResourcesProtoP\x01Z6google.golang.org/genproto/googleapis/cloud/iot/v1;iot\xf8\x01\x01\x62\x06proto3', dependencies=[ google_dot_api_dot_resource__pb2.DESCRIPTOR, google_dot_protobuf_dot_timestamp__pb2.DESCRIPTOR, @@ -43,6 +37,7 @@ full_name="google.cloud.iot.v1.MqttState", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name="MQTT_STATE_UNSPECIFIED", @@ -50,12 +45,23 @@ number=0, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="MQTT_ENABLED", index=1, number=1, serialized_options=None, type=None + name="MQTT_ENABLED", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="MQTT_DISABLED", index=2, number=2, serialized_options=None, type=None + name="MQTT_DISABLED", + index=2, + number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, @@ -71,6 +77,7 @@ full_name="google.cloud.iot.v1.HttpState", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name="HTTP_STATE_UNSPECIFIED", @@ -78,12 +85,23 @@ number=0, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="HTTP_ENABLED", index=1, number=1, serialized_options=None, type=None + name="HTTP_ENABLED", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="HTTP_DISABLED", index=2, number=2, serialized_options=None, type=None + name="HTTP_DISABLED", + index=2, + number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, @@ -99,6 +117,7 @@ full_name="google.cloud.iot.v1.LogLevel", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name="LOG_LEVEL_UNSPECIFIED", @@ -106,18 +125,39 @@ number=0, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="NONE", index=1, number=10, serialized_options=None, type=None + name="NONE", + index=1, + number=10, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="ERROR", index=2, number=20, serialized_options=None, type=None + name="ERROR", + index=2, + number=20, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="INFO", index=3, number=30, serialized_options=None, type=None + name="INFO", + index=3, + number=30, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="DEBUG", index=4, number=40, serialized_options=None, type=None + name="DEBUG", + index=4, + number=40, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, @@ -133,6 +173,7 @@ full_name="google.cloud.iot.v1.GatewayType", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name="GATEWAY_TYPE_UNSPECIFIED", @@ -140,12 +181,23 @@ number=0, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="GATEWAY", index=1, number=1, serialized_options=None, type=None + name="GATEWAY", + index=1, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="NON_GATEWAY", index=2, number=2, serialized_options=None, type=None + name="NON_GATEWAY", + index=2, + number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, @@ -161,6 +213,7 @@ full_name="google.cloud.iot.v1.GatewayAuthMethod", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name="GATEWAY_AUTH_METHOD_UNSPECIFIED", @@ -168,6 +221,7 @@ number=0, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( name="ASSOCIATION_ONLY", @@ -175,6 +229,7 @@ number=1, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( name="DEVICE_AUTH_TOKEN_ONLY", @@ -182,6 +237,7 @@ number=2, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( name="ASSOCIATION_AND_DEVICE_AUTH_TOKEN", @@ -189,6 +245,7 @@ number=3, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, @@ -204,6 +261,7 @@ full_name="google.cloud.iot.v1.PublicKeyCertificateFormat", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name="UNSPECIFIED_PUBLIC_KEY_CERTIFICATE_FORMAT", @@ -211,6 +269,7 @@ number=0, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( name="X509_CERTIFICATE_PEM", @@ -218,6 +277,7 @@ number=1, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, @@ -235,6 +295,7 @@ full_name="google.cloud.iot.v1.PublicKeyFormat", filename=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, values=[ _descriptor.EnumValueDescriptor( name="UNSPECIFIED_PUBLIC_KEY_FORMAT", @@ -242,18 +303,39 @@ number=0, serialized_options=None, type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="RSA_PEM", index=1, number=3, serialized_options=None, type=None + name="RSA_PEM", + index=1, + number=3, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="RSA_X509_PEM", index=2, number=1, serialized_options=None, type=None + name="RSA_X509_PEM", + index=2, + number=1, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="ES256_PEM", index=3, number=2, serialized_options=None, type=None + name="ES256_PEM", + index=3, + number=2, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), _descriptor.EnumValueDescriptor( - name="ES256_X509_PEM", index=4, number=4, serialized_options=None, type=None + name="ES256_X509_PEM", + index=4, + number=4, + serialized_options=None, + type=None, + create_key=_descriptor._internal_create_key, ), ], containing_type=None, @@ -297,6 +379,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="key", @@ -307,7 +390,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -315,6 +398,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="value", @@ -325,7 +409,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -333,12 +417,13 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], nested_types=[], enum_types=[], - serialized_options=_b("8\001"), + serialized_options=b"8\001", is_extendable=False, syntax="proto3", extension_ranges=[], @@ -353,6 +438,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="id", @@ -363,7 +449,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -371,6 +457,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="name", @@ -381,7 +468,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -389,6 +476,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="num_id", @@ -407,6 +495,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="credentials", @@ -425,6 +514,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="last_heartbeat_time", @@ -443,6 +533,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="last_event_time", @@ -461,6 +552,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="last_state_time", @@ -479,6 +571,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="last_config_ack_time", @@ -497,6 +590,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="last_config_send_time", @@ -515,6 +609,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="blocked", @@ -533,6 +628,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="last_error_time", @@ -551,6 +647,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="last_error_status", @@ -569,6 +666,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="config", @@ -587,6 +685,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="state", @@ -605,6 +704,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="log_level", @@ -623,6 +723,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="metadata", @@ -641,6 +742,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="gateway_config", @@ -659,14 +761,13 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], - nested_types=[_DEVICE_METADATAENTRY], + nested_types=[_DEVICE_METADATAENTRY,], enum_types=[], - serialized_options=_b( - "\352Ap\n\036cloudiot.googleapis.com/Device\022Nprojects/{project}/locations/{location}/registries/{registry}/devices/{device}" - ), + serialized_options=b"\352Ap\n\036cloudiot.googleapis.com/Device\022Nprojects/{project}/locations/{location}/registries/{registry}/devices/{device}", is_extendable=False, syntax="proto3", extension_ranges=[], @@ -682,6 +783,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="gateway_type", @@ -700,6 +802,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="gateway_auth_method", @@ -718,6 +821,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="last_accessed_gateway_id", @@ -728,7 +832,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -736,6 +840,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="last_accessed_gateway_time", @@ -754,6 +859,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -775,6 +881,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="id", @@ -785,7 +892,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -793,6 +900,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="name", @@ -803,7 +911,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -811,6 +919,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="event_notification_configs", @@ -829,6 +938,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="state_notification_config", @@ -847,6 +957,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="mqtt_config", @@ -865,6 +976,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="http_config", @@ -883,6 +995,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="log_level", @@ -901,6 +1014,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="credentials", @@ -919,14 +1033,13 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], nested_types=[], enum_types=[], - serialized_options=_b( - "\352Aa\n cloudiot.googleapis.com/Registry\022=projects/{project}/locations/{location}/registries/{registry}" - ), + serialized_options=b"\352Aa\n cloudiot.googleapis.com/Registry\022=projects/{project}/locations/{location}/registries/{registry}", is_extendable=False, syntax="proto3", extension_ranges=[], @@ -942,6 +1055,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="mqtt_enabled_state", @@ -960,7 +1074,8 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -981,6 +1096,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="http_enabled_state", @@ -999,7 +1115,8 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -1020,6 +1137,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="subfolder_matches", @@ -1030,7 +1148,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -1038,6 +1156,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="pubsub_topic_name", @@ -1048,7 +1167,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -1056,6 +1175,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -1077,6 +1197,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="pubsub_topic_name", @@ -1087,7 +1208,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -1095,7 +1216,8 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -1116,6 +1238,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="public_key_certificate", @@ -1134,7 +1257,8 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, - ) + create_key=_descriptor._internal_create_key, + ), ], extensions=[], nested_types=[], @@ -1149,8 +1273,9 @@ full_name="google.cloud.iot.v1.RegistryCredential.credential", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=2152, serialized_end=2263, @@ -1163,6 +1288,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="issuer", @@ -1173,7 +1299,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -1181,6 +1307,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="subject", @@ -1191,7 +1318,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -1199,6 +1326,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="start_time", @@ -1217,6 +1345,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="expiry_time", @@ -1235,6 +1364,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="signature_algorithm", @@ -1245,7 +1375,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -1253,6 +1383,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="public_key_type", @@ -1263,7 +1394,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -1271,6 +1402,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -1292,6 +1424,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="format", @@ -1310,6 +1443,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="certificate", @@ -1320,7 +1454,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -1328,6 +1462,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="x509_details", @@ -1346,6 +1481,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -1367,6 +1503,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="public_key", @@ -1385,6 +1522,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="expiration_time", @@ -1403,6 +1541,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -1418,8 +1557,9 @@ full_name="google.cloud.iot.v1.DeviceCredential.credential", index=0, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[], - ) + ), ], serialized_start=2655, serialized_end=2804, @@ -1432,6 +1572,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="format", @@ -1450,6 +1591,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="key", @@ -1460,7 +1602,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b("").decode("utf-8"), + default_value=b"".decode("utf-8"), message_type=None, enum_type=None, containing_type=None, @@ -1468,6 +1610,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -1489,6 +1632,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="version", @@ -1507,6 +1651,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="cloud_update_time", @@ -1525,6 +1670,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="device_ack_time", @@ -1543,6 +1689,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="binary_data", @@ -1553,7 +1700,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b(""), + default_value=b"", message_type=None, enum_type=None, containing_type=None, @@ -1561,6 +1708,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -1582,6 +1730,7 @@ filename=None, file=DESCRIPTOR, containing_type=None, + create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name="update_time", @@ -1600,6 +1749,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), _descriptor.FieldDescriptor( name="binary_data", @@ -1610,7 +1760,7 @@ cpp_type=9, label=1, has_default_value=False, - default_value=_b(""), + default_value=b"", message_type=None, enum_type=None, containing_type=None, @@ -1618,6 +1768,7 @@ extension_scope=None, serialized_options=None, file=DESCRIPTOR, + create_key=_descriptor._internal_create_key, ), ], extensions=[], @@ -1744,19 +1895,20 @@ Device = _reflection.GeneratedProtocolMessageType( "Device", (_message.Message,), - dict( - MetadataEntry=_reflection.GeneratedProtocolMessageType( + { + "MetadataEntry": _reflection.GeneratedProtocolMessageType( "MetadataEntry", (_message.Message,), - dict( - DESCRIPTOR=_DEVICE_METADATAENTRY, - __module__="google.cloud.iot_v1.proto.resources_pb2" + { + "DESCRIPTOR": _DEVICE_METADATAENTRY, + "__module__": "google.cloud.iot_v1.proto.resources_pb2" # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.Device.MetadataEntry) - ), + }, ), - DESCRIPTOR=_DEVICE, - __module__="google.cloud.iot_v1.proto.resources_pb2", - __doc__="""The device resource. + "DESCRIPTOR": _DEVICE, + "__module__": "google.cloud.iot_v1.proto.resources_pb2", + "__doc__": """The device resource. + Attributes: id: The user-defined device identifier. The device ID must be @@ -1811,12 +1963,12 @@ last_error_time: [Output only] The time the most recent error occurred, such as a failure to publish to Cloud Pub/Sub. This field is the - timestamp of 'last\_error\_status'. + timestamp of ‘last_error_status’. last_error_status: [Output only] The error message of the most recent error, such - as a failure to publish to Cloud Pub/Sub. 'last\_error\_time' - is the timestamp of this field. If no errors have occurred, - this field has an empty message and the status code 0 == OK. + as a failure to publish to Cloud Pub/Sub. ‘last_error_time’ is + the timestamp of this field. If no errors have occurred, this + field has an empty message and the status code 0 == OK. Otherwise, this field is expected to have a status code other than OK. config: @@ -1832,13 +1984,13 @@ present. log_level: \ **Beta Feature** The logging verbosity for device activity. - If unspecified, DeviceRegistry.log\_level will be used. + If unspecified, DeviceRegistry.log_level will be used. metadata: 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. Keys must conform to the regular expression - [a-zA-Z][a-zA-Z0-9-\_.+~%]+ and be less than 128 bytes in + [a-zA-Z][a-zA-Z0-9-_.+~%]+ and be less than 128 bytes in length. Values are free-form strings. Each value must be less than or equal to 32 KB in size. The total size of all keys and values must be less than 256 KB, and the maximum number of @@ -1847,7 +1999,7 @@ Gateway-related configuration and state. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.Device) - ), + }, ) _sym_db.RegisterMessage(Device) _sym_db.RegisterMessage(Device.MetadataEntry) @@ -1855,10 +2007,11 @@ GatewayConfig = _reflection.GeneratedProtocolMessageType( "GatewayConfig", (_message.Message,), - dict( - DESCRIPTOR=_GATEWAYCONFIG, - __module__="google.cloud.iot_v1.proto.resources_pb2", - __doc__="""Gateway-related configuration and state. + { + "DESCRIPTOR": _GATEWAYCONFIG, + "__module__": "google.cloud.iot_v1.proto.resources_pb2", + "__doc__": """Gateway-related configuration and state. + Attributes: gateway_type: Indicates whether the device is a gateway. @@ -1873,17 +2026,18 @@ accessed the gateway specified in ``last_accessed_gateway``. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.GatewayConfig) - ), + }, ) _sym_db.RegisterMessage(GatewayConfig) DeviceRegistry = _reflection.GeneratedProtocolMessageType( "DeviceRegistry", (_message.Message,), - dict( - DESCRIPTOR=_DEVICEREGISTRY, - __module__="google.cloud.iot_v1.proto.resources_pb2", - __doc__="""A container for a group of devices. + { + "DESCRIPTOR": _DEVICEREGISTRY, + "__module__": "google.cloud.iot_v1.proto.resources_pb2", + "__doc__": """A container for a group of devices. + Attributes: id: The identifier of this device registry. For example, @@ -1899,7 +2053,7 @@ multiple configurations match a message, only the first matching configuration is used. If you try to publish a device telemetry event using MQTT without specifying a Cloud Pub/Sub - topic for the device's registry, the connection closes + topic for the device’s registry, the connection closes automatically. If you try to do so using an HTTP connection, an error is returned. Up to 10 configurations may be provided. state_notification_config: @@ -1907,7 +2061,7 @@ the device. State updates are guaranteed to be stored in the state history, but notifications to Cloud Pub/Sub are not guaranteed. For example, if permissions are misconfigured or - the specified topic doesn't exist, no notification will be + the specified topic doesn’t exist, no notification will be published but the state will still be stored in Cloud IoT Core. mqtt_config: @@ -1918,7 +2072,7 @@ log_level: \ **Beta Feature** The default logging verbosity for activity from devices in this registry. The verbosity level can be - overridden by Device.log\_level. + overridden by Device.log_level. credentials: The credentials used to verify the device credentials. No more than 10 credentials can be bound to a single registry at a @@ -1934,34 +2088,36 @@ or modified. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.DeviceRegistry) - ), + }, ) _sym_db.RegisterMessage(DeviceRegistry) MqttConfig = _reflection.GeneratedProtocolMessageType( "MqttConfig", (_message.Message,), - dict( - DESCRIPTOR=_MQTTCONFIG, - __module__="google.cloud.iot_v1.proto.resources_pb2", - __doc__="""The configuration of MQTT for a device registry. + { + "DESCRIPTOR": _MQTTCONFIG, + "__module__": "google.cloud.iot_v1.proto.resources_pb2", + "__doc__": """The configuration of MQTT for a device registry. + Attributes: mqtt_enabled_state: If enabled, allows connections using the MQTT protocol. Otherwise, MQTT connections to this registry will fail. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.MqttConfig) - ), + }, ) _sym_db.RegisterMessage(MqttConfig) HttpConfig = _reflection.GeneratedProtocolMessageType( "HttpConfig", (_message.Message,), - dict( - DESCRIPTOR=_HTTPCONFIG, - __module__="google.cloud.iot_v1.proto.resources_pb2", - __doc__="""The configuration of the HTTP bridge for a device registry. + { + "DESCRIPTOR": _HTTPCONFIG, + "__module__": "google.cloud.iot_v1.proto.resources_pb2", + "__doc__": """The configuration of the HTTP bridge for a device registry. + Attributes: http_enabled_state: If enabled, allows devices to use DeviceService via the HTTP @@ -1969,22 +2125,23 @@ for this registry. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.HttpConfig) - ), + }, ) _sym_db.RegisterMessage(HttpConfig) EventNotificationConfig = _reflection.GeneratedProtocolMessageType( "EventNotificationConfig", (_message.Message,), - dict( - DESCRIPTOR=_EVENTNOTIFICATIONCONFIG, - __module__="google.cloud.iot_v1.proto.resources_pb2", - __doc__="""The configuration for forwarding telemetry events. + { + "DESCRIPTOR": _EVENTNOTIFICATIONCONFIG, + "__module__": "google.cloud.iot_v1.proto.resources_pb2", + "__doc__": """The configuration for forwarding telemetry events. + Attributes: subfolder_matches: If the subfolder name matches this string exactly, this configuration will be used. The string must not include the - leading '/' character. If empty, all strings are matched. This + leading ‘/’ character. If empty, all strings are matched. This field is used only for telemetry events; subfolders are not supported for state changes. pubsub_topic_name: @@ -1992,36 +2149,38 @@ ``projects/myProject/topics/deviceEvents``. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.EventNotificationConfig) - ), + }, ) _sym_db.RegisterMessage(EventNotificationConfig) StateNotificationConfig = _reflection.GeneratedProtocolMessageType( "StateNotificationConfig", (_message.Message,), - dict( - DESCRIPTOR=_STATENOTIFICATIONCONFIG, - __module__="google.cloud.iot_v1.proto.resources_pb2", - __doc__="""The configuration for notification of new states received from the + { + "DESCRIPTOR": _STATENOTIFICATIONCONFIG, + "__module__": "google.cloud.iot_v1.proto.resources_pb2", + "__doc__": """The configuration for notification of new states received from the device. + Attributes: pubsub_topic_name: A Cloud Pub/Sub topic name. For example, ``projects/myProject/topics/deviceEvents``. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.StateNotificationConfig) - ), + }, ) _sym_db.RegisterMessage(StateNotificationConfig) RegistryCredential = _reflection.GeneratedProtocolMessageType( "RegistryCredential", (_message.Message,), - dict( - DESCRIPTOR=_REGISTRYCREDENTIAL, - __module__="google.cloud.iot_v1.proto.resources_pb2", - __doc__="""A server-stored registry credential used to validate device + { + "DESCRIPTOR": _REGISTRYCREDENTIAL, + "__module__": "google.cloud.iot_v1.proto.resources_pb2", + "__doc__": """A server-stored registry credential used to validate device credentials. + Attributes: credential: The credential data. Reserved for expansion in the future. @@ -2030,17 +2189,18 @@ credentials. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.RegistryCredential) - ), + }, ) _sym_db.RegisterMessage(RegistryCredential) X509CertificateDetails = _reflection.GeneratedProtocolMessageType( "X509CertificateDetails", (_message.Message,), - dict( - DESCRIPTOR=_X509CERTIFICATEDETAILS, - __module__="google.cloud.iot_v1.proto.resources_pb2", - __doc__="""Details of an X.509 certificate. For informational purposes only. + { + "DESCRIPTOR": _X509CERTIFICATEDETAILS, + "__module__": "google.cloud.iot_v1.proto.resources_pb2", + "__doc__": """Details of an X.509 certificate. For informational purposes only. + Attributes: issuer: The entity that signed the certificate. @@ -2056,17 +2216,18 @@ The type of public key in the certificate. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.X509CertificateDetails) - ), + }, ) _sym_db.RegisterMessage(X509CertificateDetails) PublicKeyCertificate = _reflection.GeneratedProtocolMessageType( "PublicKeyCertificate", (_message.Message,), - dict( - DESCRIPTOR=_PUBLICKEYCERTIFICATE, - __module__="google.cloud.iot_v1.proto.resources_pb2", - __doc__="""A public key certificate format and data. + { + "DESCRIPTOR": _PUBLICKEYCERTIFICATE, + "__module__": "google.cloud.iot_v1.proto.resources_pb2", + "__doc__": """A public key certificate format and data. + Attributes: format: The certificate format. @@ -2077,17 +2238,18 @@ certificates. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.PublicKeyCertificate) - ), + }, ) _sym_db.RegisterMessage(PublicKeyCertificate) DeviceCredential = _reflection.GeneratedProtocolMessageType( "DeviceCredential", (_message.Message,), - dict( - DESCRIPTOR=_DEVICECREDENTIAL, - __module__="google.cloud.iot_v1.proto.resources_pb2", - __doc__="""A server-stored device credential used for authentication. + { + "DESCRIPTOR": _DEVICECREDENTIAL, + "__module__": "google.cloud.iot_v1.proto.resources_pb2", + "__doc__": """A server-stored device credential used for authentication. + Attributes: credential: The credential data. Reserved for expansion in the future. @@ -2111,17 +2273,18 @@ automatically deleted. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.DeviceCredential) - ), + }, ) _sym_db.RegisterMessage(DeviceCredential) PublicKeyCredential = _reflection.GeneratedProtocolMessageType( "PublicKeyCredential", (_message.Message,), - dict( - DESCRIPTOR=_PUBLICKEYCREDENTIAL, - __module__="google.cloud.iot_v1.proto.resources_pb2", - __doc__="""A public key format and data. + { + "DESCRIPTOR": _PUBLICKEYCREDENTIAL, + "__module__": "google.cloud.iot_v1.proto.resources_pb2", + "__doc__": """A public key format and data. + Attributes: format: The format of the key. @@ -2129,17 +2292,18 @@ The key data. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.PublicKeyCredential) - ), + }, ) _sym_db.RegisterMessage(PublicKeyCredential) DeviceConfig = _reflection.GeneratedProtocolMessageType( "DeviceConfig", (_message.Message,), - dict( - DESCRIPTOR=_DEVICECONFIG, - __module__="google.cloud.iot_v1.proto.resources_pb2", - __doc__="""The device configuration. Eventually delivered to devices. + { + "DESCRIPTOR": _DEVICECONFIG, + "__module__": "google.cloud.iot_v1.proto.resources_pb2", + "__doc__": """The device configuration. Eventually delivered to devices. + Attributes: version: [Output only] The version of this update. The version number @@ -2166,17 +2330,18 @@ The device configuration data. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.DeviceConfig) - ), + }, ) _sym_db.RegisterMessage(DeviceConfig) DeviceState = _reflection.GeneratedProtocolMessageType( "DeviceState", (_message.Message,), - dict( - DESCRIPTOR=_DEVICESTATE, - __module__="google.cloud.iot_v1.proto.resources_pb2", - __doc__="""The device state, as reported by the device. + { + "DESCRIPTOR": _DEVICESTATE, + "__module__": "google.cloud.iot_v1.proto.resources_pb2", + "__doc__": """The device state, as reported by the device. + Attributes: update_time: [Output only] The time at which this state version was updated @@ -2185,7 +2350,7 @@ The device state data. """, # @@protoc_insertion_point(class_scope:google.cloud.iot.v1.DeviceState) - ), + }, ) _sym_db.RegisterMessage(DeviceState) diff --git a/google/cloud/iot_v1/types.py b/google/cloud/iot_v1/types.py index 9eb13bf5..fe70dabd 100644 --- a/google/cloud/iot_v1/types.py +++ b/google/cloud/iot_v1/types.py @@ -45,7 +45,10 @@ expr_pb2, ] -_local_modules = [device_manager_pb2, resources_pb2] +_local_modules = [ + device_manager_pb2, + resources_pb2, +] names = [] diff --git a/noxfile.py b/noxfile.py index 11fad3af..66fcfd05 100644 --- a/noxfile.py +++ b/noxfile.py @@ -23,14 +23,15 @@ import nox -BLACK_VERSION = "black==19.3b0" +BLACK_VERSION = "black==19.10b0" BLACK_PATHS = ["docs", "google", "tests", "noxfile.py", "setup.py"] -if os.path.exists("samples"): - BLACK_PATHS.append("samples") +DEFAULT_PYTHON_VERSION = "3.8" +SYSTEM_TEST_PYTHON_VERSIONS = ["2.7", "3.8"] +UNIT_TEST_PYTHON_VERSIONS = ["2.7", "3.5", "3.6", "3.7", "3.8"] -@nox.session(python="3.7") +@nox.session(python=DEFAULT_PYTHON_VERSION) def lint(session): """Run linters. @@ -38,7 +39,9 @@ def lint(session): serious code quality issues. """ session.install("flake8", BLACK_VERSION) - session.run("black", "--check", *BLACK_PATHS) + session.run( + "black", "--check", *BLACK_PATHS, + ) session.run("flake8", "google", "tests") @@ -53,10 +56,12 @@ def blacken(session): check the state of the `gcp_ubuntu_config` we use for that Kokoro run. """ session.install(BLACK_VERSION) - session.run("black", *BLACK_PATHS) + session.run( + "black", *BLACK_PATHS, + ) -@nox.session(python="3.7") +@nox.session(python=DEFAULT_PYTHON_VERSION) def lint_setup_py(session): """Verify that setup.py is valid (including RST check).""" session.install("docutils", "pygments") @@ -84,13 +89,13 @@ def default(session): ) -@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"]) +@nox.session(python=UNIT_TEST_PYTHON_VERSIONS) def unit(session): """Run the unit test suite.""" default(session) -@nox.session(python=["2.7", "3.7"]) +@nox.session(python=SYSTEM_TEST_PYTHON_VERSIONS) def system(session): """Run the system test suite.""" system_test_path = os.path.join("tests", "system.py") @@ -110,8 +115,9 @@ def system(session): # Install all test dependencies, then install this package into the # virtualenv's dist-packages. - session.install("mock", "pytest") - session.install("git+https://github.com/googleapis/python-test-utils") + session.install( + "mock", "pytest", "google-cloud-testutils", + ) session.install("-e", ".") # Run py.test against the system tests. @@ -121,7 +127,7 @@ def system(session): session.run("py.test", "--quiet", system_test_folder_path, *session.posargs) -@nox.session(python="3.7") +@nox.session(python=DEFAULT_PYTHON_VERSION) def cover(session): """Run the final coverage report. @@ -134,7 +140,7 @@ def cover(session): session.run("coverage", "erase") -@nox.session(python="3.7") +@nox.session(python=DEFAULT_PYTHON_VERSION) def docs(session): """Build the docs for this library.""" diff --git a/scripts/decrypt-secrets.sh b/scripts/decrypt-secrets.sh new file mode 100755 index 00000000..ff599eb2 --- /dev/null +++ b/scripts/decrypt-secrets.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +# Copyright 2015 Google Inc. All rights reserved. +# +# 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. + +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" +ROOT=$( dirname "$DIR" ) + +# Work from the project root. +cd $ROOT + +# Use SECRET_MANAGER_PROJECT if set, fallback to cloud-devrel-kokoro-resources. +PROJECT_ID="${SECRET_MANAGER_PROJECT:-cloud-devrel-kokoro-resources}" + +gcloud secrets versions access latest --secret="python-docs-samples-test-env" \ + > testing/test-env.sh +gcloud secrets versions access latest \ + --secret="python-docs-samples-service-account" \ + > testing/service-account.json +gcloud secrets versions access latest \ + --secret="python-docs-samples-client-secrets" \ + > testing/client-secrets.json \ No newline at end of file diff --git a/scripts/readme-gen/readme_gen.py b/scripts/readme-gen/readme_gen.py new file mode 100644 index 00000000..d309d6e9 --- /dev/null +++ b/scripts/readme-gen/readme_gen.py @@ -0,0 +1,66 @@ +#!/usr/bin/env python + +# Copyright 2016 Google Inc +# +# 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. + +"""Generates READMEs using configuration defined in yaml.""" + +import argparse +import io +import os +import subprocess + +import jinja2 +import yaml + + +jinja_env = jinja2.Environment( + trim_blocks=True, + loader=jinja2.FileSystemLoader( + os.path.abspath(os.path.join(os.path.dirname(__file__), 'templates')))) + +README_TMPL = jinja_env.get_template('README.tmpl.rst') + + +def get_help(file): + return subprocess.check_output(['python', file, '--help']).decode() + + +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('source') + parser.add_argument('--destination', default='README.rst') + + args = parser.parse_args() + + source = os.path.abspath(args.source) + root = os.path.dirname(source) + destination = os.path.join(root, args.destination) + + jinja_env.globals['get_help'] = get_help + + with io.open(source, 'r') as f: + config = yaml.load(f) + + # This allows get_help to execute in the right directory. + os.chdir(root) + + output = README_TMPL.render(config) + + with io.open(destination, 'w') as f: + f.write(output) + + +if __name__ == '__main__': + main() diff --git a/scripts/readme-gen/templates/README.tmpl.rst b/scripts/readme-gen/templates/README.tmpl.rst new file mode 100644 index 00000000..4fd23976 --- /dev/null +++ b/scripts/readme-gen/templates/README.tmpl.rst @@ -0,0 +1,87 @@ +{# The following line is a lie. BUT! Once jinja2 is done with it, it will + become truth! #} +.. This file is automatically generated. Do not edit this file directly. + +{{product.name}} Python Samples +=============================================================================== + +.. image:: https://gstatic.com/cloudssh/images/open-btn.png + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor={{folder}}/README.rst + + +This directory contains samples for {{product.name}}. {{product.description}} + +{{description}} + +.. _{{product.name}}: {{product.url}} + +{% if required_api_url %} +To run the sample, you need to enable the API at: {{required_api_url}} +{% endif %} + +{% if required_role %} +To run the sample, you need to have `{{required_role}}` role. +{% endif %} + +{{other_required_steps}} + +{% if setup %} +Setup +------------------------------------------------------------------------------- + +{% for section in setup %} + +{% include section + '.tmpl.rst' %} + +{% endfor %} +{% endif %} + +{% if samples %} +Samples +------------------------------------------------------------------------------- + +{% for sample in samples %} +{{sample.name}} ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +{% if not sample.hide_cloudshell_button %} +.. image:: https://gstatic.com/cloudssh/images/open-btn.png + :target: https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/GoogleCloudPlatform/python-docs-samples&page=editor&open_in_editor={{folder}}/{{sample.file}},{{folder}}/README.rst +{% endif %} + + +{{sample.description}} + +To run this sample: + +.. code-block:: bash + + $ python {{sample.file}} +{% if sample.show_help %} + + {{get_help(sample.file)|indent}} +{% endif %} + + +{% endfor %} +{% endif %} + +{% if cloud_client_library %} + +The client library +------------------------------------------------------------------------------- + +This sample uses the `Google Cloud Client Library for Python`_. +You can read the documentation for more details on API usage and use GitHub +to `browse the source`_ and `report issues`_. + +.. _Google Cloud Client Library for Python: + https://googlecloudplatform.github.io/google-cloud-python/ +.. _browse the source: + https://github.com/GoogleCloudPlatform/google-cloud-python +.. _report issues: + https://github.com/GoogleCloudPlatform/google-cloud-python/issues + +{% endif %} + +.. _Google Cloud SDK: https://cloud.google.com/sdk/ \ No newline at end of file diff --git a/scripts/readme-gen/templates/auth.tmpl.rst b/scripts/readme-gen/templates/auth.tmpl.rst new file mode 100644 index 00000000..1446b94a --- /dev/null +++ b/scripts/readme-gen/templates/auth.tmpl.rst @@ -0,0 +1,9 @@ +Authentication +++++++++++++++ + +This sample requires you to have authentication setup. Refer to the +`Authentication Getting Started Guide`_ for instructions on setting up +credentials for applications. + +.. _Authentication Getting Started Guide: + https://cloud.google.com/docs/authentication/getting-started diff --git a/scripts/readme-gen/templates/auth_api_key.tmpl.rst b/scripts/readme-gen/templates/auth_api_key.tmpl.rst new file mode 100644 index 00000000..11957ce2 --- /dev/null +++ b/scripts/readme-gen/templates/auth_api_key.tmpl.rst @@ -0,0 +1,14 @@ +Authentication +++++++++++++++ + +Authentication for this service is done via an `API Key`_. To obtain an API +Key: + +1. Open the `Cloud Platform Console`_ +2. Make sure that billing is enabled for your project. +3. From the **Credentials** page, create a new **API Key** or use an existing + one for your project. + +.. _API Key: + https://developers.google.com/api-client-library/python/guide/aaa_apikeys +.. _Cloud Console: https://console.cloud.google.com/project?_ diff --git a/scripts/readme-gen/templates/install_deps.tmpl.rst b/scripts/readme-gen/templates/install_deps.tmpl.rst new file mode 100644 index 00000000..a0406dba --- /dev/null +++ b/scripts/readme-gen/templates/install_deps.tmpl.rst @@ -0,0 +1,29 @@ +Install Dependencies +++++++++++++++++++++ + +#. Clone python-docs-samples and change directory to the sample directory you want to use. + + .. code-block:: bash + + $ git clone https://github.com/GoogleCloudPlatform/python-docs-samples.git + +#. Install `pip`_ and `virtualenv`_ if you do not already have them. You may want to refer to the `Python Development Environment Setup Guide`_ for Google Cloud Platform for instructions. + + .. _Python Development Environment Setup Guide: + https://cloud.google.com/python/setup + +#. Create a virtualenv. Samples are compatible with Python 2.7 and 3.4+. + + .. code-block:: bash + + $ virtualenv env + $ source env/bin/activate + +#. Install the dependencies needed to run the samples. + + .. code-block:: bash + + $ pip install -r requirements.txt + +.. _pip: https://pip.pypa.io/ +.. _virtualenv: https://virtualenv.pypa.io/ diff --git a/scripts/readme-gen/templates/install_portaudio.tmpl.rst b/scripts/readme-gen/templates/install_portaudio.tmpl.rst new file mode 100644 index 00000000..5ea33d18 --- /dev/null +++ b/scripts/readme-gen/templates/install_portaudio.tmpl.rst @@ -0,0 +1,35 @@ +Install PortAudio ++++++++++++++++++ + +Install `PortAudio`_. This is required by the `PyAudio`_ library to stream +audio from your computer's microphone. PyAudio depends on PortAudio for cross-platform compatibility, and is installed differently depending on the +platform. + +* For Mac OS X, you can use `Homebrew`_:: + + brew install portaudio + + **Note**: if you encounter an error when running `pip install` that indicates + it can't find `portaudio.h`, try running `pip install` with the following + flags:: + + pip install --global-option='build_ext' \ + --global-option='-I/usr/local/include' \ + --global-option='-L/usr/local/lib' \ + pyaudio + +* For Debian / Ubuntu Linux:: + + apt-get install portaudio19-dev python-all-dev + +* Windows may work without having to install PortAudio explicitly (it will get + installed with PyAudio). + +For more details, see the `PyAudio installation`_ page. + + +.. _PyAudio: https://people.csail.mit.edu/hubert/pyaudio/ +.. _PortAudio: http://www.portaudio.com/ +.. _PyAudio installation: + https://people.csail.mit.edu/hubert/pyaudio/#downloads +.. _Homebrew: http://brew.sh diff --git a/synth.metadata b/synth.metadata index b10480a7..086b0078 100644 --- a/synth.metadata +++ b/synth.metadata @@ -1,32 +1,25 @@ { "sources": [ - { - "generator": { - "name": "artman", - "version": "2.0.0", - "dockerImage": "googleapis/artman@sha256:b3b47805231a305d0f40c4bf069df20f6a2635574e6d4259fac651d3f9f6e098" - } - }, { "git": { "name": ".", "remote": "https://github.com/googleapis/python-iot.git", - "sha": "4f08a2e899983839fe36f1f8feec0a3098f8603b" + "sha": "bb331f9f9a2ead6b8e84845cc830ccc981da551a" } }, { "git": { "name": "googleapis", "remote": "https://github.com/googleapis/googleapis.git", - "sha": "42ee97c1b93a0e3759bbba3013da309f670a90ab", - "internalRef": "307114445" + "sha": "cf41866c6f14f10a07aa1e2a1260fc0a2727d889", + "internalRef": "317812187" } }, { "git": { "name": "synthtool", "remote": "https://github.com/googleapis/synthtool.git", - "sha": "f5e4c17dc78a966dbf29961dd01f9bbd63e20a04" + "sha": "cf2eff09d0f5319a4dc5cdce2b6356d85af4a798" } } ], @@ -37,8 +30,7 @@ "apiName": "iot", "apiVersion": "v1", "language": "python", - "generator": "gapic", - "config": "google/cloud/iot/artman_cloudiot.yaml" + "generator": "bazel" } } ] diff --git a/synth.py b/synth.py index cfd2ff44..bd2497d9 100644 --- a/synth.py +++ b/synth.py @@ -40,4 +40,7 @@ templated_files = common.py_library(cov_level=74) s.move(templated_files) +# TODO(busunkim): Use latest sphinx after microgenerator transition +s.replace("noxfile.py", """['"]sphinx['"]""", '"sphinx<3.0.0"') + s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/testing/.gitignore b/testing/.gitignore new file mode 100644 index 00000000..b05fbd63 --- /dev/null +++ b/testing/.gitignore @@ -0,0 +1,3 @@ +test-env.sh +service-account.json +client-secrets.json \ No newline at end of file diff --git a/tests/unit/gapic/v1/test_device_manager_client_v1.py b/tests/unit/gapic/v1/test_device_manager_client_v1.py index 23958d8d..e94e464c 100644 --- a/tests/unit/gapic/v1/test_device_manager_client_v1.py +++ b/tests/unit/gapic/v1/test_device_manager_client_v1.py @@ -65,6 +65,154 @@ class CustomException(Exception): class TestDeviceManagerClient(object): + def test_delete_device_registry(self): + channel = ChannelStub() + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = iot_v1.DeviceManagerClient() + + # Setup Request + name = client.registry_path("[PROJECT]", "[LOCATION]", "[REGISTRY]") + + client.delete_device_registry(name) + + assert len(channel.requests) == 1 + expected_request = device_manager_pb2.DeleteDeviceRegistryRequest(name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_delete_device_registry_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = iot_v1.DeviceManagerClient() + + # Setup request + name = client.registry_path("[PROJECT]", "[LOCATION]", "[REGISTRY]") + + with pytest.raises(CustomException): + client.delete_device_registry(name) + + def test_delete_device(self): + channel = ChannelStub() + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = iot_v1.DeviceManagerClient() + + # Setup Request + name = client.device_path("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]") + + client.delete_device(name) + + assert len(channel.requests) == 1 + expected_request = device_manager_pb2.DeleteDeviceRequest(name=name) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_delete_device_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = iot_v1.DeviceManagerClient() + + # Setup request + name = client.device_path("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]") + + with pytest.raises(CustomException): + client.delete_device(name) + + def test_modify_cloud_to_device_config(self): + # Setup Expected Response + version = 351608024 + binary_data_2 = b"-37" + expected_response = {"version": version, "binary_data": binary_data_2} + expected_response = resources_pb2.DeviceConfig(**expected_response) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = iot_v1.DeviceManagerClient() + + # Setup Request + name = client.device_path("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]") + binary_data = b"40" + + response = client.modify_cloud_to_device_config(name, binary_data) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = device_manager_pb2.ModifyCloudToDeviceConfigRequest( + name=name, binary_data=binary_data + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_modify_cloud_to_device_config_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = iot_v1.DeviceManagerClient() + + # Setup request + name = client.device_path("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]") + binary_data = b"40" + + with pytest.raises(CustomException): + client.modify_cloud_to_device_config(name, binary_data) + + def test_send_command_to_device(self): + # Setup Expected Response + expected_response = {} + expected_response = device_manager_pb2.SendCommandToDeviceResponse( + **expected_response + ) + + # Mock the API response + channel = ChannelStub(responses=[expected_response]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = iot_v1.DeviceManagerClient() + + # Setup Request + name = client.device_path("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]") + binary_data = b"40" + + response = client.send_command_to_device(name, binary_data) + assert expected_response == response + + assert len(channel.requests) == 1 + expected_request = device_manager_pb2.SendCommandToDeviceRequest( + name=name, binary_data=binary_data + ) + actual_request = channel.requests[0][1] + assert expected_request == actual_request + + def test_send_command_to_device_exception(self): + # Mock the API response + channel = ChannelStub(responses=[CustomException()]) + patch = mock.patch("google.api_core.grpc_helpers.create_channel") + with patch as create_channel: + create_channel.return_value = channel + client = iot_v1.DeviceManagerClient() + + # Setup request + name = client.device_path("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]") + binary_data = b"40" + + with pytest.raises(CustomException): + client.send_command_to_device(name, binary_data) + def test_create_device_registry(self): # Setup Expected Response id_ = "id3355" @@ -190,37 +338,6 @@ def test_update_device_registry_exception(self): with pytest.raises(CustomException): client.update_device_registry(device_registry, update_mask) - def test_delete_device_registry(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = iot_v1.DeviceManagerClient() - - # Setup Request - name = client.registry_path("[PROJECT]", "[LOCATION]", "[REGISTRY]") - - client.delete_device_registry(name) - - assert len(channel.requests) == 1 - expected_request = device_manager_pb2.DeleteDeviceRegistryRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_device_registry_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = iot_v1.DeviceManagerClient() - - # Setup request - name = client.registry_path("[PROJECT]", "[LOCATION]", "[REGISTRY]") - - with pytest.raises(CustomException): - client.delete_device_registry(name) - def test_list_device_registries(self): # Setup Expected Response next_page_token = "" @@ -415,37 +532,6 @@ def test_update_device_exception(self): with pytest.raises(CustomException): client.update_device(device, update_mask) - def test_delete_device(self): - channel = ChannelStub() - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = iot_v1.DeviceManagerClient() - - # Setup Request - name = client.device_path("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]") - - client.delete_device(name) - - assert len(channel.requests) == 1 - expected_request = device_manager_pb2.DeleteDeviceRequest(name=name) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_delete_device_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = iot_v1.DeviceManagerClient() - - # Setup request - name = client.device_path("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]") - - with pytest.raises(CustomException): - client.delete_device(name) - def test_list_devices(self): # Setup Expected Response next_page_token = "" @@ -489,49 +575,6 @@ def test_list_devices_exception(self): with pytest.raises(CustomException): list(paged_list_response) - def test_modify_cloud_to_device_config(self): - # Setup Expected Response - version = 351608024 - binary_data_2 = b"-37" - expected_response = {"version": version, "binary_data": binary_data_2} - expected_response = resources_pb2.DeviceConfig(**expected_response) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = iot_v1.DeviceManagerClient() - - # Setup Request - name = client.device_path("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]") - binary_data = b"40" - - response = client.modify_cloud_to_device_config(name, binary_data) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = device_manager_pb2.ModifyCloudToDeviceConfigRequest( - name=name, binary_data=binary_data - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_modify_cloud_to_device_config_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = iot_v1.DeviceManagerClient() - - # Setup request - name = client.device_path("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]") - binary_data = b"40" - - with pytest.raises(CustomException): - client.modify_cloud_to_device_config(name, binary_data) - def test_list_device_config_versions(self): # Setup Expected Response expected_response = {} @@ -735,49 +778,6 @@ def test_test_iam_permissions_exception(self): with pytest.raises(CustomException): client.test_iam_permissions(resource, permissions) - def test_send_command_to_device(self): - # Setup Expected Response - expected_response = {} - expected_response = device_manager_pb2.SendCommandToDeviceResponse( - **expected_response - ) - - # Mock the API response - channel = ChannelStub(responses=[expected_response]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = iot_v1.DeviceManagerClient() - - # Setup Request - name = client.device_path("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]") - binary_data = b"40" - - response = client.send_command_to_device(name, binary_data) - assert expected_response == response - - assert len(channel.requests) == 1 - expected_request = device_manager_pb2.SendCommandToDeviceRequest( - name=name, binary_data=binary_data - ) - actual_request = channel.requests[0][1] - assert expected_request == actual_request - - def test_send_command_to_device_exception(self): - # Mock the API response - channel = ChannelStub(responses=[CustomException()]) - patch = mock.patch("google.api_core.grpc_helpers.create_channel") - with patch as create_channel: - create_channel.return_value = channel - client = iot_v1.DeviceManagerClient() - - # Setup request - name = client.device_path("[PROJECT]", "[LOCATION]", "[REGISTRY]", "[DEVICE]") - binary_data = b"40" - - with pytest.raises(CustomException): - client.send_command_to_device(name, binary_data) - def test_bind_device_to_gateway(self): # Setup Expected Response expected_response = {}