google-cloud-bigtable 2.30.0__py3-none-any.whl

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 (115) hide show
  1. google/cloud/bigtable/__init__.py +25 -0
  2. google/cloud/bigtable/app_profile.py +377 -0
  3. google/cloud/bigtable/backup.py +490 -0
  4. google/cloud/bigtable/batcher.py +414 -0
  5. google/cloud/bigtable/client.py +475 -0
  6. google/cloud/bigtable/cluster.py +541 -0
  7. google/cloud/bigtable/column_family.py +362 -0
  8. google/cloud/bigtable/data/__init__.py +103 -0
  9. google/cloud/bigtable/data/_async/__init__.py +25 -0
  10. google/cloud/bigtable/data/_async/_mutate_rows.py +226 -0
  11. google/cloud/bigtable/data/_async/_read_rows.py +363 -0
  12. google/cloud/bigtable/data/_async/client.py +1522 -0
  13. google/cloud/bigtable/data/_async/mutations_batcher.py +534 -0
  14. google/cloud/bigtable/data/_cross_sync/__init__.py +20 -0
  15. google/cloud/bigtable/data/_cross_sync/_decorators.py +441 -0
  16. google/cloud/bigtable/data/_cross_sync/_mapping_meta.py +64 -0
  17. google/cloud/bigtable/data/_cross_sync/cross_sync.py +334 -0
  18. google/cloud/bigtable/data/_helpers.py +249 -0
  19. google/cloud/bigtable/data/_sync_autogen/_mutate_rows.py +182 -0
  20. google/cloud/bigtable/data/_sync_autogen/_read_rows.py +304 -0
  21. google/cloud/bigtable/data/_sync_autogen/client.py +1293 -0
  22. google/cloud/bigtable/data/_sync_autogen/mutations_batcher.py +449 -0
  23. google/cloud/bigtable/data/exceptions.py +340 -0
  24. google/cloud/bigtable/data/execute_query/__init__.py +43 -0
  25. google/cloud/bigtable/data/execute_query/_async/__init__.py +13 -0
  26. google/cloud/bigtable/data/execute_query/_async/execute_query_iterator.py +291 -0
  27. google/cloud/bigtable/data/execute_query/_byte_cursor.py +123 -0
  28. google/cloud/bigtable/data/execute_query/_checksum.py +43 -0
  29. google/cloud/bigtable/data/execute_query/_parameters_formatting.py +155 -0
  30. google/cloud/bigtable/data/execute_query/_query_result_parsing_utils.py +134 -0
  31. google/cloud/bigtable/data/execute_query/_reader.py +122 -0
  32. google/cloud/bigtable/data/execute_query/_sync_autogen/execute_query_iterator.py +239 -0
  33. google/cloud/bigtable/data/execute_query/metadata.py +399 -0
  34. google/cloud/bigtable/data/execute_query/values.py +123 -0
  35. google/cloud/bigtable/data/mutations.py +380 -0
  36. google/cloud/bigtable/data/read_modify_write_rules.py +112 -0
  37. google/cloud/bigtable/data/read_rows_query.py +536 -0
  38. google/cloud/bigtable/data/row.py +535 -0
  39. google/cloud/bigtable/data/row_filters.py +968 -0
  40. google/cloud/bigtable/encryption_info.py +64 -0
  41. google/cloud/bigtable/enums.py +223 -0
  42. google/cloud/bigtable/error.py +64 -0
  43. google/cloud/bigtable/gapic_version.py +16 -0
  44. google/cloud/bigtable/helpers.py +31 -0
  45. google/cloud/bigtable/instance.py +789 -0
  46. google/cloud/bigtable/policy.py +255 -0
  47. google/cloud/bigtable/row.py +1267 -0
  48. google/cloud/bigtable/row_data.py +380 -0
  49. google/cloud/bigtable/row_filters.py +838 -0
  50. google/cloud/bigtable/row_merger.py +250 -0
  51. google/cloud/bigtable/row_set.py +213 -0
  52. google/cloud/bigtable/table.py +1409 -0
  53. google/cloud/bigtable_admin/__init__.py +410 -0
  54. google/cloud/bigtable_admin/gapic_version.py +16 -0
  55. google/cloud/bigtable_admin/py.typed +2 -0
  56. google/cloud/bigtable_admin_v2/__init__.py +250 -0
  57. google/cloud/bigtable_admin_v2/gapic_metadata.json +962 -0
  58. google/cloud/bigtable_admin_v2/gapic_version.py +16 -0
  59. google/cloud/bigtable_admin_v2/py.typed +2 -0
  60. google/cloud/bigtable_admin_v2/services/__init__.py +15 -0
  61. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/__init__.py +22 -0
  62. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/async_client.py +3465 -0
  63. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/client.py +3944 -0
  64. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/pagers.py +681 -0
  65. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/__init__.py +40 -0
  66. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/base.py +751 -0
  67. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc.py +1249 -0
  68. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc_asyncio.py +1579 -0
  69. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest.py +6820 -0
  70. google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest_base.py +1746 -0
  71. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/__init__.py +22 -0
  72. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/async_client.py +3472 -0
  73. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/client.py +3949 -0
  74. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/pagers.py +669 -0
  75. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/__init__.py +40 -0
  76. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/base.py +708 -0
  77. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc.py +1257 -0
  78. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc_asyncio.py +1549 -0
  79. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest.py +6609 -0
  80. google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest_base.py +1714 -0
  81. google/cloud/bigtable_admin_v2/types/__init__.py +248 -0
  82. google/cloud/bigtable_admin_v2/types/bigtable_instance_admin.py +1364 -0
  83. google/cloud/bigtable_admin_v2/types/bigtable_table_admin.py +1715 -0
  84. google/cloud/bigtable_admin_v2/types/common.py +81 -0
  85. google/cloud/bigtable_admin_v2/types/instance.py +819 -0
  86. google/cloud/bigtable_admin_v2/types/table.py +1028 -0
  87. google/cloud/bigtable_admin_v2/types/types.py +776 -0
  88. google/cloud/bigtable_v2/__init__.py +136 -0
  89. google/cloud/bigtable_v2/gapic_metadata.json +193 -0
  90. google/cloud/bigtable_v2/gapic_version.py +16 -0
  91. google/cloud/bigtable_v2/py.typed +2 -0
  92. google/cloud/bigtable_v2/services/__init__.py +15 -0
  93. google/cloud/bigtable_v2/services/bigtable/__init__.py +22 -0
  94. google/cloud/bigtable_v2/services/bigtable/async_client.py +1741 -0
  95. google/cloud/bigtable_v2/services/bigtable/client.py +2194 -0
  96. google/cloud/bigtable_v2/services/bigtable/transports/__init__.py +38 -0
  97. google/cloud/bigtable_v2/services/bigtable/transports/base.py +343 -0
  98. google/cloud/bigtable_v2/services/bigtable/transports/grpc.py +660 -0
  99. google/cloud/bigtable_v2/services/bigtable/transports/grpc_asyncio.py +762 -0
  100. google/cloud/bigtable_v2/services/bigtable/transports/rest.py +2489 -0
  101. google/cloud/bigtable_v2/services/bigtable/transports/rest_base.py +711 -0
  102. google/cloud/bigtable_v2/types/__init__.py +138 -0
  103. google/cloud/bigtable_v2/types/bigtable.py +1531 -0
  104. google/cloud/bigtable_v2/types/data.py +1612 -0
  105. google/cloud/bigtable_v2/types/feature_flags.py +119 -0
  106. google/cloud/bigtable_v2/types/request_stats.py +171 -0
  107. google/cloud/bigtable_v2/types/response_params.py +64 -0
  108. google/cloud/bigtable_v2/types/types.py +579 -0
  109. google_cloud_bigtable-2.30.0.data/scripts/fixup_bigtable_admin_v2_keywords.py +233 -0
  110. google_cloud_bigtable-2.30.0.data/scripts/fixup_bigtable_v2_keywords.py +186 -0
  111. google_cloud_bigtable-2.30.0.dist-info/LICENSE +202 -0
  112. google_cloud_bigtable-2.30.0.dist-info/METADATA +154 -0
  113. google_cloud_bigtable-2.30.0.dist-info/RECORD +115 -0
  114. google_cloud_bigtable-2.30.0.dist-info/WHEEL +5 -0
  115. google_cloud_bigtable-2.30.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1257 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2024 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ import json
17
+ import logging as std_logging
18
+ import pickle
19
+ import warnings
20
+ from typing import Callable, Dict, Optional, Sequence, Tuple, Union
21
+
22
+ from google.api_core import grpc_helpers
23
+ from google.api_core import operations_v1
24
+ from google.api_core import gapic_v1
25
+ import google.auth # type: ignore
26
+ from google.auth import credentials as ga_credentials # type: ignore
27
+ from google.auth.transport.grpc import SslCredentials # type: ignore
28
+ from google.protobuf.json_format import MessageToJson
29
+ import google.protobuf.message
30
+
31
+ import grpc # type: ignore
32
+ import proto # type: ignore
33
+
34
+ from google.cloud.bigtable_admin_v2.types import bigtable_table_admin
35
+ from google.cloud.bigtable_admin_v2.types import table
36
+ from google.cloud.bigtable_admin_v2.types import table as gba_table
37
+ from google.iam.v1 import iam_policy_pb2 # type: ignore
38
+ from google.iam.v1 import policy_pb2 # type: ignore
39
+ from google.longrunning import operations_pb2 # type: ignore
40
+ from google.protobuf import empty_pb2 # type: ignore
41
+ from .base import BigtableTableAdminTransport, DEFAULT_CLIENT_INFO
42
+
43
+ try:
44
+ from google.api_core import client_logging # type: ignore
45
+
46
+ CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER
47
+ except ImportError: # pragma: NO COVER
48
+ CLIENT_LOGGING_SUPPORTED = False
49
+
50
+ _LOGGER = std_logging.getLogger(__name__)
51
+
52
+
53
+ class _LoggingClientInterceptor(grpc.UnaryUnaryClientInterceptor): # pragma: NO COVER
54
+ def intercept_unary_unary(self, continuation, client_call_details, request):
55
+ logging_enabled = CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
56
+ std_logging.DEBUG
57
+ )
58
+ if logging_enabled: # pragma: NO COVER
59
+ request_metadata = client_call_details.metadata
60
+ if isinstance(request, proto.Message):
61
+ request_payload = type(request).to_json(request)
62
+ elif isinstance(request, google.protobuf.message.Message):
63
+ request_payload = MessageToJson(request)
64
+ else:
65
+ request_payload = f"{type(request).__name__}: {pickle.dumps(request)}"
66
+
67
+ request_metadata = {
68
+ key: value.decode("utf-8") if isinstance(value, bytes) else value
69
+ for key, value in request_metadata
70
+ }
71
+ grpc_request = {
72
+ "payload": request_payload,
73
+ "requestMethod": "grpc",
74
+ "metadata": dict(request_metadata),
75
+ }
76
+ _LOGGER.debug(
77
+ f"Sending request for {client_call_details.method}",
78
+ extra={
79
+ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin",
80
+ "rpcName": client_call_details.method,
81
+ "request": grpc_request,
82
+ "metadata": grpc_request["metadata"],
83
+ },
84
+ )
85
+
86
+ response = continuation(client_call_details, request)
87
+ if logging_enabled: # pragma: NO COVER
88
+ response_metadata = response.trailing_metadata()
89
+ # Convert gRPC metadata `<class 'grpc.aio._metadata.Metadata'>` to list of tuples
90
+ metadata = (
91
+ dict([(k, str(v)) for k, v in response_metadata])
92
+ if response_metadata
93
+ else None
94
+ )
95
+ result = response.result()
96
+ if isinstance(result, proto.Message):
97
+ response_payload = type(result).to_json(result)
98
+ elif isinstance(result, google.protobuf.message.Message):
99
+ response_payload = MessageToJson(result)
100
+ else:
101
+ response_payload = f"{type(result).__name__}: {pickle.dumps(result)}"
102
+ grpc_response = {
103
+ "payload": response_payload,
104
+ "metadata": metadata,
105
+ "status": "OK",
106
+ }
107
+ _LOGGER.debug(
108
+ f"Received response for {client_call_details.method}.",
109
+ extra={
110
+ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin",
111
+ "rpcName": client_call_details.method,
112
+ "response": grpc_response,
113
+ "metadata": grpc_response["metadata"],
114
+ },
115
+ )
116
+ return response
117
+
118
+
119
+ class BigtableTableAdminGrpcTransport(BigtableTableAdminTransport):
120
+ """gRPC backend transport for BigtableTableAdmin.
121
+
122
+ Service for creating, configuring, and deleting Cloud
123
+ Bigtable tables.
124
+
125
+ Provides access to the table schemas only, not the data stored
126
+ within the tables.
127
+
128
+ This class defines the same methods as the primary client, so the
129
+ primary client can load the underlying transport implementation
130
+ and call it.
131
+
132
+ It sends protocol buffers over the wire using gRPC (which is built on
133
+ top of HTTP/2); the ``grpcio`` package must be installed.
134
+ """
135
+
136
+ _stubs: Dict[str, Callable]
137
+
138
+ def __init__(
139
+ self,
140
+ *,
141
+ host: str = "bigtableadmin.googleapis.com",
142
+ credentials: Optional[ga_credentials.Credentials] = None,
143
+ credentials_file: Optional[str] = None,
144
+ scopes: Optional[Sequence[str]] = None,
145
+ channel: Optional[Union[grpc.Channel, Callable[..., grpc.Channel]]] = None,
146
+ api_mtls_endpoint: Optional[str] = None,
147
+ client_cert_source: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
148
+ ssl_channel_credentials: Optional[grpc.ChannelCredentials] = None,
149
+ client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
150
+ quota_project_id: Optional[str] = None,
151
+ client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
152
+ always_use_jwt_access: Optional[bool] = False,
153
+ api_audience: Optional[str] = None,
154
+ ) -> None:
155
+ """Instantiate the transport.
156
+
157
+ Args:
158
+ host (Optional[str]):
159
+ The hostname to connect to (default: 'bigtableadmin.googleapis.com').
160
+ credentials (Optional[google.auth.credentials.Credentials]): The
161
+ authorization credentials to attach to requests. These
162
+ credentials identify the application to the service; if none
163
+ are specified, the client will attempt to ascertain the
164
+ credentials from the environment.
165
+ This argument is ignored if a ``channel`` instance is provided.
166
+ credentials_file (Optional[str]): A file with credentials that can
167
+ be loaded with :func:`google.auth.load_credentials_from_file`.
168
+ This argument is ignored if a ``channel`` instance is provided.
169
+ scopes (Optional(Sequence[str])): A list of scopes. This argument is
170
+ ignored if a ``channel`` instance is provided.
171
+ channel (Optional[Union[grpc.Channel, Callable[..., grpc.Channel]]]):
172
+ A ``Channel`` instance through which to make calls, or a Callable
173
+ that constructs and returns one. If set to None, ``self.create_channel``
174
+ is used to create the channel. If a Callable is given, it will be called
175
+ with the same arguments as used in ``self.create_channel``.
176
+ api_mtls_endpoint (Optional[str]): Deprecated. The mutual TLS endpoint.
177
+ If provided, it overrides the ``host`` argument and tries to create
178
+ a mutual TLS channel with client SSL credentials from
179
+ ``client_cert_source`` or application default SSL credentials.
180
+ client_cert_source (Optional[Callable[[], Tuple[bytes, bytes]]]):
181
+ Deprecated. A callback to provide client SSL certificate bytes and
182
+ private key bytes, both in PEM format. It is ignored if
183
+ ``api_mtls_endpoint`` is None.
184
+ ssl_channel_credentials (grpc.ChannelCredentials): SSL credentials
185
+ for the grpc channel. It is ignored if a ``channel`` instance is provided.
186
+ client_cert_source_for_mtls (Optional[Callable[[], Tuple[bytes, bytes]]]):
187
+ A callback to provide client certificate bytes and private key bytes,
188
+ both in PEM format. It is used to configure a mutual TLS channel. It is
189
+ ignored if a ``channel`` instance or ``ssl_channel_credentials`` is provided.
190
+ quota_project_id (Optional[str]): An optional project to use for billing
191
+ and quota.
192
+ client_info (google.api_core.gapic_v1.client_info.ClientInfo):
193
+ The client info used to send a user-agent string along with
194
+ API requests. If ``None``, then default info will be used.
195
+ Generally, you only need to set this if you're developing
196
+ your own client library.
197
+ always_use_jwt_access (Optional[bool]): Whether self signed JWT should
198
+ be used for service account credentials.
199
+
200
+ Raises:
201
+ google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport
202
+ creation failed for any reason.
203
+ google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials``
204
+ and ``credentials_file`` are passed.
205
+ """
206
+ self._grpc_channel = None
207
+ self._ssl_channel_credentials = ssl_channel_credentials
208
+ self._stubs: Dict[str, Callable] = {}
209
+ self._operations_client: Optional[operations_v1.OperationsClient] = None
210
+
211
+ if api_mtls_endpoint:
212
+ warnings.warn("api_mtls_endpoint is deprecated", DeprecationWarning)
213
+ if client_cert_source:
214
+ warnings.warn("client_cert_source is deprecated", DeprecationWarning)
215
+
216
+ if isinstance(channel, grpc.Channel):
217
+ # Ignore credentials if a channel was passed.
218
+ credentials = None
219
+ self._ignore_credentials = True
220
+ # If a channel was explicitly provided, set it.
221
+ self._grpc_channel = channel
222
+ self._ssl_channel_credentials = None
223
+
224
+ else:
225
+ if api_mtls_endpoint:
226
+ host = api_mtls_endpoint
227
+
228
+ # Create SSL credentials with client_cert_source or application
229
+ # default SSL credentials.
230
+ if client_cert_source:
231
+ cert, key = client_cert_source()
232
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
233
+ certificate_chain=cert, private_key=key
234
+ )
235
+ else:
236
+ self._ssl_channel_credentials = SslCredentials().ssl_credentials
237
+
238
+ else:
239
+ if client_cert_source_for_mtls and not ssl_channel_credentials:
240
+ cert, key = client_cert_source_for_mtls()
241
+ self._ssl_channel_credentials = grpc.ssl_channel_credentials(
242
+ certificate_chain=cert, private_key=key
243
+ )
244
+
245
+ # The base transport sets the host, credentials and scopes
246
+ super().__init__(
247
+ host=host,
248
+ credentials=credentials,
249
+ credentials_file=credentials_file,
250
+ scopes=scopes,
251
+ quota_project_id=quota_project_id,
252
+ client_info=client_info,
253
+ always_use_jwt_access=always_use_jwt_access,
254
+ api_audience=api_audience,
255
+ )
256
+
257
+ if not self._grpc_channel:
258
+ # initialize with the provided callable or the default channel
259
+ channel_init = channel or type(self).create_channel
260
+ self._grpc_channel = channel_init(
261
+ self._host,
262
+ # use the credentials which are saved
263
+ credentials=self._credentials,
264
+ # Set ``credentials_file`` to ``None`` here as
265
+ # the credentials that we saved earlier should be used.
266
+ credentials_file=None,
267
+ scopes=self._scopes,
268
+ ssl_credentials=self._ssl_channel_credentials,
269
+ quota_project_id=quota_project_id,
270
+ options=[
271
+ ("grpc.max_send_message_length", -1),
272
+ ("grpc.max_receive_message_length", -1),
273
+ ],
274
+ )
275
+
276
+ self._interceptor = _LoggingClientInterceptor()
277
+ self._logged_channel = grpc.intercept_channel(
278
+ self._grpc_channel, self._interceptor
279
+ )
280
+
281
+ # Wrap messages. This must be done after self._logged_channel exists
282
+ self._prep_wrapped_messages(client_info)
283
+
284
+ @classmethod
285
+ def create_channel(
286
+ cls,
287
+ host: str = "bigtableadmin.googleapis.com",
288
+ credentials: Optional[ga_credentials.Credentials] = None,
289
+ credentials_file: Optional[str] = None,
290
+ scopes: Optional[Sequence[str]] = None,
291
+ quota_project_id: Optional[str] = None,
292
+ **kwargs,
293
+ ) -> grpc.Channel:
294
+ """Create and return a gRPC channel object.
295
+ Args:
296
+ host (Optional[str]): The host for the channel to use.
297
+ credentials (Optional[~.Credentials]): The
298
+ authorization credentials to attach to requests. These
299
+ credentials identify this application to the service. If
300
+ none are specified, the client will attempt to ascertain
301
+ the credentials from the environment.
302
+ credentials_file (Optional[str]): A file with credentials that can
303
+ be loaded with :func:`google.auth.load_credentials_from_file`.
304
+ This argument is mutually exclusive with credentials.
305
+ scopes (Optional[Sequence[str]]): A optional list of scopes needed for this
306
+ service. These are only used when credentials are not specified and
307
+ are passed to :func:`google.auth.default`.
308
+ quota_project_id (Optional[str]): An optional project to use for billing
309
+ and quota.
310
+ kwargs (Optional[dict]): Keyword arguments, which are passed to the
311
+ channel creation.
312
+ Returns:
313
+ grpc.Channel: A gRPC channel object.
314
+
315
+ Raises:
316
+ google.api_core.exceptions.DuplicateCredentialArgs: If both ``credentials``
317
+ and ``credentials_file`` are passed.
318
+ """
319
+
320
+ return grpc_helpers.create_channel(
321
+ host,
322
+ credentials=credentials,
323
+ credentials_file=credentials_file,
324
+ quota_project_id=quota_project_id,
325
+ default_scopes=cls.AUTH_SCOPES,
326
+ scopes=scopes,
327
+ default_host=cls.DEFAULT_HOST,
328
+ **kwargs,
329
+ )
330
+
331
+ @property
332
+ def grpc_channel(self) -> grpc.Channel:
333
+ """Return the channel designed to connect to this service."""
334
+ return self._grpc_channel
335
+
336
+ @property
337
+ def operations_client(self) -> operations_v1.OperationsClient:
338
+ """Create the client designed to process long-running operations.
339
+
340
+ This property caches on the instance; repeated calls return the same
341
+ client.
342
+ """
343
+ # Quick check: Only create a new client if we do not already have one.
344
+ if self._operations_client is None:
345
+ self._operations_client = operations_v1.OperationsClient(
346
+ self._logged_channel
347
+ )
348
+
349
+ # Return the client from cache.
350
+ return self._operations_client
351
+
352
+ @property
353
+ def create_table(
354
+ self,
355
+ ) -> Callable[[bigtable_table_admin.CreateTableRequest], gba_table.Table]:
356
+ r"""Return a callable for the create table method over gRPC.
357
+
358
+ Creates a new table in the specified instance.
359
+ The table can be created with a full set of initial
360
+ column families, specified in the request.
361
+
362
+ Returns:
363
+ Callable[[~.CreateTableRequest],
364
+ ~.Table]:
365
+ A function that, when called, will call the underlying RPC
366
+ on the server.
367
+ """
368
+ # Generate a "stub function" on-the-fly which will actually make
369
+ # the request.
370
+ # gRPC handles serialization and deserialization, so we just need
371
+ # to pass in the functions for each.
372
+ if "create_table" not in self._stubs:
373
+ self._stubs["create_table"] = self._logged_channel.unary_unary(
374
+ "/google.bigtable.admin.v2.BigtableTableAdmin/CreateTable",
375
+ request_serializer=bigtable_table_admin.CreateTableRequest.serialize,
376
+ response_deserializer=gba_table.Table.deserialize,
377
+ )
378
+ return self._stubs["create_table"]
379
+
380
+ @property
381
+ def create_table_from_snapshot(
382
+ self,
383
+ ) -> Callable[
384
+ [bigtable_table_admin.CreateTableFromSnapshotRequest], operations_pb2.Operation
385
+ ]:
386
+ r"""Return a callable for the create table from snapshot method over gRPC.
387
+
388
+ Creates a new table from the specified snapshot. The
389
+ target table must not exist. The snapshot and the table
390
+ must be in the same instance.
391
+
392
+ Note: This is a private alpha release of Cloud Bigtable
393
+ snapshots. This feature is not currently available to
394
+ most Cloud Bigtable customers. This feature might be
395
+ changed in backward-incompatible ways and is not
396
+ recommended for production use. It is not subject to any
397
+ SLA or deprecation policy.
398
+
399
+ Returns:
400
+ Callable[[~.CreateTableFromSnapshotRequest],
401
+ ~.Operation]:
402
+ A function that, when called, will call the underlying RPC
403
+ on the server.
404
+ """
405
+ # Generate a "stub function" on-the-fly which will actually make
406
+ # the request.
407
+ # gRPC handles serialization and deserialization, so we just need
408
+ # to pass in the functions for each.
409
+ if "create_table_from_snapshot" not in self._stubs:
410
+ self._stubs[
411
+ "create_table_from_snapshot"
412
+ ] = self._logged_channel.unary_unary(
413
+ "/google.bigtable.admin.v2.BigtableTableAdmin/CreateTableFromSnapshot",
414
+ request_serializer=bigtable_table_admin.CreateTableFromSnapshotRequest.serialize,
415
+ response_deserializer=operations_pb2.Operation.FromString,
416
+ )
417
+ return self._stubs["create_table_from_snapshot"]
418
+
419
+ @property
420
+ def list_tables(
421
+ self,
422
+ ) -> Callable[
423
+ [bigtable_table_admin.ListTablesRequest],
424
+ bigtable_table_admin.ListTablesResponse,
425
+ ]:
426
+ r"""Return a callable for the list tables method over gRPC.
427
+
428
+ Lists all tables served from a specified instance.
429
+
430
+ Returns:
431
+ Callable[[~.ListTablesRequest],
432
+ ~.ListTablesResponse]:
433
+ A function that, when called, will call the underlying RPC
434
+ on the server.
435
+ """
436
+ # Generate a "stub function" on-the-fly which will actually make
437
+ # the request.
438
+ # gRPC handles serialization and deserialization, so we just need
439
+ # to pass in the functions for each.
440
+ if "list_tables" not in self._stubs:
441
+ self._stubs["list_tables"] = self._logged_channel.unary_unary(
442
+ "/google.bigtable.admin.v2.BigtableTableAdmin/ListTables",
443
+ request_serializer=bigtable_table_admin.ListTablesRequest.serialize,
444
+ response_deserializer=bigtable_table_admin.ListTablesResponse.deserialize,
445
+ )
446
+ return self._stubs["list_tables"]
447
+
448
+ @property
449
+ def get_table(
450
+ self,
451
+ ) -> Callable[[bigtable_table_admin.GetTableRequest], table.Table]:
452
+ r"""Return a callable for the get table method over gRPC.
453
+
454
+ Gets metadata information about the specified table.
455
+
456
+ Returns:
457
+ Callable[[~.GetTableRequest],
458
+ ~.Table]:
459
+ A function that, when called, will call the underlying RPC
460
+ on the server.
461
+ """
462
+ # Generate a "stub function" on-the-fly which will actually make
463
+ # the request.
464
+ # gRPC handles serialization and deserialization, so we just need
465
+ # to pass in the functions for each.
466
+ if "get_table" not in self._stubs:
467
+ self._stubs["get_table"] = self._logged_channel.unary_unary(
468
+ "/google.bigtable.admin.v2.BigtableTableAdmin/GetTable",
469
+ request_serializer=bigtable_table_admin.GetTableRequest.serialize,
470
+ response_deserializer=table.Table.deserialize,
471
+ )
472
+ return self._stubs["get_table"]
473
+
474
+ @property
475
+ def update_table(
476
+ self,
477
+ ) -> Callable[[bigtable_table_admin.UpdateTableRequest], operations_pb2.Operation]:
478
+ r"""Return a callable for the update table method over gRPC.
479
+
480
+ Updates a specified table.
481
+
482
+ Returns:
483
+ Callable[[~.UpdateTableRequest],
484
+ ~.Operation]:
485
+ A function that, when called, will call the underlying RPC
486
+ on the server.
487
+ """
488
+ # Generate a "stub function" on-the-fly which will actually make
489
+ # the request.
490
+ # gRPC handles serialization and deserialization, so we just need
491
+ # to pass in the functions for each.
492
+ if "update_table" not in self._stubs:
493
+ self._stubs["update_table"] = self._logged_channel.unary_unary(
494
+ "/google.bigtable.admin.v2.BigtableTableAdmin/UpdateTable",
495
+ request_serializer=bigtable_table_admin.UpdateTableRequest.serialize,
496
+ response_deserializer=operations_pb2.Operation.FromString,
497
+ )
498
+ return self._stubs["update_table"]
499
+
500
+ @property
501
+ def delete_table(
502
+ self,
503
+ ) -> Callable[[bigtable_table_admin.DeleteTableRequest], empty_pb2.Empty]:
504
+ r"""Return a callable for the delete table method over gRPC.
505
+
506
+ Permanently deletes a specified table and all of its
507
+ data.
508
+
509
+ Returns:
510
+ Callable[[~.DeleteTableRequest],
511
+ ~.Empty]:
512
+ A function that, when called, will call the underlying RPC
513
+ on the server.
514
+ """
515
+ # Generate a "stub function" on-the-fly which will actually make
516
+ # the request.
517
+ # gRPC handles serialization and deserialization, so we just need
518
+ # to pass in the functions for each.
519
+ if "delete_table" not in self._stubs:
520
+ self._stubs["delete_table"] = self._logged_channel.unary_unary(
521
+ "/google.bigtable.admin.v2.BigtableTableAdmin/DeleteTable",
522
+ request_serializer=bigtable_table_admin.DeleteTableRequest.serialize,
523
+ response_deserializer=empty_pb2.Empty.FromString,
524
+ )
525
+ return self._stubs["delete_table"]
526
+
527
+ @property
528
+ def undelete_table(
529
+ self,
530
+ ) -> Callable[
531
+ [bigtable_table_admin.UndeleteTableRequest], operations_pb2.Operation
532
+ ]:
533
+ r"""Return a callable for the undelete table method over gRPC.
534
+
535
+ Restores a specified table which was accidentally
536
+ deleted.
537
+
538
+ Returns:
539
+ Callable[[~.UndeleteTableRequest],
540
+ ~.Operation]:
541
+ A function that, when called, will call the underlying RPC
542
+ on the server.
543
+ """
544
+ # Generate a "stub function" on-the-fly which will actually make
545
+ # the request.
546
+ # gRPC handles serialization and deserialization, so we just need
547
+ # to pass in the functions for each.
548
+ if "undelete_table" not in self._stubs:
549
+ self._stubs["undelete_table"] = self._logged_channel.unary_unary(
550
+ "/google.bigtable.admin.v2.BigtableTableAdmin/UndeleteTable",
551
+ request_serializer=bigtable_table_admin.UndeleteTableRequest.serialize,
552
+ response_deserializer=operations_pb2.Operation.FromString,
553
+ )
554
+ return self._stubs["undelete_table"]
555
+
556
+ @property
557
+ def create_authorized_view(
558
+ self,
559
+ ) -> Callable[
560
+ [bigtable_table_admin.CreateAuthorizedViewRequest], operations_pb2.Operation
561
+ ]:
562
+ r"""Return a callable for the create authorized view method over gRPC.
563
+
564
+ Creates a new AuthorizedView in a table.
565
+
566
+ Returns:
567
+ Callable[[~.CreateAuthorizedViewRequest],
568
+ ~.Operation]:
569
+ A function that, when called, will call the underlying RPC
570
+ on the server.
571
+ """
572
+ # Generate a "stub function" on-the-fly which will actually make
573
+ # the request.
574
+ # gRPC handles serialization and deserialization, so we just need
575
+ # to pass in the functions for each.
576
+ if "create_authorized_view" not in self._stubs:
577
+ self._stubs["create_authorized_view"] = self._logged_channel.unary_unary(
578
+ "/google.bigtable.admin.v2.BigtableTableAdmin/CreateAuthorizedView",
579
+ request_serializer=bigtable_table_admin.CreateAuthorizedViewRequest.serialize,
580
+ response_deserializer=operations_pb2.Operation.FromString,
581
+ )
582
+ return self._stubs["create_authorized_view"]
583
+
584
+ @property
585
+ def list_authorized_views(
586
+ self,
587
+ ) -> Callable[
588
+ [bigtable_table_admin.ListAuthorizedViewsRequest],
589
+ bigtable_table_admin.ListAuthorizedViewsResponse,
590
+ ]:
591
+ r"""Return a callable for the list authorized views method over gRPC.
592
+
593
+ Lists all AuthorizedViews from a specific table.
594
+
595
+ Returns:
596
+ Callable[[~.ListAuthorizedViewsRequest],
597
+ ~.ListAuthorizedViewsResponse]:
598
+ A function that, when called, will call the underlying RPC
599
+ on the server.
600
+ """
601
+ # Generate a "stub function" on-the-fly which will actually make
602
+ # the request.
603
+ # gRPC handles serialization and deserialization, so we just need
604
+ # to pass in the functions for each.
605
+ if "list_authorized_views" not in self._stubs:
606
+ self._stubs["list_authorized_views"] = self._logged_channel.unary_unary(
607
+ "/google.bigtable.admin.v2.BigtableTableAdmin/ListAuthorizedViews",
608
+ request_serializer=bigtable_table_admin.ListAuthorizedViewsRequest.serialize,
609
+ response_deserializer=bigtable_table_admin.ListAuthorizedViewsResponse.deserialize,
610
+ )
611
+ return self._stubs["list_authorized_views"]
612
+
613
+ @property
614
+ def get_authorized_view(
615
+ self,
616
+ ) -> Callable[
617
+ [bigtable_table_admin.GetAuthorizedViewRequest], table.AuthorizedView
618
+ ]:
619
+ r"""Return a callable for the get authorized view method over gRPC.
620
+
621
+ Gets information from a specified AuthorizedView.
622
+
623
+ Returns:
624
+ Callable[[~.GetAuthorizedViewRequest],
625
+ ~.AuthorizedView]:
626
+ A function that, when called, will call the underlying RPC
627
+ on the server.
628
+ """
629
+ # Generate a "stub function" on-the-fly which will actually make
630
+ # the request.
631
+ # gRPC handles serialization and deserialization, so we just need
632
+ # to pass in the functions for each.
633
+ if "get_authorized_view" not in self._stubs:
634
+ self._stubs["get_authorized_view"] = self._logged_channel.unary_unary(
635
+ "/google.bigtable.admin.v2.BigtableTableAdmin/GetAuthorizedView",
636
+ request_serializer=bigtable_table_admin.GetAuthorizedViewRequest.serialize,
637
+ response_deserializer=table.AuthorizedView.deserialize,
638
+ )
639
+ return self._stubs["get_authorized_view"]
640
+
641
+ @property
642
+ def update_authorized_view(
643
+ self,
644
+ ) -> Callable[
645
+ [bigtable_table_admin.UpdateAuthorizedViewRequest], operations_pb2.Operation
646
+ ]:
647
+ r"""Return a callable for the update authorized view method over gRPC.
648
+
649
+ Updates an AuthorizedView in a table.
650
+
651
+ Returns:
652
+ Callable[[~.UpdateAuthorizedViewRequest],
653
+ ~.Operation]:
654
+ A function that, when called, will call the underlying RPC
655
+ on the server.
656
+ """
657
+ # Generate a "stub function" on-the-fly which will actually make
658
+ # the request.
659
+ # gRPC handles serialization and deserialization, so we just need
660
+ # to pass in the functions for each.
661
+ if "update_authorized_view" not in self._stubs:
662
+ self._stubs["update_authorized_view"] = self._logged_channel.unary_unary(
663
+ "/google.bigtable.admin.v2.BigtableTableAdmin/UpdateAuthorizedView",
664
+ request_serializer=bigtable_table_admin.UpdateAuthorizedViewRequest.serialize,
665
+ response_deserializer=operations_pb2.Operation.FromString,
666
+ )
667
+ return self._stubs["update_authorized_view"]
668
+
669
+ @property
670
+ def delete_authorized_view(
671
+ self,
672
+ ) -> Callable[[bigtable_table_admin.DeleteAuthorizedViewRequest], empty_pb2.Empty]:
673
+ r"""Return a callable for the delete authorized view method over gRPC.
674
+
675
+ Permanently deletes a specified AuthorizedView.
676
+
677
+ Returns:
678
+ Callable[[~.DeleteAuthorizedViewRequest],
679
+ ~.Empty]:
680
+ A function that, when called, will call the underlying RPC
681
+ on the server.
682
+ """
683
+ # Generate a "stub function" on-the-fly which will actually make
684
+ # the request.
685
+ # gRPC handles serialization and deserialization, so we just need
686
+ # to pass in the functions for each.
687
+ if "delete_authorized_view" not in self._stubs:
688
+ self._stubs["delete_authorized_view"] = self._logged_channel.unary_unary(
689
+ "/google.bigtable.admin.v2.BigtableTableAdmin/DeleteAuthorizedView",
690
+ request_serializer=bigtable_table_admin.DeleteAuthorizedViewRequest.serialize,
691
+ response_deserializer=empty_pb2.Empty.FromString,
692
+ )
693
+ return self._stubs["delete_authorized_view"]
694
+
695
+ @property
696
+ def modify_column_families(
697
+ self,
698
+ ) -> Callable[[bigtable_table_admin.ModifyColumnFamiliesRequest], table.Table]:
699
+ r"""Return a callable for the modify column families method over gRPC.
700
+
701
+ Performs a series of column family modifications on
702
+ the specified table. Either all or none of the
703
+ modifications will occur before this method returns, but
704
+ data requests received prior to that point may see a
705
+ table where only some modifications have taken effect.
706
+
707
+ Returns:
708
+ Callable[[~.ModifyColumnFamiliesRequest],
709
+ ~.Table]:
710
+ A function that, when called, will call the underlying RPC
711
+ on the server.
712
+ """
713
+ # Generate a "stub function" on-the-fly which will actually make
714
+ # the request.
715
+ # gRPC handles serialization and deserialization, so we just need
716
+ # to pass in the functions for each.
717
+ if "modify_column_families" not in self._stubs:
718
+ self._stubs["modify_column_families"] = self._logged_channel.unary_unary(
719
+ "/google.bigtable.admin.v2.BigtableTableAdmin/ModifyColumnFamilies",
720
+ request_serializer=bigtable_table_admin.ModifyColumnFamiliesRequest.serialize,
721
+ response_deserializer=table.Table.deserialize,
722
+ )
723
+ return self._stubs["modify_column_families"]
724
+
725
+ @property
726
+ def drop_row_range(
727
+ self,
728
+ ) -> Callable[[bigtable_table_admin.DropRowRangeRequest], empty_pb2.Empty]:
729
+ r"""Return a callable for the drop row range method over gRPC.
730
+
731
+ Permanently drop/delete a row range from a specified
732
+ table. The request can specify whether to delete all
733
+ rows in a table, or only those that match a particular
734
+ prefix.
735
+
736
+ Returns:
737
+ Callable[[~.DropRowRangeRequest],
738
+ ~.Empty]:
739
+ A function that, when called, will call the underlying RPC
740
+ on the server.
741
+ """
742
+ # Generate a "stub function" on-the-fly which will actually make
743
+ # the request.
744
+ # gRPC handles serialization and deserialization, so we just need
745
+ # to pass in the functions for each.
746
+ if "drop_row_range" not in self._stubs:
747
+ self._stubs["drop_row_range"] = self._logged_channel.unary_unary(
748
+ "/google.bigtable.admin.v2.BigtableTableAdmin/DropRowRange",
749
+ request_serializer=bigtable_table_admin.DropRowRangeRequest.serialize,
750
+ response_deserializer=empty_pb2.Empty.FromString,
751
+ )
752
+ return self._stubs["drop_row_range"]
753
+
754
+ @property
755
+ def generate_consistency_token(
756
+ self,
757
+ ) -> Callable[
758
+ [bigtable_table_admin.GenerateConsistencyTokenRequest],
759
+ bigtable_table_admin.GenerateConsistencyTokenResponse,
760
+ ]:
761
+ r"""Return a callable for the generate consistency token method over gRPC.
762
+
763
+ Generates a consistency token for a Table, which can
764
+ be used in CheckConsistency to check whether mutations
765
+ to the table that finished before this call started have
766
+ been replicated. The tokens will be available for 90
767
+ days.
768
+
769
+ Returns:
770
+ Callable[[~.GenerateConsistencyTokenRequest],
771
+ ~.GenerateConsistencyTokenResponse]:
772
+ A function that, when called, will call the underlying RPC
773
+ on the server.
774
+ """
775
+ # Generate a "stub function" on-the-fly which will actually make
776
+ # the request.
777
+ # gRPC handles serialization and deserialization, so we just need
778
+ # to pass in the functions for each.
779
+ if "generate_consistency_token" not in self._stubs:
780
+ self._stubs[
781
+ "generate_consistency_token"
782
+ ] = self._logged_channel.unary_unary(
783
+ "/google.bigtable.admin.v2.BigtableTableAdmin/GenerateConsistencyToken",
784
+ request_serializer=bigtable_table_admin.GenerateConsistencyTokenRequest.serialize,
785
+ response_deserializer=bigtable_table_admin.GenerateConsistencyTokenResponse.deserialize,
786
+ )
787
+ return self._stubs["generate_consistency_token"]
788
+
789
+ @property
790
+ def check_consistency(
791
+ self,
792
+ ) -> Callable[
793
+ [bigtable_table_admin.CheckConsistencyRequest],
794
+ bigtable_table_admin.CheckConsistencyResponse,
795
+ ]:
796
+ r"""Return a callable for the check consistency method over gRPC.
797
+
798
+ Checks replication consistency based on a consistency
799
+ token, that is, if replication has caught up based on
800
+ the conditions specified in the token and the check
801
+ request.
802
+
803
+ Returns:
804
+ Callable[[~.CheckConsistencyRequest],
805
+ ~.CheckConsistencyResponse]:
806
+ A function that, when called, will call the underlying RPC
807
+ on the server.
808
+ """
809
+ # Generate a "stub function" on-the-fly which will actually make
810
+ # the request.
811
+ # gRPC handles serialization and deserialization, so we just need
812
+ # to pass in the functions for each.
813
+ if "check_consistency" not in self._stubs:
814
+ self._stubs["check_consistency"] = self._logged_channel.unary_unary(
815
+ "/google.bigtable.admin.v2.BigtableTableAdmin/CheckConsistency",
816
+ request_serializer=bigtable_table_admin.CheckConsistencyRequest.serialize,
817
+ response_deserializer=bigtable_table_admin.CheckConsistencyResponse.deserialize,
818
+ )
819
+ return self._stubs["check_consistency"]
820
+
821
+ @property
822
+ def snapshot_table(
823
+ self,
824
+ ) -> Callable[
825
+ [bigtable_table_admin.SnapshotTableRequest], operations_pb2.Operation
826
+ ]:
827
+ r"""Return a callable for the snapshot table method over gRPC.
828
+
829
+ Creates a new snapshot in the specified cluster from
830
+ the specified source table. The cluster and the table
831
+ must be in the same instance.
832
+
833
+ Note: This is a private alpha release of Cloud Bigtable
834
+ snapshots. This feature is not currently available to
835
+ most Cloud Bigtable customers. This feature might be
836
+ changed in backward-incompatible ways and is not
837
+ recommended for production use. It is not subject to any
838
+ SLA or deprecation policy.
839
+
840
+ Returns:
841
+ Callable[[~.SnapshotTableRequest],
842
+ ~.Operation]:
843
+ A function that, when called, will call the underlying RPC
844
+ on the server.
845
+ """
846
+ # Generate a "stub function" on-the-fly which will actually make
847
+ # the request.
848
+ # gRPC handles serialization and deserialization, so we just need
849
+ # to pass in the functions for each.
850
+ if "snapshot_table" not in self._stubs:
851
+ self._stubs["snapshot_table"] = self._logged_channel.unary_unary(
852
+ "/google.bigtable.admin.v2.BigtableTableAdmin/SnapshotTable",
853
+ request_serializer=bigtable_table_admin.SnapshotTableRequest.serialize,
854
+ response_deserializer=operations_pb2.Operation.FromString,
855
+ )
856
+ return self._stubs["snapshot_table"]
857
+
858
+ @property
859
+ def get_snapshot(
860
+ self,
861
+ ) -> Callable[[bigtable_table_admin.GetSnapshotRequest], table.Snapshot]:
862
+ r"""Return a callable for the get snapshot method over gRPC.
863
+
864
+ Gets metadata information about the specified
865
+ snapshot.
866
+ Note: This is a private alpha release of Cloud Bigtable
867
+ snapshots. This feature is not currently available to
868
+ most Cloud Bigtable customers. This feature might be
869
+ changed in backward-incompatible ways and is not
870
+ recommended for production use. It is not subject to any
871
+ SLA or deprecation policy.
872
+
873
+ Returns:
874
+ Callable[[~.GetSnapshotRequest],
875
+ ~.Snapshot]:
876
+ A function that, when called, will call the underlying RPC
877
+ on the server.
878
+ """
879
+ # Generate a "stub function" on-the-fly which will actually make
880
+ # the request.
881
+ # gRPC handles serialization and deserialization, so we just need
882
+ # to pass in the functions for each.
883
+ if "get_snapshot" not in self._stubs:
884
+ self._stubs["get_snapshot"] = self._logged_channel.unary_unary(
885
+ "/google.bigtable.admin.v2.BigtableTableAdmin/GetSnapshot",
886
+ request_serializer=bigtable_table_admin.GetSnapshotRequest.serialize,
887
+ response_deserializer=table.Snapshot.deserialize,
888
+ )
889
+ return self._stubs["get_snapshot"]
890
+
891
+ @property
892
+ def list_snapshots(
893
+ self,
894
+ ) -> Callable[
895
+ [bigtable_table_admin.ListSnapshotsRequest],
896
+ bigtable_table_admin.ListSnapshotsResponse,
897
+ ]:
898
+ r"""Return a callable for the list snapshots method over gRPC.
899
+
900
+ Lists all snapshots associated with the specified
901
+ cluster.
902
+ Note: This is a private alpha release of Cloud Bigtable
903
+ snapshots. This feature is not currently available to
904
+ most Cloud Bigtable customers. This feature might be
905
+ changed in backward-incompatible ways and is not
906
+ recommended for production use. It is not subject to any
907
+ SLA or deprecation policy.
908
+
909
+ Returns:
910
+ Callable[[~.ListSnapshotsRequest],
911
+ ~.ListSnapshotsResponse]:
912
+ A function that, when called, will call the underlying RPC
913
+ on the server.
914
+ """
915
+ # Generate a "stub function" on-the-fly which will actually make
916
+ # the request.
917
+ # gRPC handles serialization and deserialization, so we just need
918
+ # to pass in the functions for each.
919
+ if "list_snapshots" not in self._stubs:
920
+ self._stubs["list_snapshots"] = self._logged_channel.unary_unary(
921
+ "/google.bigtable.admin.v2.BigtableTableAdmin/ListSnapshots",
922
+ request_serializer=bigtable_table_admin.ListSnapshotsRequest.serialize,
923
+ response_deserializer=bigtable_table_admin.ListSnapshotsResponse.deserialize,
924
+ )
925
+ return self._stubs["list_snapshots"]
926
+
927
+ @property
928
+ def delete_snapshot(
929
+ self,
930
+ ) -> Callable[[bigtable_table_admin.DeleteSnapshotRequest], empty_pb2.Empty]:
931
+ r"""Return a callable for the delete snapshot method over gRPC.
932
+
933
+ Permanently deletes the specified snapshot.
934
+
935
+ Note: This is a private alpha release of Cloud Bigtable
936
+ snapshots. This feature is not currently available to
937
+ most Cloud Bigtable customers. This feature might be
938
+ changed in backward-incompatible ways and is not
939
+ recommended for production use. It is not subject to any
940
+ SLA or deprecation policy.
941
+
942
+ Returns:
943
+ Callable[[~.DeleteSnapshotRequest],
944
+ ~.Empty]:
945
+ A function that, when called, will call the underlying RPC
946
+ on the server.
947
+ """
948
+ # Generate a "stub function" on-the-fly which will actually make
949
+ # the request.
950
+ # gRPC handles serialization and deserialization, so we just need
951
+ # to pass in the functions for each.
952
+ if "delete_snapshot" not in self._stubs:
953
+ self._stubs["delete_snapshot"] = self._logged_channel.unary_unary(
954
+ "/google.bigtable.admin.v2.BigtableTableAdmin/DeleteSnapshot",
955
+ request_serializer=bigtable_table_admin.DeleteSnapshotRequest.serialize,
956
+ response_deserializer=empty_pb2.Empty.FromString,
957
+ )
958
+ return self._stubs["delete_snapshot"]
959
+
960
+ @property
961
+ def create_backup(
962
+ self,
963
+ ) -> Callable[[bigtable_table_admin.CreateBackupRequest], operations_pb2.Operation]:
964
+ r"""Return a callable for the create backup method over gRPC.
965
+
966
+ Starts creating a new Cloud Bigtable Backup. The returned backup
967
+ [long-running operation][google.longrunning.Operation] can be
968
+ used to track creation of the backup. The
969
+ [metadata][google.longrunning.Operation.metadata] field type is
970
+ [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata].
971
+ The [response][google.longrunning.Operation.response] field type
972
+ is [Backup][google.bigtable.admin.v2.Backup], if successful.
973
+ Cancelling the returned operation will stop the creation and
974
+ delete the backup.
975
+
976
+ Returns:
977
+ Callable[[~.CreateBackupRequest],
978
+ ~.Operation]:
979
+ A function that, when called, will call the underlying RPC
980
+ on the server.
981
+ """
982
+ # Generate a "stub function" on-the-fly which will actually make
983
+ # the request.
984
+ # gRPC handles serialization and deserialization, so we just need
985
+ # to pass in the functions for each.
986
+ if "create_backup" not in self._stubs:
987
+ self._stubs["create_backup"] = self._logged_channel.unary_unary(
988
+ "/google.bigtable.admin.v2.BigtableTableAdmin/CreateBackup",
989
+ request_serializer=bigtable_table_admin.CreateBackupRequest.serialize,
990
+ response_deserializer=operations_pb2.Operation.FromString,
991
+ )
992
+ return self._stubs["create_backup"]
993
+
994
+ @property
995
+ def get_backup(
996
+ self,
997
+ ) -> Callable[[bigtable_table_admin.GetBackupRequest], table.Backup]:
998
+ r"""Return a callable for the get backup method over gRPC.
999
+
1000
+ Gets metadata on a pending or completed Cloud
1001
+ Bigtable Backup.
1002
+
1003
+ Returns:
1004
+ Callable[[~.GetBackupRequest],
1005
+ ~.Backup]:
1006
+ A function that, when called, will call the underlying RPC
1007
+ on the server.
1008
+ """
1009
+ # Generate a "stub function" on-the-fly which will actually make
1010
+ # the request.
1011
+ # gRPC handles serialization and deserialization, so we just need
1012
+ # to pass in the functions for each.
1013
+ if "get_backup" not in self._stubs:
1014
+ self._stubs["get_backup"] = self._logged_channel.unary_unary(
1015
+ "/google.bigtable.admin.v2.BigtableTableAdmin/GetBackup",
1016
+ request_serializer=bigtable_table_admin.GetBackupRequest.serialize,
1017
+ response_deserializer=table.Backup.deserialize,
1018
+ )
1019
+ return self._stubs["get_backup"]
1020
+
1021
+ @property
1022
+ def update_backup(
1023
+ self,
1024
+ ) -> Callable[[bigtable_table_admin.UpdateBackupRequest], table.Backup]:
1025
+ r"""Return a callable for the update backup method over gRPC.
1026
+
1027
+ Updates a pending or completed Cloud Bigtable Backup.
1028
+
1029
+ Returns:
1030
+ Callable[[~.UpdateBackupRequest],
1031
+ ~.Backup]:
1032
+ A function that, when called, will call the underlying RPC
1033
+ on the server.
1034
+ """
1035
+ # Generate a "stub function" on-the-fly which will actually make
1036
+ # the request.
1037
+ # gRPC handles serialization and deserialization, so we just need
1038
+ # to pass in the functions for each.
1039
+ if "update_backup" not in self._stubs:
1040
+ self._stubs["update_backup"] = self._logged_channel.unary_unary(
1041
+ "/google.bigtable.admin.v2.BigtableTableAdmin/UpdateBackup",
1042
+ request_serializer=bigtable_table_admin.UpdateBackupRequest.serialize,
1043
+ response_deserializer=table.Backup.deserialize,
1044
+ )
1045
+ return self._stubs["update_backup"]
1046
+
1047
+ @property
1048
+ def delete_backup(
1049
+ self,
1050
+ ) -> Callable[[bigtable_table_admin.DeleteBackupRequest], empty_pb2.Empty]:
1051
+ r"""Return a callable for the delete backup method over gRPC.
1052
+
1053
+ Deletes a pending or completed Cloud Bigtable backup.
1054
+
1055
+ Returns:
1056
+ Callable[[~.DeleteBackupRequest],
1057
+ ~.Empty]:
1058
+ A function that, when called, will call the underlying RPC
1059
+ on the server.
1060
+ """
1061
+ # Generate a "stub function" on-the-fly which will actually make
1062
+ # the request.
1063
+ # gRPC handles serialization and deserialization, so we just need
1064
+ # to pass in the functions for each.
1065
+ if "delete_backup" not in self._stubs:
1066
+ self._stubs["delete_backup"] = self._logged_channel.unary_unary(
1067
+ "/google.bigtable.admin.v2.BigtableTableAdmin/DeleteBackup",
1068
+ request_serializer=bigtable_table_admin.DeleteBackupRequest.serialize,
1069
+ response_deserializer=empty_pb2.Empty.FromString,
1070
+ )
1071
+ return self._stubs["delete_backup"]
1072
+
1073
+ @property
1074
+ def list_backups(
1075
+ self,
1076
+ ) -> Callable[
1077
+ [bigtable_table_admin.ListBackupsRequest],
1078
+ bigtable_table_admin.ListBackupsResponse,
1079
+ ]:
1080
+ r"""Return a callable for the list backups method over gRPC.
1081
+
1082
+ Lists Cloud Bigtable backups. Returns both completed
1083
+ and pending backups.
1084
+
1085
+ Returns:
1086
+ Callable[[~.ListBackupsRequest],
1087
+ ~.ListBackupsResponse]:
1088
+ A function that, when called, will call the underlying RPC
1089
+ on the server.
1090
+ """
1091
+ # Generate a "stub function" on-the-fly which will actually make
1092
+ # the request.
1093
+ # gRPC handles serialization and deserialization, so we just need
1094
+ # to pass in the functions for each.
1095
+ if "list_backups" not in self._stubs:
1096
+ self._stubs["list_backups"] = self._logged_channel.unary_unary(
1097
+ "/google.bigtable.admin.v2.BigtableTableAdmin/ListBackups",
1098
+ request_serializer=bigtable_table_admin.ListBackupsRequest.serialize,
1099
+ response_deserializer=bigtable_table_admin.ListBackupsResponse.deserialize,
1100
+ )
1101
+ return self._stubs["list_backups"]
1102
+
1103
+ @property
1104
+ def restore_table(
1105
+ self,
1106
+ ) -> Callable[[bigtable_table_admin.RestoreTableRequest], operations_pb2.Operation]:
1107
+ r"""Return a callable for the restore table method over gRPC.
1108
+
1109
+ Create a new table by restoring from a completed backup. The
1110
+ returned table [long-running
1111
+ operation][google.longrunning.Operation] can be used to track
1112
+ the progress of the operation, and to cancel it. The
1113
+ [metadata][google.longrunning.Operation.metadata] field type is
1114
+ [RestoreTableMetadata][google.bigtable.admin.v2.RestoreTableMetadata].
1115
+ The [response][google.longrunning.Operation.response] type is
1116
+ [Table][google.bigtable.admin.v2.Table], if successful.
1117
+
1118
+ Returns:
1119
+ Callable[[~.RestoreTableRequest],
1120
+ ~.Operation]:
1121
+ A function that, when called, will call the underlying RPC
1122
+ on the server.
1123
+ """
1124
+ # Generate a "stub function" on-the-fly which will actually make
1125
+ # the request.
1126
+ # gRPC handles serialization and deserialization, so we just need
1127
+ # to pass in the functions for each.
1128
+ if "restore_table" not in self._stubs:
1129
+ self._stubs["restore_table"] = self._logged_channel.unary_unary(
1130
+ "/google.bigtable.admin.v2.BigtableTableAdmin/RestoreTable",
1131
+ request_serializer=bigtable_table_admin.RestoreTableRequest.serialize,
1132
+ response_deserializer=operations_pb2.Operation.FromString,
1133
+ )
1134
+ return self._stubs["restore_table"]
1135
+
1136
+ @property
1137
+ def copy_backup(
1138
+ self,
1139
+ ) -> Callable[[bigtable_table_admin.CopyBackupRequest], operations_pb2.Operation]:
1140
+ r"""Return a callable for the copy backup method over gRPC.
1141
+
1142
+ Copy a Cloud Bigtable backup to a new backup in the
1143
+ destination cluster located in the destination instance
1144
+ and project.
1145
+
1146
+ Returns:
1147
+ Callable[[~.CopyBackupRequest],
1148
+ ~.Operation]:
1149
+ A function that, when called, will call the underlying RPC
1150
+ on the server.
1151
+ """
1152
+ # Generate a "stub function" on-the-fly which will actually make
1153
+ # the request.
1154
+ # gRPC handles serialization and deserialization, so we just need
1155
+ # to pass in the functions for each.
1156
+ if "copy_backup" not in self._stubs:
1157
+ self._stubs["copy_backup"] = self._logged_channel.unary_unary(
1158
+ "/google.bigtable.admin.v2.BigtableTableAdmin/CopyBackup",
1159
+ request_serializer=bigtable_table_admin.CopyBackupRequest.serialize,
1160
+ response_deserializer=operations_pb2.Operation.FromString,
1161
+ )
1162
+ return self._stubs["copy_backup"]
1163
+
1164
+ @property
1165
+ def get_iam_policy(
1166
+ self,
1167
+ ) -> Callable[[iam_policy_pb2.GetIamPolicyRequest], policy_pb2.Policy]:
1168
+ r"""Return a callable for the get iam policy method over gRPC.
1169
+
1170
+ Gets the access control policy for a Table or Backup
1171
+ resource. Returns an empty policy if the resource exists
1172
+ but does not have a policy set.
1173
+
1174
+ Returns:
1175
+ Callable[[~.GetIamPolicyRequest],
1176
+ ~.Policy]:
1177
+ A function that, when called, will call the underlying RPC
1178
+ on the server.
1179
+ """
1180
+ # Generate a "stub function" on-the-fly which will actually make
1181
+ # the request.
1182
+ # gRPC handles serialization and deserialization, so we just need
1183
+ # to pass in the functions for each.
1184
+ if "get_iam_policy" not in self._stubs:
1185
+ self._stubs["get_iam_policy"] = self._logged_channel.unary_unary(
1186
+ "/google.bigtable.admin.v2.BigtableTableAdmin/GetIamPolicy",
1187
+ request_serializer=iam_policy_pb2.GetIamPolicyRequest.SerializeToString,
1188
+ response_deserializer=policy_pb2.Policy.FromString,
1189
+ )
1190
+ return self._stubs["get_iam_policy"]
1191
+
1192
+ @property
1193
+ def set_iam_policy(
1194
+ self,
1195
+ ) -> Callable[[iam_policy_pb2.SetIamPolicyRequest], policy_pb2.Policy]:
1196
+ r"""Return a callable for the set iam policy method over gRPC.
1197
+
1198
+ Sets the access control policy on a Table or Backup
1199
+ resource. Replaces any existing policy.
1200
+
1201
+ Returns:
1202
+ Callable[[~.SetIamPolicyRequest],
1203
+ ~.Policy]:
1204
+ A function that, when called, will call the underlying RPC
1205
+ on the server.
1206
+ """
1207
+ # Generate a "stub function" on-the-fly which will actually make
1208
+ # the request.
1209
+ # gRPC handles serialization and deserialization, so we just need
1210
+ # to pass in the functions for each.
1211
+ if "set_iam_policy" not in self._stubs:
1212
+ self._stubs["set_iam_policy"] = self._logged_channel.unary_unary(
1213
+ "/google.bigtable.admin.v2.BigtableTableAdmin/SetIamPolicy",
1214
+ request_serializer=iam_policy_pb2.SetIamPolicyRequest.SerializeToString,
1215
+ response_deserializer=policy_pb2.Policy.FromString,
1216
+ )
1217
+ return self._stubs["set_iam_policy"]
1218
+
1219
+ @property
1220
+ def test_iam_permissions(
1221
+ self,
1222
+ ) -> Callable[
1223
+ [iam_policy_pb2.TestIamPermissionsRequest],
1224
+ iam_policy_pb2.TestIamPermissionsResponse,
1225
+ ]:
1226
+ r"""Return a callable for the test iam permissions method over gRPC.
1227
+
1228
+ Returns permissions that the caller has on the
1229
+ specified Table or Backup resource.
1230
+
1231
+ Returns:
1232
+ Callable[[~.TestIamPermissionsRequest],
1233
+ ~.TestIamPermissionsResponse]:
1234
+ A function that, when called, will call the underlying RPC
1235
+ on the server.
1236
+ """
1237
+ # Generate a "stub function" on-the-fly which will actually make
1238
+ # the request.
1239
+ # gRPC handles serialization and deserialization, so we just need
1240
+ # to pass in the functions for each.
1241
+ if "test_iam_permissions" not in self._stubs:
1242
+ self._stubs["test_iam_permissions"] = self._logged_channel.unary_unary(
1243
+ "/google.bigtable.admin.v2.BigtableTableAdmin/TestIamPermissions",
1244
+ request_serializer=iam_policy_pb2.TestIamPermissionsRequest.SerializeToString,
1245
+ response_deserializer=iam_policy_pb2.TestIamPermissionsResponse.FromString,
1246
+ )
1247
+ return self._stubs["test_iam_permissions"]
1248
+
1249
+ def close(self):
1250
+ self._logged_channel.close()
1251
+
1252
+ @property
1253
+ def kind(self) -> str:
1254
+ return "grpc"
1255
+
1256
+
1257
+ __all__ = ("BigtableTableAdminGrpcTransport",)