google-cloud-datastream 1.13.0__tar.gz → 1.13.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/PKG-INFO +98 -9
  2. google_cloud_datastream-1.13.2/README.rst +197 -0
  3. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream/gapic_version.py +1 -1
  4. {google_cloud_datastream-1.13.0/google/cloud/datastream_v1alpha1 → google_cloud_datastream-1.13.2/google/cloud/datastream_v1}/gapic_version.py +1 -1
  5. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1/services/datastream/async_client.py +92 -23
  6. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1/services/datastream/client.py +92 -23
  7. {google_cloud_datastream-1.13.0/google/cloud/datastream_v1 → google_cloud_datastream-1.13.2/google/cloud/datastream_v1alpha1}/gapic_version.py +1 -1
  8. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1alpha1/services/datastream/async_client.py +76 -19
  9. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1alpha1/services/datastream/client.py +76 -19
  10. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google_cloud_datastream.egg-info/PKG-INFO +98 -9
  11. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google_cloud_datastream.egg-info/SOURCES.txt +0 -1
  12. google_cloud_datastream-1.13.2/google_cloud_datastream.egg-info/requires.txt +8 -0
  13. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/setup.cfg +0 -3
  14. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/setup.py +6 -6
  15. google_cloud_datastream-1.13.0/README.rst +0 -108
  16. google_cloud_datastream-1.13.0/google_cloud_datastream.egg-info/requires.txt +0 -8
  17. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/LICENSE +0 -0
  18. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/MANIFEST.in +0 -0
  19. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream/__init__.py +0 -0
  20. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream/py.typed +0 -0
  21. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1/__init__.py +0 -0
  22. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1/gapic_metadata.json +0 -0
  23. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1/py.typed +0 -0
  24. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1/services/__init__.py +0 -0
  25. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1/services/datastream/__init__.py +0 -0
  26. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1/services/datastream/pagers.py +0 -0
  27. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1/services/datastream/transports/__init__.py +0 -0
  28. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1/services/datastream/transports/base.py +0 -0
  29. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1/services/datastream/transports/grpc.py +0 -0
  30. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1/services/datastream/transports/grpc_asyncio.py +0 -0
  31. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1/services/datastream/transports/rest.py +0 -0
  32. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1/services/datastream/transports/rest_base.py +0 -0
  33. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1/types/__init__.py +0 -0
  34. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1/types/datastream.py +0 -0
  35. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1/types/datastream_resources.py +0 -0
  36. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1alpha1/__init__.py +0 -0
  37. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1alpha1/gapic_metadata.json +0 -0
  38. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1alpha1/py.typed +0 -0
  39. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1alpha1/services/__init__.py +0 -0
  40. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1alpha1/services/datastream/__init__.py +0 -0
  41. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1alpha1/services/datastream/pagers.py +0 -0
  42. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1alpha1/services/datastream/transports/__init__.py +0 -0
  43. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1alpha1/services/datastream/transports/base.py +0 -0
  44. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc.py +0 -0
  45. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1alpha1/services/datastream/transports/grpc_asyncio.py +0 -0
  46. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1alpha1/services/datastream/transports/rest.py +0 -0
  47. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1alpha1/services/datastream/transports/rest_base.py +0 -0
  48. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1alpha1/types/__init__.py +0 -0
  49. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1alpha1/types/datastream.py +0 -0
  50. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google/cloud/datastream_v1alpha1/types/datastream_resources.py +0 -0
  51. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google_cloud_datastream.egg-info/dependency_links.txt +0 -0
  52. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google_cloud_datastream.egg-info/not-zip-safe +0 -0
  53. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/google_cloud_datastream.egg-info/top_level.txt +0 -0
  54. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/tests/__init__.py +0 -0
  55. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/tests/unit/__init__.py +0 -0
  56. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/tests/unit/gapic/__init__.py +0 -0
  57. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/tests/unit/gapic/datastream_v1/__init__.py +0 -0
  58. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/tests/unit/gapic/datastream_v1/test_datastream.py +0 -0
  59. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/tests/unit/gapic/datastream_v1alpha1/__init__.py +0 -0
  60. {google_cloud_datastream-1.13.0 → google_cloud_datastream-1.13.2}/tests/unit/gapic/datastream_v1alpha1/test_datastream.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: google-cloud-datastream
3
- Version: 1.13.0
3
+ Version: 1.13.2
4
4
  Summary: Google Cloud Datastream API client library
5
5
  Home-page: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-datastream
6
6
  Author: Google LLC
@@ -23,12 +23,12 @@ Classifier: Operating System :: OS Independent
23
23
  Classifier: Topic :: Internet
24
24
  Requires-Python: >=3.7
25
25
  License-File: LICENSE
26
- Requires-Dist: google-api-core[grpc]!=2.0.*,!=2.1.*,!=2.10.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,<3.0.0dev,>=1.34.1
27
- Requires-Dist: google-auth!=2.24.0,!=2.25.0,<3.0.0dev,>=2.14.1
28
- Requires-Dist: proto-plus<2.0.0dev,>=1.22.3
29
- Requires-Dist: proto-plus<2.0.0dev,>=1.25.0; python_version >= "3.13"
30
- Requires-Dist: protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<6.0.0dev,>=3.20.2
31
- Requires-Dist: grpc-google-iam-v1<1.0.0dev,>=0.12.4
26
+ Requires-Dist: google-api-core[grpc]!=2.0.*,!=2.1.*,!=2.10.*,!=2.2.*,!=2.3.*,!=2.4.*,!=2.5.*,!=2.6.*,!=2.7.*,!=2.8.*,!=2.9.*,<3.0.0,>=1.34.1
27
+ Requires-Dist: google-auth!=2.24.0,!=2.25.0,<3.0.0,>=2.14.1
28
+ Requires-Dist: proto-plus<2.0.0,>=1.22.3
29
+ Requires-Dist: proto-plus<2.0.0,>=1.25.0; python_version >= "3.13"
30
+ Requires-Dist: protobuf!=4.21.0,!=4.21.1,!=4.21.2,!=4.21.3,!=4.21.4,!=4.21.5,<7.0.0,>=3.20.2
31
+ Requires-Dist: grpc-google-iam-v1<1.0.0,>=0.14.0
32
32
 
33
33
  Python Client for Datastream
34
34
  ============================
@@ -58,12 +58,12 @@ In order to use this library, you first need to go through the following steps:
58
58
  1. `Select or create a Cloud Platform project.`_
59
59
  2. `Enable billing for your project.`_
60
60
  3. `Enable the Datastream.`_
61
- 4. `Setup Authentication.`_
61
+ 4. `Set up Authentication.`_
62
62
 
63
63
  .. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
64
64
  .. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
65
65
  .. _Enable the Datastream.: https://cloud.google.com/datastream/
66
- .. _Setup Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
66
+ .. _Set up Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
67
67
 
68
68
  Installation
69
69
  ~~~~~~~~~~~~
@@ -138,3 +138,92 @@ Next Steps
138
138
 
139
139
  .. _Datastream Product documentation: https://cloud.google.com/datastream/
140
140
  .. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst
141
+
142
+ Logging
143
+ -------
144
+
145
+ This library uses the standard Python :code:`logging` functionality to log some RPC events that could be of interest for debugging and monitoring purposes.
146
+ Note the following:
147
+
148
+ #. Logs may contain sensitive information. Take care to **restrict access to the logs** if they are saved, whether it be on local storage or on Google Cloud Logging.
149
+ #. Google may refine the occurrence, level, and content of various log messages in this library without flagging such changes as breaking. **Do not depend on immutability of the logging events**.
150
+ #. By default, the logging events from this library are not handled. You must **explicitly configure log handling** using one of the mechanisms below.
151
+
152
+ Simple, environment-based configuration
153
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
154
+
155
+ To enable logging for this library without any changes in your code, set the :code:`GOOGLE_SDK_PYTHON_LOGGING_SCOPE` environment variable to a valid Google
156
+ logging scope. This configures handling of logging events (at level :code:`logging.DEBUG` or higher) from this library in a default manner, emitting the logged
157
+ messages in a structured format. It does not currently allow customizing the logging levels captured nor the handlers, formatters, etc. used for any logging
158
+ event.
159
+
160
+ A logging scope is a period-separated namespace that begins with :code:`google`, identifying the Python module or package to log.
161
+
162
+ - Valid logging scopes: :code:`google`, :code:`google.cloud.asset.v1`, :code:`google.api`, :code:`google.auth`, etc.
163
+ - Invalid logging scopes: :code:`foo`, :code:`123`, etc.
164
+
165
+ **NOTE**: If the logging scope is invalid, the library does not set up any logging handlers.
166
+
167
+ Environment-Based Examples
168
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^
169
+
170
+ - Enabling the default handler for all Google-based loggers
171
+
172
+ .. code-block:: console
173
+
174
+ export GOOGLE_SDK_PYTHON_LOGGING_SCOPE=google
175
+
176
+ - Enabling the default handler for a specific Google module (for a client library called :code:`library_v1`):
177
+
178
+ .. code-block:: console
179
+
180
+ export GOOGLE_SDK_PYTHON_LOGGING_SCOPE=google.cloud.library_v1
181
+
182
+
183
+ Advanced, code-based configuration
184
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
185
+
186
+ You can also configure a valid logging scope using Python's standard `logging` mechanism.
187
+
188
+ Code-Based Examples
189
+ ^^^^^^^^^^^^^^^^^^^
190
+
191
+ - Configuring a handler for all Google-based loggers
192
+
193
+ .. code-block:: python
194
+
195
+ import logging
196
+
197
+ from google.cloud.translate_v3 import translate
198
+
199
+ base_logger = logging.getLogger("google")
200
+ base_logger.addHandler(logging.StreamHandler())
201
+ base_logger.setLevel(logging.DEBUG)
202
+
203
+ - Configuring a handler for a specific Google module (for a client library called :code:`library_v1`):
204
+
205
+ .. code-block:: python
206
+
207
+ import logging
208
+
209
+ from google.cloud.translate_v3 import translate
210
+
211
+ base_logger = logging.getLogger("google.cloud.library_v1")
212
+ base_logger.addHandler(logging.StreamHandler())
213
+ base_logger.setLevel(logging.DEBUG)
214
+
215
+ Logging details
216
+ ~~~~~~~~~~~~~~~
217
+
218
+ #. Regardless of which of the mechanisms above you use to configure logging for this library, by default logging events are not propagated up to the root
219
+ logger from the `google`-level logger. If you need the events to be propagated to the root logger, you must explicitly set
220
+ :code:`logging.getLogger("google").propagate = True` in your code.
221
+ #. You can mix the different logging configurations above for different Google modules. For example, you may want use a code-based logging configuration for
222
+ one library, but decide you need to also set up environment-based logging configuration for another library.
223
+
224
+ #. If you attempt to use both code-based and environment-based configuration for the same module, the environment-based configuration will be ineffectual
225
+ if the code -based configuration gets applied first.
226
+
227
+ #. The Google-specific logging configurations (default handlers for environment-based configuration; not propagating logging events to the root logger) get
228
+ executed the first time *any* client library is instantiated in your application, and only if the affected loggers have not been previously configured.
229
+ (This is the reason for 2.i. above.)
@@ -0,0 +1,197 @@
1
+ Python Client for Datastream
2
+ ============================
3
+
4
+ |stable| |pypi| |versions|
5
+
6
+ `Datastream`_: is a serverless and easy-to-use change data capture (CDC) and replication service. It allows you to synchronize data across heterogeneous databases and applications reliably, and with minimal latency and downtime.
7
+
8
+ - `Client Library Documentation`_
9
+ - `Product Documentation`_
10
+
11
+ .. |stable| image:: https://img.shields.io/badge/support-stable-gold.svg
12
+ :target: https://github.com/googleapis/google-cloud-python/blob/main/README.rst#stability-levels
13
+ .. |pypi| image:: https://img.shields.io/pypi/v/google-cloud-datastream.svg
14
+ :target: https://pypi.org/project/google-cloud-datastream/
15
+ .. |versions| image:: https://img.shields.io/pypi/pyversions/google-cloud-datastream.svg
16
+ :target: https://pypi.org/project/google-cloud-datastream/
17
+ .. _Datastream: https://cloud.google.com/datastream/
18
+ .. _Client Library Documentation: https://cloud.google.com/python/docs/reference/datastream/latest/summary_overview
19
+ .. _Product Documentation: https://cloud.google.com/datastream/
20
+
21
+ Quick Start
22
+ -----------
23
+
24
+ In order to use this library, you first need to go through the following steps:
25
+
26
+ 1. `Select or create a Cloud Platform project.`_
27
+ 2. `Enable billing for your project.`_
28
+ 3. `Enable the Datastream.`_
29
+ 4. `Set up Authentication.`_
30
+
31
+ .. _Select or create a Cloud Platform project.: https://console.cloud.google.com/project
32
+ .. _Enable billing for your project.: https://cloud.google.com/billing/docs/how-to/modify-project#enable_billing_for_a_project
33
+ .. _Enable the Datastream.: https://cloud.google.com/datastream/
34
+ .. _Set up Authentication.: https://googleapis.dev/python/google-api-core/latest/auth.html
35
+
36
+ Installation
37
+ ~~~~~~~~~~~~
38
+
39
+ Install this library in a virtual environment using `venv`_. `venv`_ is a tool that
40
+ creates isolated Python environments. These isolated environments can have separate
41
+ versions of Python packages, which allows you to isolate one project's dependencies
42
+ from the dependencies of other projects.
43
+
44
+ With `venv`_, it's possible to install this library without needing system
45
+ install permissions, and without clashing with the installed system
46
+ dependencies.
47
+
48
+ .. _`venv`: https://docs.python.org/3/library/venv.html
49
+
50
+
51
+ Code samples and snippets
52
+ ~~~~~~~~~~~~~~~~~~~~~~~~~
53
+
54
+ Code samples and snippets live in the `samples/`_ folder.
55
+
56
+ .. _samples/: https://github.com/googleapis/google-cloud-python/tree/main/packages/google-cloud-datastream/samples
57
+
58
+
59
+ Supported Python Versions
60
+ ^^^^^^^^^^^^^^^^^^^^^^^^^
61
+ Our client libraries are compatible with all current `active`_ and `maintenance`_ versions of
62
+ Python.
63
+
64
+ Python >= 3.7
65
+
66
+ .. _active: https://devguide.python.org/devcycle/#in-development-main-branch
67
+ .. _maintenance: https://devguide.python.org/devcycle/#maintenance-branches
68
+
69
+ Unsupported Python Versions
70
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^^
71
+ Python <= 3.6
72
+
73
+ If you are using an `end-of-life`_
74
+ version of Python, we recommend that you update as soon as possible to an actively supported version.
75
+
76
+ .. _end-of-life: https://devguide.python.org/devcycle/#end-of-life-branches
77
+
78
+ Mac/Linux
79
+ ^^^^^^^^^
80
+
81
+ .. code-block:: console
82
+
83
+ python3 -m venv <your-env>
84
+ source <your-env>/bin/activate
85
+ pip install google-cloud-datastream
86
+
87
+
88
+ Windows
89
+ ^^^^^^^
90
+
91
+ .. code-block:: console
92
+
93
+ py -m venv <your-env>
94
+ .\<your-env>\Scripts\activate
95
+ pip install google-cloud-datastream
96
+
97
+ Next Steps
98
+ ~~~~~~~~~~
99
+
100
+ - Read the `Client Library Documentation`_ for Datastream
101
+ to see other available methods on the client.
102
+ - Read the `Datastream Product documentation`_ to learn
103
+ more about the product and see How-to Guides.
104
+ - View this `README`_ to see the full list of Cloud
105
+ APIs that we cover.
106
+
107
+ .. _Datastream Product documentation: https://cloud.google.com/datastream/
108
+ .. _README: https://github.com/googleapis/google-cloud-python/blob/main/README.rst
109
+
110
+ Logging
111
+ -------
112
+
113
+ This library uses the standard Python :code:`logging` functionality to log some RPC events that could be of interest for debugging and monitoring purposes.
114
+ Note the following:
115
+
116
+ #. Logs may contain sensitive information. Take care to **restrict access to the logs** if they are saved, whether it be on local storage or on Google Cloud Logging.
117
+ #. Google may refine the occurrence, level, and content of various log messages in this library without flagging such changes as breaking. **Do not depend on immutability of the logging events**.
118
+ #. By default, the logging events from this library are not handled. You must **explicitly configure log handling** using one of the mechanisms below.
119
+
120
+ Simple, environment-based configuration
121
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
122
+
123
+ To enable logging for this library without any changes in your code, set the :code:`GOOGLE_SDK_PYTHON_LOGGING_SCOPE` environment variable to a valid Google
124
+ logging scope. This configures handling of logging events (at level :code:`logging.DEBUG` or higher) from this library in a default manner, emitting the logged
125
+ messages in a structured format. It does not currently allow customizing the logging levels captured nor the handlers, formatters, etc. used for any logging
126
+ event.
127
+
128
+ A logging scope is a period-separated namespace that begins with :code:`google`, identifying the Python module or package to log.
129
+
130
+ - Valid logging scopes: :code:`google`, :code:`google.cloud.asset.v1`, :code:`google.api`, :code:`google.auth`, etc.
131
+ - Invalid logging scopes: :code:`foo`, :code:`123`, etc.
132
+
133
+ **NOTE**: If the logging scope is invalid, the library does not set up any logging handlers.
134
+
135
+ Environment-Based Examples
136
+ ^^^^^^^^^^^^^^^^^^^^^^^^^^
137
+
138
+ - Enabling the default handler for all Google-based loggers
139
+
140
+ .. code-block:: console
141
+
142
+ export GOOGLE_SDK_PYTHON_LOGGING_SCOPE=google
143
+
144
+ - Enabling the default handler for a specific Google module (for a client library called :code:`library_v1`):
145
+
146
+ .. code-block:: console
147
+
148
+ export GOOGLE_SDK_PYTHON_LOGGING_SCOPE=google.cloud.library_v1
149
+
150
+
151
+ Advanced, code-based configuration
152
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
153
+
154
+ You can also configure a valid logging scope using Python's standard `logging` mechanism.
155
+
156
+ Code-Based Examples
157
+ ^^^^^^^^^^^^^^^^^^^
158
+
159
+ - Configuring a handler for all Google-based loggers
160
+
161
+ .. code-block:: python
162
+
163
+ import logging
164
+
165
+ from google.cloud.translate_v3 import translate
166
+
167
+ base_logger = logging.getLogger("google")
168
+ base_logger.addHandler(logging.StreamHandler())
169
+ base_logger.setLevel(logging.DEBUG)
170
+
171
+ - Configuring a handler for a specific Google module (for a client library called :code:`library_v1`):
172
+
173
+ .. code-block:: python
174
+
175
+ import logging
176
+
177
+ from google.cloud.translate_v3 import translate
178
+
179
+ base_logger = logging.getLogger("google.cloud.library_v1")
180
+ base_logger.addHandler(logging.StreamHandler())
181
+ base_logger.setLevel(logging.DEBUG)
182
+
183
+ Logging details
184
+ ~~~~~~~~~~~~~~~
185
+
186
+ #. Regardless of which of the mechanisms above you use to configure logging for this library, by default logging events are not propagated up to the root
187
+ logger from the `google`-level logger. If you need the events to be propagated to the root logger, you must explicitly set
188
+ :code:`logging.getLogger("google").propagate = True` in your code.
189
+ #. You can mix the different logging configurations above for different Google modules. For example, you may want use a code-based logging configuration for
190
+ one library, but decide you need to also set up environment-based logging configuration for another library.
191
+
192
+ #. If you attempt to use both code-based and environment-based configuration for the same module, the environment-based configuration will be ineffectual
193
+ if the code -based configuration gets applied first.
194
+
195
+ #. The Google-specific logging configurations (default handlers for environment-based configuration; not propagating logging events to the root logger) get
196
+ executed the first time *any* client library is instantiated in your application, and only if the affected loggers have not been previously configured.
197
+ (This is the reason for 2.i. above.)
@@ -13,4 +13,4 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- __version__ = "1.13.0" # {x-release-please-version}
16
+ __version__ = "1.13.2" # {x-release-please-version}
@@ -13,4 +13,4 @@
13
13
  # See the License for the specific language governing permissions and
14
14
  # limitations under the License.
15
15
  #
16
- __version__ = "1.13.0" # {x-release-please-version}
16
+ __version__ = "1.13.2" # {x-release-please-version}
@@ -374,7 +374,10 @@ class DatastreamAsyncClient:
374
374
  # Create or coerce a protobuf request object.
375
375
  # - Quick check: If we got a request object, we should *not* have
376
376
  # gotten any keyword arguments that map to the request.
377
- has_flattened_params = any([parent])
377
+ flattened_params = [parent]
378
+ has_flattened_params = (
379
+ len([param for param in flattened_params if param is not None]) > 0
380
+ )
378
381
  if request is not None and has_flattened_params:
379
382
  raise ValueError(
380
383
  "If the `request` argument is set, then none of "
@@ -495,7 +498,10 @@ class DatastreamAsyncClient:
495
498
  # Create or coerce a protobuf request object.
496
499
  # - Quick check: If we got a request object, we should *not* have
497
500
  # gotten any keyword arguments that map to the request.
498
- has_flattened_params = any([name])
501
+ flattened_params = [name]
502
+ has_flattened_params = (
503
+ len([param for param in flattened_params if param is not None]) > 0
504
+ )
499
505
  if request is not None and has_flattened_params:
500
506
  raise ValueError(
501
507
  "If the `request` argument is set, then none of "
@@ -636,7 +642,10 @@ class DatastreamAsyncClient:
636
642
  # Create or coerce a protobuf request object.
637
643
  # - Quick check: If we got a request object, we should *not* have
638
644
  # gotten any keyword arguments that map to the request.
639
- has_flattened_params = any([parent, connection_profile, connection_profile_id])
645
+ flattened_params = [parent, connection_profile, connection_profile_id]
646
+ has_flattened_params = (
647
+ len([param for param in flattened_params if param is not None]) > 0
648
+ )
640
649
  if request is not None and has_flattened_params:
641
650
  raise ValueError(
642
651
  "If the `request` argument is set, then none of "
@@ -783,7 +792,10 @@ class DatastreamAsyncClient:
783
792
  # Create or coerce a protobuf request object.
784
793
  # - Quick check: If we got a request object, we should *not* have
785
794
  # gotten any keyword arguments that map to the request.
786
- has_flattened_params = any([connection_profile, update_mask])
795
+ flattened_params = [connection_profile, update_mask]
796
+ has_flattened_params = (
797
+ len([param for param in flattened_params if param is not None]) > 0
798
+ )
787
799
  if request is not None and has_flattened_params:
788
800
  raise ValueError(
789
801
  "If the `request` argument is set, then none of "
@@ -919,7 +931,10 @@ class DatastreamAsyncClient:
919
931
  # Create or coerce a protobuf request object.
920
932
  # - Quick check: If we got a request object, we should *not* have
921
933
  # gotten any keyword arguments that map to the request.
922
- has_flattened_params = any([name])
934
+ flattened_params = [name]
935
+ has_flattened_params = (
936
+ len([param for param in flattened_params if param is not None]) > 0
937
+ )
923
938
  if request is not None and has_flattened_params:
924
939
  raise ValueError(
925
940
  "If the `request` argument is set, then none of "
@@ -1137,7 +1152,10 @@ class DatastreamAsyncClient:
1137
1152
  # Create or coerce a protobuf request object.
1138
1153
  # - Quick check: If we got a request object, we should *not* have
1139
1154
  # gotten any keyword arguments that map to the request.
1140
- has_flattened_params = any([parent])
1155
+ flattened_params = [parent]
1156
+ has_flattened_params = (
1157
+ len([param for param in flattened_params if param is not None]) > 0
1158
+ )
1141
1159
  if request is not None and has_flattened_params:
1142
1160
  raise ValueError(
1143
1161
  "If the `request` argument is set, then none of "
@@ -1255,7 +1273,10 @@ class DatastreamAsyncClient:
1255
1273
  # Create or coerce a protobuf request object.
1256
1274
  # - Quick check: If we got a request object, we should *not* have
1257
1275
  # gotten any keyword arguments that map to the request.
1258
- has_flattened_params = any([name])
1276
+ flattened_params = [name]
1277
+ has_flattened_params = (
1278
+ len([param for param in flattened_params if param is not None]) > 0
1279
+ )
1259
1280
  if request is not None and has_flattened_params:
1260
1281
  raise ValueError(
1261
1282
  "If the `request` argument is set, then none of "
@@ -1392,7 +1413,10 @@ class DatastreamAsyncClient:
1392
1413
  # Create or coerce a protobuf request object.
1393
1414
  # - Quick check: If we got a request object, we should *not* have
1394
1415
  # gotten any keyword arguments that map to the request.
1395
- has_flattened_params = any([parent, stream, stream_id])
1416
+ flattened_params = [parent, stream, stream_id]
1417
+ has_flattened_params = (
1418
+ len([param for param in flattened_params if param is not None]) > 0
1419
+ )
1396
1420
  if request is not None and has_flattened_params:
1397
1421
  raise ValueError(
1398
1422
  "If the `request` argument is set, then none of "
@@ -1538,7 +1562,10 @@ class DatastreamAsyncClient:
1538
1562
  # Create or coerce a protobuf request object.
1539
1563
  # - Quick check: If we got a request object, we should *not* have
1540
1564
  # gotten any keyword arguments that map to the request.
1541
- has_flattened_params = any([stream, update_mask])
1565
+ flattened_params = [stream, update_mask]
1566
+ has_flattened_params = (
1567
+ len([param for param in flattened_params if param is not None]) > 0
1568
+ )
1542
1569
  if request is not None and has_flattened_params:
1543
1570
  raise ValueError(
1544
1571
  "If the `request` argument is set, then none of "
@@ -1672,7 +1699,10 @@ class DatastreamAsyncClient:
1672
1699
  # Create or coerce a protobuf request object.
1673
1700
  # - Quick check: If we got a request object, we should *not* have
1674
1701
  # gotten any keyword arguments that map to the request.
1675
- has_flattened_params = any([name])
1702
+ flattened_params = [name]
1703
+ has_flattened_params = (
1704
+ len([param for param in flattened_params if param is not None]) > 0
1705
+ )
1676
1706
  if request is not None and has_flattened_params:
1677
1707
  raise ValueError(
1678
1708
  "If the `request` argument is set, then none of "
@@ -1890,7 +1920,10 @@ class DatastreamAsyncClient:
1890
1920
  # Create or coerce a protobuf request object.
1891
1921
  # - Quick check: If we got a request object, we should *not* have
1892
1922
  # gotten any keyword arguments that map to the request.
1893
- has_flattened_params = any([name])
1923
+ flattened_params = [name]
1924
+ has_flattened_params = (
1925
+ len([param for param in flattened_params if param is not None]) > 0
1926
+ )
1894
1927
  if request is not None and has_flattened_params:
1895
1928
  raise ValueError(
1896
1929
  "If the `request` argument is set, then none of "
@@ -2096,7 +2129,10 @@ class DatastreamAsyncClient:
2096
2129
  # Create or coerce a protobuf request object.
2097
2130
  # - Quick check: If we got a request object, we should *not* have
2098
2131
  # gotten any keyword arguments that map to the request.
2099
- has_flattened_params = any([parent])
2132
+ flattened_params = [parent]
2133
+ has_flattened_params = (
2134
+ len([param for param in flattened_params if param is not None]) > 0
2135
+ )
2100
2136
  if request is not None and has_flattened_params:
2101
2137
  raise ValueError(
2102
2138
  "If the `request` argument is set, then none of "
@@ -2219,7 +2255,10 @@ class DatastreamAsyncClient:
2219
2255
  # Create or coerce a protobuf request object.
2220
2256
  # - Quick check: If we got a request object, we should *not* have
2221
2257
  # gotten any keyword arguments that map to the request.
2222
- has_flattened_params = any([object_])
2258
+ flattened_params = [object_]
2259
+ has_flattened_params = (
2260
+ len([param for param in flattened_params if param is not None]) > 0
2261
+ )
2223
2262
  if request is not None and has_flattened_params:
2224
2263
  raise ValueError(
2225
2264
  "If the `request` argument is set, then none of "
@@ -2330,7 +2369,10 @@ class DatastreamAsyncClient:
2330
2369
  # Create or coerce a protobuf request object.
2331
2370
  # - Quick check: If we got a request object, we should *not* have
2332
2371
  # gotten any keyword arguments that map to the request.
2333
- has_flattened_params = any([object_])
2372
+ flattened_params = [object_]
2373
+ has_flattened_params = (
2374
+ len([param for param in flattened_params if param is not None]) > 0
2375
+ )
2334
2376
  if request is not None and has_flattened_params:
2335
2377
  raise ValueError(
2336
2378
  "If the `request` argument is set, then none of "
@@ -2444,7 +2486,10 @@ class DatastreamAsyncClient:
2444
2486
  # Create or coerce a protobuf request object.
2445
2487
  # - Quick check: If we got a request object, we should *not* have
2446
2488
  # gotten any keyword arguments that map to the request.
2447
- has_flattened_params = any([name])
2489
+ flattened_params = [name]
2490
+ has_flattened_params = (
2491
+ len([param for param in flattened_params if param is not None]) > 0
2492
+ )
2448
2493
  if request is not None and has_flattened_params:
2449
2494
  raise ValueError(
2450
2495
  "If the `request` argument is set, then none of "
@@ -2593,7 +2638,10 @@ class DatastreamAsyncClient:
2593
2638
  # Create or coerce a protobuf request object.
2594
2639
  # - Quick check: If we got a request object, we should *not* have
2595
2640
  # gotten any keyword arguments that map to the request.
2596
- has_flattened_params = any([parent, private_connection, private_connection_id])
2641
+ flattened_params = [parent, private_connection, private_connection_id]
2642
+ has_flattened_params = (
2643
+ len([param for param in flattened_params if param is not None]) > 0
2644
+ )
2597
2645
  if request is not None and has_flattened_params:
2598
2646
  raise ValueError(
2599
2647
  "If the `request` argument is set, then none of "
@@ -2716,7 +2764,10 @@ class DatastreamAsyncClient:
2716
2764
  # Create or coerce a protobuf request object.
2717
2765
  # - Quick check: If we got a request object, we should *not* have
2718
2766
  # gotten any keyword arguments that map to the request.
2719
- has_flattened_params = any([name])
2767
+ flattened_params = [name]
2768
+ has_flattened_params = (
2769
+ len([param for param in flattened_params if param is not None]) > 0
2770
+ )
2720
2771
  if request is not None and has_flattened_params:
2721
2772
  raise ValueError(
2722
2773
  "If the `request` argument is set, then none of "
@@ -2830,7 +2881,10 @@ class DatastreamAsyncClient:
2830
2881
  # Create or coerce a protobuf request object.
2831
2882
  # - Quick check: If we got a request object, we should *not* have
2832
2883
  # gotten any keyword arguments that map to the request.
2833
- has_flattened_params = any([parent])
2884
+ flattened_params = [parent]
2885
+ has_flattened_params = (
2886
+ len([param for param in flattened_params if param is not None]) > 0
2887
+ )
2834
2888
  if request is not None and has_flattened_params:
2835
2889
  raise ValueError(
2836
2890
  "If the `request` argument is set, then none of "
@@ -2966,7 +3020,10 @@ class DatastreamAsyncClient:
2966
3020
  # Create or coerce a protobuf request object.
2967
3021
  # - Quick check: If we got a request object, we should *not* have
2968
3022
  # gotten any keyword arguments that map to the request.
2969
- has_flattened_params = any([name])
3023
+ flattened_params = [name]
3024
+ has_flattened_params = (
3025
+ len([param for param in flattened_params if param is not None]) > 0
3026
+ )
2970
3027
  if request is not None and has_flattened_params:
2971
3028
  raise ValueError(
2972
3029
  "If the `request` argument is set, then none of "
@@ -3108,7 +3165,10 @@ class DatastreamAsyncClient:
3108
3165
  # Create or coerce a protobuf request object.
3109
3166
  # - Quick check: If we got a request object, we should *not* have
3110
3167
  # gotten any keyword arguments that map to the request.
3111
- has_flattened_params = any([parent, route, route_id])
3168
+ flattened_params = [parent, route, route_id]
3169
+ has_flattened_params = (
3170
+ len([param for param in flattened_params if param is not None]) > 0
3171
+ )
3112
3172
  if request is not None and has_flattened_params:
3113
3173
  raise ValueError(
3114
3174
  "If the `request` argument is set, then none of "
@@ -3229,7 +3289,10 @@ class DatastreamAsyncClient:
3229
3289
  # Create or coerce a protobuf request object.
3230
3290
  # - Quick check: If we got a request object, we should *not* have
3231
3291
  # gotten any keyword arguments that map to the request.
3232
- has_flattened_params = any([name])
3292
+ flattened_params = [name]
3293
+ has_flattened_params = (
3294
+ len([param for param in flattened_params if param is not None]) > 0
3295
+ )
3233
3296
  if request is not None and has_flattened_params:
3234
3297
  raise ValueError(
3235
3298
  "If the `request` argument is set, then none of "
@@ -3341,7 +3404,10 @@ class DatastreamAsyncClient:
3341
3404
  # Create or coerce a protobuf request object.
3342
3405
  # - Quick check: If we got a request object, we should *not* have
3343
3406
  # gotten any keyword arguments that map to the request.
3344
- has_flattened_params = any([parent])
3407
+ flattened_params = [parent]
3408
+ has_flattened_params = (
3409
+ len([param for param in flattened_params if param is not None]) > 0
3410
+ )
3345
3411
  if request is not None and has_flattened_params:
3346
3412
  raise ValueError(
3347
3413
  "If the `request` argument is set, then none of "
@@ -3473,7 +3539,10 @@ class DatastreamAsyncClient:
3473
3539
  # Create or coerce a protobuf request object.
3474
3540
  # - Quick check: If we got a request object, we should *not* have
3475
3541
  # gotten any keyword arguments that map to the request.
3476
- has_flattened_params = any([name])
3542
+ flattened_params = [name]
3543
+ has_flattened_params = (
3544
+ len([param for param in flattened_params if param is not None]) > 0
3545
+ )
3477
3546
  if request is not None and has_flattened_params:
3478
3547
  raise ValueError(
3479
3548
  "If the `request` argument is set, then none of "