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,3472 @@
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 logging as std_logging
17
+ from collections import OrderedDict
18
+ import re
19
+ from typing import (
20
+ Dict,
21
+ Callable,
22
+ Mapping,
23
+ MutableMapping,
24
+ MutableSequence,
25
+ Optional,
26
+ Sequence,
27
+ Tuple,
28
+ Type,
29
+ Union,
30
+ )
31
+
32
+ from google.cloud.bigtable_admin_v2 import gapic_version as package_version
33
+
34
+ from google.api_core.client_options import ClientOptions
35
+ from google.api_core import exceptions as core_exceptions
36
+ from google.api_core import gapic_v1
37
+ from google.api_core import retry_async as retries
38
+ from google.auth import credentials as ga_credentials # type: ignore
39
+ from google.oauth2 import service_account # type: ignore
40
+
41
+
42
+ try:
43
+ OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault, None]
44
+ except AttributeError: # pragma: NO COVER
45
+ OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore
46
+
47
+ from google.api_core import operation # type: ignore
48
+ from google.api_core import operation_async # type: ignore
49
+ from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import pagers
50
+ from google.cloud.bigtable_admin_v2.types import bigtable_table_admin
51
+ from google.cloud.bigtable_admin_v2.types import table
52
+ from google.cloud.bigtable_admin_v2.types import table as gba_table
53
+ from google.cloud.bigtable_admin_v2.types import types
54
+ from google.iam.v1 import iam_policy_pb2 # type: ignore
55
+ from google.iam.v1 import policy_pb2 # type: ignore
56
+ from google.protobuf import field_mask_pb2 # type: ignore
57
+ from google.protobuf import timestamp_pb2 # type: ignore
58
+ from .transports.base import BigtableTableAdminTransport, DEFAULT_CLIENT_INFO
59
+ from .transports.grpc_asyncio import BigtableTableAdminGrpcAsyncIOTransport
60
+ from .client import BigtableTableAdminClient
61
+
62
+ try:
63
+ from google.api_core import client_logging # type: ignore
64
+
65
+ CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER
66
+ except ImportError: # pragma: NO COVER
67
+ CLIENT_LOGGING_SUPPORTED = False
68
+
69
+ _LOGGER = std_logging.getLogger(__name__)
70
+
71
+
72
+ class BigtableTableAdminAsyncClient:
73
+ """Service for creating, configuring, and deleting Cloud
74
+ Bigtable tables.
75
+
76
+ Provides access to the table schemas only, not the data stored
77
+ within the tables.
78
+ """
79
+
80
+ _client: BigtableTableAdminClient
81
+
82
+ # Copy defaults from the synchronous client for use here.
83
+ # Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead.
84
+ DEFAULT_ENDPOINT = BigtableTableAdminClient.DEFAULT_ENDPOINT
85
+ DEFAULT_MTLS_ENDPOINT = BigtableTableAdminClient.DEFAULT_MTLS_ENDPOINT
86
+ _DEFAULT_ENDPOINT_TEMPLATE = BigtableTableAdminClient._DEFAULT_ENDPOINT_TEMPLATE
87
+ _DEFAULT_UNIVERSE = BigtableTableAdminClient._DEFAULT_UNIVERSE
88
+
89
+ authorized_view_path = staticmethod(BigtableTableAdminClient.authorized_view_path)
90
+ parse_authorized_view_path = staticmethod(
91
+ BigtableTableAdminClient.parse_authorized_view_path
92
+ )
93
+ backup_path = staticmethod(BigtableTableAdminClient.backup_path)
94
+ parse_backup_path = staticmethod(BigtableTableAdminClient.parse_backup_path)
95
+ cluster_path = staticmethod(BigtableTableAdminClient.cluster_path)
96
+ parse_cluster_path = staticmethod(BigtableTableAdminClient.parse_cluster_path)
97
+ crypto_key_version_path = staticmethod(
98
+ BigtableTableAdminClient.crypto_key_version_path
99
+ )
100
+ parse_crypto_key_version_path = staticmethod(
101
+ BigtableTableAdminClient.parse_crypto_key_version_path
102
+ )
103
+ instance_path = staticmethod(BigtableTableAdminClient.instance_path)
104
+ parse_instance_path = staticmethod(BigtableTableAdminClient.parse_instance_path)
105
+ snapshot_path = staticmethod(BigtableTableAdminClient.snapshot_path)
106
+ parse_snapshot_path = staticmethod(BigtableTableAdminClient.parse_snapshot_path)
107
+ table_path = staticmethod(BigtableTableAdminClient.table_path)
108
+ parse_table_path = staticmethod(BigtableTableAdminClient.parse_table_path)
109
+ common_billing_account_path = staticmethod(
110
+ BigtableTableAdminClient.common_billing_account_path
111
+ )
112
+ parse_common_billing_account_path = staticmethod(
113
+ BigtableTableAdminClient.parse_common_billing_account_path
114
+ )
115
+ common_folder_path = staticmethod(BigtableTableAdminClient.common_folder_path)
116
+ parse_common_folder_path = staticmethod(
117
+ BigtableTableAdminClient.parse_common_folder_path
118
+ )
119
+ common_organization_path = staticmethod(
120
+ BigtableTableAdminClient.common_organization_path
121
+ )
122
+ parse_common_organization_path = staticmethod(
123
+ BigtableTableAdminClient.parse_common_organization_path
124
+ )
125
+ common_project_path = staticmethod(BigtableTableAdminClient.common_project_path)
126
+ parse_common_project_path = staticmethod(
127
+ BigtableTableAdminClient.parse_common_project_path
128
+ )
129
+ common_location_path = staticmethod(BigtableTableAdminClient.common_location_path)
130
+ parse_common_location_path = staticmethod(
131
+ BigtableTableAdminClient.parse_common_location_path
132
+ )
133
+
134
+ @classmethod
135
+ def from_service_account_info(cls, info: dict, *args, **kwargs):
136
+ """Creates an instance of this client using the provided credentials
137
+ info.
138
+
139
+ Args:
140
+ info (dict): The service account private key info.
141
+ args: Additional arguments to pass to the constructor.
142
+ kwargs: Additional arguments to pass to the constructor.
143
+
144
+ Returns:
145
+ BigtableTableAdminAsyncClient: The constructed client.
146
+ """
147
+ return BigtableTableAdminClient.from_service_account_info.__func__(BigtableTableAdminAsyncClient, info, *args, **kwargs) # type: ignore
148
+
149
+ @classmethod
150
+ def from_service_account_file(cls, filename: str, *args, **kwargs):
151
+ """Creates an instance of this client using the provided credentials
152
+ file.
153
+
154
+ Args:
155
+ filename (str): The path to the service account private key json
156
+ file.
157
+ args: Additional arguments to pass to the constructor.
158
+ kwargs: Additional arguments to pass to the constructor.
159
+
160
+ Returns:
161
+ BigtableTableAdminAsyncClient: The constructed client.
162
+ """
163
+ return BigtableTableAdminClient.from_service_account_file.__func__(BigtableTableAdminAsyncClient, filename, *args, **kwargs) # type: ignore
164
+
165
+ from_service_account_json = from_service_account_file
166
+
167
+ @classmethod
168
+ def get_mtls_endpoint_and_cert_source(
169
+ cls, client_options: Optional[ClientOptions] = None
170
+ ):
171
+ """Return the API endpoint and client cert source for mutual TLS.
172
+
173
+ The client cert source is determined in the following order:
174
+ (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the
175
+ client cert source is None.
176
+ (2) if `client_options.client_cert_source` is provided, use the provided one; if the
177
+ default client cert source exists, use the default one; otherwise the client cert
178
+ source is None.
179
+
180
+ The API endpoint is determined in the following order:
181
+ (1) if `client_options.api_endpoint` if provided, use the provided one.
182
+ (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the
183
+ default mTLS endpoint; if the environment variable is "never", use the default API
184
+ endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise
185
+ use the default API endpoint.
186
+
187
+ More details can be found at https://google.aip.dev/auth/4114.
188
+
189
+ Args:
190
+ client_options (google.api_core.client_options.ClientOptions): Custom options for the
191
+ client. Only the `api_endpoint` and `client_cert_source` properties may be used
192
+ in this method.
193
+
194
+ Returns:
195
+ Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the
196
+ client cert source to use.
197
+
198
+ Raises:
199
+ google.auth.exceptions.MutualTLSChannelError: If any errors happen.
200
+ """
201
+ return BigtableTableAdminClient.get_mtls_endpoint_and_cert_source(client_options) # type: ignore
202
+
203
+ @property
204
+ def transport(self) -> BigtableTableAdminTransport:
205
+ """Returns the transport used by the client instance.
206
+
207
+ Returns:
208
+ BigtableTableAdminTransport: The transport used by the client instance.
209
+ """
210
+ return self._client.transport
211
+
212
+ @property
213
+ def api_endpoint(self):
214
+ """Return the API endpoint used by the client instance.
215
+
216
+ Returns:
217
+ str: The API endpoint used by the client instance.
218
+ """
219
+ return self._client._api_endpoint
220
+
221
+ @property
222
+ def universe_domain(self) -> str:
223
+ """Return the universe domain used by the client instance.
224
+
225
+ Returns:
226
+ str: The universe domain used
227
+ by the client instance.
228
+ """
229
+ return self._client._universe_domain
230
+
231
+ get_transport_class = BigtableTableAdminClient.get_transport_class
232
+
233
+ def __init__(
234
+ self,
235
+ *,
236
+ credentials: Optional[ga_credentials.Credentials] = None,
237
+ transport: Optional[
238
+ Union[
239
+ str,
240
+ BigtableTableAdminTransport,
241
+ Callable[..., BigtableTableAdminTransport],
242
+ ]
243
+ ] = "grpc_asyncio",
244
+ client_options: Optional[ClientOptions] = None,
245
+ client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
246
+ ) -> None:
247
+ """Instantiates the bigtable table admin async client.
248
+
249
+ Args:
250
+ credentials (Optional[google.auth.credentials.Credentials]): The
251
+ authorization credentials to attach to requests. These
252
+ credentials identify the application to the service; if none
253
+ are specified, the client will attempt to ascertain the
254
+ credentials from the environment.
255
+ transport (Optional[Union[str,BigtableTableAdminTransport,Callable[..., BigtableTableAdminTransport]]]):
256
+ The transport to use, or a Callable that constructs and returns a new transport to use.
257
+ If a Callable is given, it will be called with the same set of initialization
258
+ arguments as used in the BigtableTableAdminTransport constructor.
259
+ If set to None, a transport is chosen automatically.
260
+ client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]):
261
+ Custom options for the client.
262
+
263
+ 1. The ``api_endpoint`` property can be used to override the
264
+ default endpoint provided by the client when ``transport`` is
265
+ not explicitly provided. Only if this property is not set and
266
+ ``transport`` was not explicitly provided, the endpoint is
267
+ determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment
268
+ variable, which have one of the following values:
269
+ "always" (always use the default mTLS endpoint), "never" (always
270
+ use the default regular endpoint) and "auto" (auto-switch to the
271
+ default mTLS endpoint if client certificate is present; this is
272
+ the default value).
273
+
274
+ 2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
275
+ is "true", then the ``client_cert_source`` property can be used
276
+ to provide a client certificate for mTLS transport. If
277
+ not provided, the default SSL client certificate will be used if
278
+ present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not
279
+ set, no client certificate will be used.
280
+
281
+ 3. The ``universe_domain`` property can be used to override the
282
+ default "googleapis.com" universe. Note that ``api_endpoint``
283
+ property still takes precedence; and ``universe_domain`` is
284
+ currently not supported for mTLS.
285
+
286
+ client_info (google.api_core.gapic_v1.client_info.ClientInfo):
287
+ The client info used to send a user-agent string along with
288
+ API requests. If ``None``, then default info will be used.
289
+ Generally, you only need to set this if you're developing
290
+ your own client library.
291
+
292
+ Raises:
293
+ google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
294
+ creation failed for any reason.
295
+ """
296
+ self._client = BigtableTableAdminClient(
297
+ credentials=credentials,
298
+ transport=transport,
299
+ client_options=client_options,
300
+ client_info=client_info,
301
+ )
302
+
303
+ if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
304
+ std_logging.DEBUG
305
+ ): # pragma: NO COVER
306
+ _LOGGER.debug(
307
+ "Created client `google.bigtable.admin_v2.BigtableTableAdminAsyncClient`.",
308
+ extra={
309
+ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin",
310
+ "universeDomain": getattr(
311
+ self._client._transport._credentials, "universe_domain", ""
312
+ ),
313
+ "credentialsType": f"{type(self._client._transport._credentials).__module__}.{type(self._client._transport._credentials).__qualname__}",
314
+ "credentialsInfo": getattr(
315
+ self.transport._credentials, "get_cred_info", lambda: None
316
+ )(),
317
+ }
318
+ if hasattr(self._client._transport, "_credentials")
319
+ else {
320
+ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin",
321
+ "credentialsType": None,
322
+ },
323
+ )
324
+
325
+ async def create_table(
326
+ self,
327
+ request: Optional[Union[bigtable_table_admin.CreateTableRequest, dict]] = None,
328
+ *,
329
+ parent: Optional[str] = None,
330
+ table_id: Optional[str] = None,
331
+ table: Optional[gba_table.Table] = None,
332
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
333
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
334
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
335
+ ) -> gba_table.Table:
336
+ r"""Creates a new table in the specified instance.
337
+ The table can be created with a full set of initial
338
+ column families, specified in the request.
339
+
340
+ Args:
341
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateTableRequest, dict]]):
342
+ The request object. Request message for
343
+ [google.bigtable.admin.v2.BigtableTableAdmin.CreateTable][google.bigtable.admin.v2.BigtableTableAdmin.CreateTable]
344
+ parent (:class:`str`):
345
+ Required. The unique name of the instance in which to
346
+ create the table. Values are of the form
347
+ ``projects/{project}/instances/{instance}``.
348
+
349
+ This corresponds to the ``parent`` field
350
+ on the ``request`` instance; if ``request`` is provided, this
351
+ should not be set.
352
+ table_id (:class:`str`):
353
+ Required. The name by which the new table should be
354
+ referred to within the parent instance, e.g., ``foobar``
355
+ rather than ``{parent}/tables/foobar``. Maximum 50
356
+ characters.
357
+
358
+ This corresponds to the ``table_id`` field
359
+ on the ``request`` instance; if ``request`` is provided, this
360
+ should not be set.
361
+ table (:class:`google.cloud.bigtable_admin_v2.types.Table`):
362
+ Required. The Table to create.
363
+ This corresponds to the ``table`` field
364
+ on the ``request`` instance; if ``request`` is provided, this
365
+ should not be set.
366
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
367
+ should be retried.
368
+ timeout (float): The timeout for this request.
369
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
370
+ sent along with the request as metadata. Normally, each value must be of type `str`,
371
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
372
+ be of type `bytes`.
373
+
374
+ Returns:
375
+ google.cloud.bigtable_admin_v2.types.Table:
376
+ A collection of user data indexed by
377
+ row, column, and timestamp. Each table
378
+ is served using the resources of its
379
+ parent cluster.
380
+
381
+ """
382
+ # Create or coerce a protobuf request object.
383
+ # - Quick check: If we got a request object, we should *not* have
384
+ # gotten any keyword arguments that map to the request.
385
+ flattened_params = [parent, table_id, table]
386
+ has_flattened_params = (
387
+ len([param for param in flattened_params if param is not None]) > 0
388
+ )
389
+ if request is not None and has_flattened_params:
390
+ raise ValueError(
391
+ "If the `request` argument is set, then none of "
392
+ "the individual field arguments should be set."
393
+ )
394
+
395
+ # - Use the request object if provided (there's no risk of modifying the input as
396
+ # there are no flattened fields), or create one.
397
+ if not isinstance(request, bigtable_table_admin.CreateTableRequest):
398
+ request = bigtable_table_admin.CreateTableRequest(request)
399
+
400
+ # If we have keyword arguments corresponding to fields on the
401
+ # request, apply these.
402
+ if parent is not None:
403
+ request.parent = parent
404
+ if table_id is not None:
405
+ request.table_id = table_id
406
+ if table is not None:
407
+ request.table = table
408
+
409
+ # Wrap the RPC method; this adds retry and timeout information,
410
+ # and friendly error handling.
411
+ rpc = self._client._transport._wrapped_methods[
412
+ self._client._transport.create_table
413
+ ]
414
+
415
+ # Certain fields should be provided within the metadata header;
416
+ # add these here.
417
+ metadata = tuple(metadata) + (
418
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
419
+ )
420
+
421
+ # Validate the universe domain.
422
+ self._client._validate_universe_domain()
423
+
424
+ # Send the request.
425
+ response = await rpc(
426
+ request,
427
+ retry=retry,
428
+ timeout=timeout,
429
+ metadata=metadata,
430
+ )
431
+
432
+ # Done; return the response.
433
+ return response
434
+
435
+ async def create_table_from_snapshot(
436
+ self,
437
+ request: Optional[
438
+ Union[bigtable_table_admin.CreateTableFromSnapshotRequest, dict]
439
+ ] = None,
440
+ *,
441
+ parent: Optional[str] = None,
442
+ table_id: Optional[str] = None,
443
+ source_snapshot: Optional[str] = None,
444
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
445
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
446
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
447
+ ) -> operation_async.AsyncOperation:
448
+ r"""Creates a new table from the specified snapshot. The
449
+ target table must not exist. The snapshot and the table
450
+ must be in the same instance.
451
+
452
+ Note: This is a private alpha release of Cloud Bigtable
453
+ snapshots. This feature is not currently available to
454
+ most Cloud Bigtable customers. This feature might be
455
+ changed in backward-incompatible ways and is not
456
+ recommended for production use. It is not subject to any
457
+ SLA or deprecation policy.
458
+
459
+ Args:
460
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateTableFromSnapshotRequest, dict]]):
461
+ The request object. Request message for
462
+ [google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot]
463
+
464
+ Note: This is a private alpha release of Cloud Bigtable
465
+ snapshots. This feature is not currently available to
466
+ most Cloud Bigtable customers. This feature might be
467
+ changed in backward-incompatible ways and is not
468
+ recommended for production use. It is not subject to any
469
+ SLA or deprecation policy.
470
+ parent (:class:`str`):
471
+ Required. The unique name of the instance in which to
472
+ create the table. Values are of the form
473
+ ``projects/{project}/instances/{instance}``.
474
+
475
+ This corresponds to the ``parent`` field
476
+ on the ``request`` instance; if ``request`` is provided, this
477
+ should not be set.
478
+ table_id (:class:`str`):
479
+ Required. The name by which the new table should be
480
+ referred to within the parent instance, e.g., ``foobar``
481
+ rather than ``{parent}/tables/foobar``.
482
+
483
+ This corresponds to the ``table_id`` field
484
+ on the ``request`` instance; if ``request`` is provided, this
485
+ should not be set.
486
+ source_snapshot (:class:`str`):
487
+ Required. The unique name of the snapshot from which to
488
+ restore the table. The snapshot and the table must be in
489
+ the same instance. Values are of the form
490
+ ``projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}``.
491
+
492
+ This corresponds to the ``source_snapshot`` field
493
+ on the ``request`` instance; if ``request`` is provided, this
494
+ should not be set.
495
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
496
+ should be retried.
497
+ timeout (float): The timeout for this request.
498
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
499
+ sent along with the request as metadata. Normally, each value must be of type `str`,
500
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
501
+ be of type `bytes`.
502
+
503
+ Returns:
504
+ google.api_core.operation_async.AsyncOperation:
505
+ An object representing a long-running operation.
506
+
507
+ The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Table` A collection of user data indexed by row, column, and timestamp.
508
+ Each table is served using the resources of its
509
+ parent cluster.
510
+
511
+ """
512
+ # Create or coerce a protobuf request object.
513
+ # - Quick check: If we got a request object, we should *not* have
514
+ # gotten any keyword arguments that map to the request.
515
+ flattened_params = [parent, table_id, source_snapshot]
516
+ has_flattened_params = (
517
+ len([param for param in flattened_params if param is not None]) > 0
518
+ )
519
+ if request is not None and has_flattened_params:
520
+ raise ValueError(
521
+ "If the `request` argument is set, then none of "
522
+ "the individual field arguments should be set."
523
+ )
524
+
525
+ # - Use the request object if provided (there's no risk of modifying the input as
526
+ # there are no flattened fields), or create one.
527
+ if not isinstance(request, bigtable_table_admin.CreateTableFromSnapshotRequest):
528
+ request = bigtable_table_admin.CreateTableFromSnapshotRequest(request)
529
+
530
+ # If we have keyword arguments corresponding to fields on the
531
+ # request, apply these.
532
+ if parent is not None:
533
+ request.parent = parent
534
+ if table_id is not None:
535
+ request.table_id = table_id
536
+ if source_snapshot is not None:
537
+ request.source_snapshot = source_snapshot
538
+
539
+ # Wrap the RPC method; this adds retry and timeout information,
540
+ # and friendly error handling.
541
+ rpc = self._client._transport._wrapped_methods[
542
+ self._client._transport.create_table_from_snapshot
543
+ ]
544
+
545
+ # Certain fields should be provided within the metadata header;
546
+ # add these here.
547
+ metadata = tuple(metadata) + (
548
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
549
+ )
550
+
551
+ # Validate the universe domain.
552
+ self._client._validate_universe_domain()
553
+
554
+ # Send the request.
555
+ response = await rpc(
556
+ request,
557
+ retry=retry,
558
+ timeout=timeout,
559
+ metadata=metadata,
560
+ )
561
+
562
+ # Wrap the response in an operation future.
563
+ response = operation_async.from_gapic(
564
+ response,
565
+ self._client._transport.operations_client,
566
+ table.Table,
567
+ metadata_type=bigtable_table_admin.CreateTableFromSnapshotMetadata,
568
+ )
569
+
570
+ # Done; return the response.
571
+ return response
572
+
573
+ async def list_tables(
574
+ self,
575
+ request: Optional[Union[bigtable_table_admin.ListTablesRequest, dict]] = None,
576
+ *,
577
+ parent: Optional[str] = None,
578
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
579
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
580
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
581
+ ) -> pagers.ListTablesAsyncPager:
582
+ r"""Lists all tables served from a specified instance.
583
+
584
+ Args:
585
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListTablesRequest, dict]]):
586
+ The request object. Request message for
587
+ [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables]
588
+ parent (:class:`str`):
589
+ Required. The unique name of the instance for which
590
+ tables should be listed. Values are of the form
591
+ ``projects/{project}/instances/{instance}``.
592
+
593
+ This corresponds to the ``parent`` field
594
+ on the ``request`` instance; if ``request`` is provided, this
595
+ should not be set.
596
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
597
+ should be retried.
598
+ timeout (float): The timeout for this request.
599
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
600
+ sent along with the request as metadata. Normally, each value must be of type `str`,
601
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
602
+ be of type `bytes`.
603
+
604
+ Returns:
605
+ google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListTablesAsyncPager:
606
+ Response message for
607
+ [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables]
608
+
609
+ Iterating over this object will yield results and
610
+ resolve additional pages automatically.
611
+
612
+ """
613
+ # Create or coerce a protobuf request object.
614
+ # - Quick check: If we got a request object, we should *not* have
615
+ # gotten any keyword arguments that map to the request.
616
+ flattened_params = [parent]
617
+ has_flattened_params = (
618
+ len([param for param in flattened_params if param is not None]) > 0
619
+ )
620
+ if request is not None and has_flattened_params:
621
+ raise ValueError(
622
+ "If the `request` argument is set, then none of "
623
+ "the individual field arguments should be set."
624
+ )
625
+
626
+ # - Use the request object if provided (there's no risk of modifying the input as
627
+ # there are no flattened fields), or create one.
628
+ if not isinstance(request, bigtable_table_admin.ListTablesRequest):
629
+ request = bigtable_table_admin.ListTablesRequest(request)
630
+
631
+ # If we have keyword arguments corresponding to fields on the
632
+ # request, apply these.
633
+ if parent is not None:
634
+ request.parent = parent
635
+
636
+ # Wrap the RPC method; this adds retry and timeout information,
637
+ # and friendly error handling.
638
+ rpc = self._client._transport._wrapped_methods[
639
+ self._client._transport.list_tables
640
+ ]
641
+
642
+ # Certain fields should be provided within the metadata header;
643
+ # add these here.
644
+ metadata = tuple(metadata) + (
645
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
646
+ )
647
+
648
+ # Validate the universe domain.
649
+ self._client._validate_universe_domain()
650
+
651
+ # Send the request.
652
+ response = await rpc(
653
+ request,
654
+ retry=retry,
655
+ timeout=timeout,
656
+ metadata=metadata,
657
+ )
658
+
659
+ # This method is paged; wrap the response in a pager, which provides
660
+ # an `__aiter__` convenience method.
661
+ response = pagers.ListTablesAsyncPager(
662
+ method=rpc,
663
+ request=request,
664
+ response=response,
665
+ retry=retry,
666
+ timeout=timeout,
667
+ metadata=metadata,
668
+ )
669
+
670
+ # Done; return the response.
671
+ return response
672
+
673
+ async def get_table(
674
+ self,
675
+ request: Optional[Union[bigtable_table_admin.GetTableRequest, dict]] = None,
676
+ *,
677
+ name: Optional[str] = None,
678
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
679
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
680
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
681
+ ) -> table.Table:
682
+ r"""Gets metadata information about the specified table.
683
+
684
+ Args:
685
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetTableRequest, dict]]):
686
+ The request object. Request message for
687
+ [google.bigtable.admin.v2.BigtableTableAdmin.GetTable][google.bigtable.admin.v2.BigtableTableAdmin.GetTable]
688
+ name (:class:`str`):
689
+ Required. The unique name of the requested table. Values
690
+ are of the form
691
+ ``projects/{project}/instances/{instance}/tables/{table}``.
692
+
693
+ This corresponds to the ``name`` field
694
+ on the ``request`` instance; if ``request`` is provided, this
695
+ should not be set.
696
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
697
+ should be retried.
698
+ timeout (float): The timeout for this request.
699
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
700
+ sent along with the request as metadata. Normally, each value must be of type `str`,
701
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
702
+ be of type `bytes`.
703
+
704
+ Returns:
705
+ google.cloud.bigtable_admin_v2.types.Table:
706
+ A collection of user data indexed by
707
+ row, column, and timestamp. Each table
708
+ is served using the resources of its
709
+ parent cluster.
710
+
711
+ """
712
+ # Create or coerce a protobuf request object.
713
+ # - Quick check: If we got a request object, we should *not* have
714
+ # gotten any keyword arguments that map to the request.
715
+ flattened_params = [name]
716
+ has_flattened_params = (
717
+ len([param for param in flattened_params if param is not None]) > 0
718
+ )
719
+ if request is not None and has_flattened_params:
720
+ raise ValueError(
721
+ "If the `request` argument is set, then none of "
722
+ "the individual field arguments should be set."
723
+ )
724
+
725
+ # - Use the request object if provided (there's no risk of modifying the input as
726
+ # there are no flattened fields), or create one.
727
+ if not isinstance(request, bigtable_table_admin.GetTableRequest):
728
+ request = bigtable_table_admin.GetTableRequest(request)
729
+
730
+ # If we have keyword arguments corresponding to fields on the
731
+ # request, apply these.
732
+ if name is not None:
733
+ request.name = name
734
+
735
+ # Wrap the RPC method; this adds retry and timeout information,
736
+ # and friendly error handling.
737
+ rpc = self._client._transport._wrapped_methods[
738
+ self._client._transport.get_table
739
+ ]
740
+
741
+ # Certain fields should be provided within the metadata header;
742
+ # add these here.
743
+ metadata = tuple(metadata) + (
744
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
745
+ )
746
+
747
+ # Validate the universe domain.
748
+ self._client._validate_universe_domain()
749
+
750
+ # Send the request.
751
+ response = await rpc(
752
+ request,
753
+ retry=retry,
754
+ timeout=timeout,
755
+ metadata=metadata,
756
+ )
757
+
758
+ # Done; return the response.
759
+ return response
760
+
761
+ async def update_table(
762
+ self,
763
+ request: Optional[Union[bigtable_table_admin.UpdateTableRequest, dict]] = None,
764
+ *,
765
+ table: Optional[gba_table.Table] = None,
766
+ update_mask: Optional[field_mask_pb2.FieldMask] = None,
767
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
768
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
769
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
770
+ ) -> operation_async.AsyncOperation:
771
+ r"""Updates a specified table.
772
+
773
+ Args:
774
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.UpdateTableRequest, dict]]):
775
+ The request object. The request for
776
+ [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable].
777
+ table (:class:`google.cloud.bigtable_admin_v2.types.Table`):
778
+ Required. The table to update. The table's ``name``
779
+ field is used to identify the table to update.
780
+
781
+ This corresponds to the ``table`` field
782
+ on the ``request`` instance; if ``request`` is provided, this
783
+ should not be set.
784
+ update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
785
+ Required. The list of fields to update. A mask
786
+ specifying which fields (e.g. ``change_stream_config``)
787
+ in the ``table`` field should be updated. This mask is
788
+ relative to the ``table`` field, not to the request
789
+ message. The wildcard (*) path is currently not
790
+ supported. Currently UpdateTable is only supported for
791
+ the following fields:
792
+
793
+ - ``change_stream_config``
794
+ - ``change_stream_config.retention_period``
795
+ - ``deletion_protection``
796
+ - ``row_key_schema``
797
+
798
+ If ``column_families`` is set in ``update_mask``, it
799
+ will return an UNIMPLEMENTED error.
800
+
801
+ This corresponds to the ``update_mask`` field
802
+ on the ``request`` instance; if ``request`` is provided, this
803
+ should not be set.
804
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
805
+ should be retried.
806
+ timeout (float): The timeout for this request.
807
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
808
+ sent along with the request as metadata. Normally, each value must be of type `str`,
809
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
810
+ be of type `bytes`.
811
+
812
+ Returns:
813
+ google.api_core.operation_async.AsyncOperation:
814
+ An object representing a long-running operation.
815
+
816
+ The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Table` A collection of user data indexed by row, column, and timestamp.
817
+ Each table is served using the resources of its
818
+ parent cluster.
819
+
820
+ """
821
+ # Create or coerce a protobuf request object.
822
+ # - Quick check: If we got a request object, we should *not* have
823
+ # gotten any keyword arguments that map to the request.
824
+ flattened_params = [table, update_mask]
825
+ has_flattened_params = (
826
+ len([param for param in flattened_params if param is not None]) > 0
827
+ )
828
+ if request is not None and has_flattened_params:
829
+ raise ValueError(
830
+ "If the `request` argument is set, then none of "
831
+ "the individual field arguments should be set."
832
+ )
833
+
834
+ # - Use the request object if provided (there's no risk of modifying the input as
835
+ # there are no flattened fields), or create one.
836
+ if not isinstance(request, bigtable_table_admin.UpdateTableRequest):
837
+ request = bigtable_table_admin.UpdateTableRequest(request)
838
+
839
+ # If we have keyword arguments corresponding to fields on the
840
+ # request, apply these.
841
+ if table is not None:
842
+ request.table = table
843
+ if update_mask is not None:
844
+ request.update_mask = update_mask
845
+
846
+ # Wrap the RPC method; this adds retry and timeout information,
847
+ # and friendly error handling.
848
+ rpc = self._client._transport._wrapped_methods[
849
+ self._client._transport.update_table
850
+ ]
851
+
852
+ # Certain fields should be provided within the metadata header;
853
+ # add these here.
854
+ metadata = tuple(metadata) + (
855
+ gapic_v1.routing_header.to_grpc_metadata(
856
+ (("table.name", request.table.name),)
857
+ ),
858
+ )
859
+
860
+ # Validate the universe domain.
861
+ self._client._validate_universe_domain()
862
+
863
+ # Send the request.
864
+ response = await rpc(
865
+ request,
866
+ retry=retry,
867
+ timeout=timeout,
868
+ metadata=metadata,
869
+ )
870
+
871
+ # Wrap the response in an operation future.
872
+ response = operation_async.from_gapic(
873
+ response,
874
+ self._client._transport.operations_client,
875
+ gba_table.Table,
876
+ metadata_type=bigtable_table_admin.UpdateTableMetadata,
877
+ )
878
+
879
+ # Done; return the response.
880
+ return response
881
+
882
+ async def delete_table(
883
+ self,
884
+ request: Optional[Union[bigtable_table_admin.DeleteTableRequest, dict]] = None,
885
+ *,
886
+ name: Optional[str] = None,
887
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
888
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
889
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
890
+ ) -> None:
891
+ r"""Permanently deletes a specified table and all of its
892
+ data.
893
+
894
+ Args:
895
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteTableRequest, dict]]):
896
+ The request object. Request message for
897
+ [google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable]
898
+ name (:class:`str`):
899
+ Required. The unique name of the table to be deleted.
900
+ Values are of the form
901
+ ``projects/{project}/instances/{instance}/tables/{table}``.
902
+
903
+ This corresponds to the ``name`` field
904
+ on the ``request`` instance; if ``request`` is provided, this
905
+ should not be set.
906
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
907
+ should be retried.
908
+ timeout (float): The timeout for this request.
909
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
910
+ sent along with the request as metadata. Normally, each value must be of type `str`,
911
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
912
+ be of type `bytes`.
913
+ """
914
+ # Create or coerce a protobuf request object.
915
+ # - Quick check: If we got a request object, we should *not* have
916
+ # gotten any keyword arguments that map to the request.
917
+ flattened_params = [name]
918
+ has_flattened_params = (
919
+ len([param for param in flattened_params if param is not None]) > 0
920
+ )
921
+ if request is not None and has_flattened_params:
922
+ raise ValueError(
923
+ "If the `request` argument is set, then none of "
924
+ "the individual field arguments should be set."
925
+ )
926
+
927
+ # - Use the request object if provided (there's no risk of modifying the input as
928
+ # there are no flattened fields), or create one.
929
+ if not isinstance(request, bigtable_table_admin.DeleteTableRequest):
930
+ request = bigtable_table_admin.DeleteTableRequest(request)
931
+
932
+ # If we have keyword arguments corresponding to fields on the
933
+ # request, apply these.
934
+ if name is not None:
935
+ request.name = name
936
+
937
+ # Wrap the RPC method; this adds retry and timeout information,
938
+ # and friendly error handling.
939
+ rpc = self._client._transport._wrapped_methods[
940
+ self._client._transport.delete_table
941
+ ]
942
+
943
+ # Certain fields should be provided within the metadata header;
944
+ # add these here.
945
+ metadata = tuple(metadata) + (
946
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
947
+ )
948
+
949
+ # Validate the universe domain.
950
+ self._client._validate_universe_domain()
951
+
952
+ # Send the request.
953
+ await rpc(
954
+ request,
955
+ retry=retry,
956
+ timeout=timeout,
957
+ metadata=metadata,
958
+ )
959
+
960
+ async def undelete_table(
961
+ self,
962
+ request: Optional[
963
+ Union[bigtable_table_admin.UndeleteTableRequest, dict]
964
+ ] = None,
965
+ *,
966
+ name: Optional[str] = None,
967
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
968
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
969
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
970
+ ) -> operation_async.AsyncOperation:
971
+ r"""Restores a specified table which was accidentally
972
+ deleted.
973
+
974
+ Args:
975
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.UndeleteTableRequest, dict]]):
976
+ The request object. Request message for
977
+ [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable]
978
+ name (:class:`str`):
979
+ Required. The unique name of the table to be restored.
980
+ Values are of the form
981
+ ``projects/{project}/instances/{instance}/tables/{table}``.
982
+
983
+ This corresponds to the ``name`` field
984
+ on the ``request`` instance; if ``request`` is provided, this
985
+ should not be set.
986
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
987
+ should be retried.
988
+ timeout (float): The timeout for this request.
989
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
990
+ sent along with the request as metadata. Normally, each value must be of type `str`,
991
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
992
+ be of type `bytes`.
993
+
994
+ Returns:
995
+ google.api_core.operation_async.AsyncOperation:
996
+ An object representing a long-running operation.
997
+
998
+ The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Table` A collection of user data indexed by row, column, and timestamp.
999
+ Each table is served using the resources of its
1000
+ parent cluster.
1001
+
1002
+ """
1003
+ # Create or coerce a protobuf request object.
1004
+ # - Quick check: If we got a request object, we should *not* have
1005
+ # gotten any keyword arguments that map to the request.
1006
+ flattened_params = [name]
1007
+ has_flattened_params = (
1008
+ len([param for param in flattened_params if param is not None]) > 0
1009
+ )
1010
+ if request is not None and has_flattened_params:
1011
+ raise ValueError(
1012
+ "If the `request` argument is set, then none of "
1013
+ "the individual field arguments should be set."
1014
+ )
1015
+
1016
+ # - Use the request object if provided (there's no risk of modifying the input as
1017
+ # there are no flattened fields), or create one.
1018
+ if not isinstance(request, bigtable_table_admin.UndeleteTableRequest):
1019
+ request = bigtable_table_admin.UndeleteTableRequest(request)
1020
+
1021
+ # If we have keyword arguments corresponding to fields on the
1022
+ # request, apply these.
1023
+ if name is not None:
1024
+ request.name = name
1025
+
1026
+ # Wrap the RPC method; this adds retry and timeout information,
1027
+ # and friendly error handling.
1028
+ rpc = self._client._transport._wrapped_methods[
1029
+ self._client._transport.undelete_table
1030
+ ]
1031
+
1032
+ # Certain fields should be provided within the metadata header;
1033
+ # add these here.
1034
+ metadata = tuple(metadata) + (
1035
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1036
+ )
1037
+
1038
+ # Validate the universe domain.
1039
+ self._client._validate_universe_domain()
1040
+
1041
+ # Send the request.
1042
+ response = await rpc(
1043
+ request,
1044
+ retry=retry,
1045
+ timeout=timeout,
1046
+ metadata=metadata,
1047
+ )
1048
+
1049
+ # Wrap the response in an operation future.
1050
+ response = operation_async.from_gapic(
1051
+ response,
1052
+ self._client._transport.operations_client,
1053
+ table.Table,
1054
+ metadata_type=bigtable_table_admin.UndeleteTableMetadata,
1055
+ )
1056
+
1057
+ # Done; return the response.
1058
+ return response
1059
+
1060
+ async def create_authorized_view(
1061
+ self,
1062
+ request: Optional[
1063
+ Union[bigtable_table_admin.CreateAuthorizedViewRequest, dict]
1064
+ ] = None,
1065
+ *,
1066
+ parent: Optional[str] = None,
1067
+ authorized_view: Optional[table.AuthorizedView] = None,
1068
+ authorized_view_id: Optional[str] = None,
1069
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1070
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1071
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1072
+ ) -> operation_async.AsyncOperation:
1073
+ r"""Creates a new AuthorizedView in a table.
1074
+
1075
+ Args:
1076
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateAuthorizedViewRequest, dict]]):
1077
+ The request object. The request for
1078
+ [CreateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedView]
1079
+ parent (:class:`str`):
1080
+ Required. This is the name of the table the
1081
+ AuthorizedView belongs to. Values are of the form
1082
+ ``projects/{project}/instances/{instance}/tables/{table}``.
1083
+
1084
+ This corresponds to the ``parent`` field
1085
+ on the ``request`` instance; if ``request`` is provided, this
1086
+ should not be set.
1087
+ authorized_view (:class:`google.cloud.bigtable_admin_v2.types.AuthorizedView`):
1088
+ Required. The AuthorizedView to
1089
+ create.
1090
+
1091
+ This corresponds to the ``authorized_view`` field
1092
+ on the ``request`` instance; if ``request`` is provided, this
1093
+ should not be set.
1094
+ authorized_view_id (:class:`str`):
1095
+ Required. The id of the AuthorizedView to create. This
1096
+ AuthorizedView must not already exist. The
1097
+ ``authorized_view_id`` appended to ``parent`` forms the
1098
+ full AuthorizedView name of the form
1099
+ ``projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}``.
1100
+
1101
+ This corresponds to the ``authorized_view_id`` field
1102
+ on the ``request`` instance; if ``request`` is provided, this
1103
+ should not be set.
1104
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
1105
+ should be retried.
1106
+ timeout (float): The timeout for this request.
1107
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1108
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1109
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1110
+ be of type `bytes`.
1111
+
1112
+ Returns:
1113
+ google.api_core.operation_async.AsyncOperation:
1114
+ An object representing a long-running operation.
1115
+
1116
+ The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.AuthorizedView` AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users
1117
+ can configure access to each Authorized View
1118
+ independently from the table and use the existing
1119
+ Data APIs to access the subset of data.
1120
+
1121
+ """
1122
+ # Create or coerce a protobuf request object.
1123
+ # - Quick check: If we got a request object, we should *not* have
1124
+ # gotten any keyword arguments that map to the request.
1125
+ flattened_params = [parent, authorized_view, authorized_view_id]
1126
+ has_flattened_params = (
1127
+ len([param for param in flattened_params if param is not None]) > 0
1128
+ )
1129
+ if request is not None and has_flattened_params:
1130
+ raise ValueError(
1131
+ "If the `request` argument is set, then none of "
1132
+ "the individual field arguments should be set."
1133
+ )
1134
+
1135
+ # - Use the request object if provided (there's no risk of modifying the input as
1136
+ # there are no flattened fields), or create one.
1137
+ if not isinstance(request, bigtable_table_admin.CreateAuthorizedViewRequest):
1138
+ request = bigtable_table_admin.CreateAuthorizedViewRequest(request)
1139
+
1140
+ # If we have keyword arguments corresponding to fields on the
1141
+ # request, apply these.
1142
+ if parent is not None:
1143
+ request.parent = parent
1144
+ if authorized_view is not None:
1145
+ request.authorized_view = authorized_view
1146
+ if authorized_view_id is not None:
1147
+ request.authorized_view_id = authorized_view_id
1148
+
1149
+ # Wrap the RPC method; this adds retry and timeout information,
1150
+ # and friendly error handling.
1151
+ rpc = self._client._transport._wrapped_methods[
1152
+ self._client._transport.create_authorized_view
1153
+ ]
1154
+
1155
+ # Certain fields should be provided within the metadata header;
1156
+ # add these here.
1157
+ metadata = tuple(metadata) + (
1158
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
1159
+ )
1160
+
1161
+ # Validate the universe domain.
1162
+ self._client._validate_universe_domain()
1163
+
1164
+ # Send the request.
1165
+ response = await rpc(
1166
+ request,
1167
+ retry=retry,
1168
+ timeout=timeout,
1169
+ metadata=metadata,
1170
+ )
1171
+
1172
+ # Wrap the response in an operation future.
1173
+ response = operation_async.from_gapic(
1174
+ response,
1175
+ self._client._transport.operations_client,
1176
+ table.AuthorizedView,
1177
+ metadata_type=bigtable_table_admin.CreateAuthorizedViewMetadata,
1178
+ )
1179
+
1180
+ # Done; return the response.
1181
+ return response
1182
+
1183
+ async def list_authorized_views(
1184
+ self,
1185
+ request: Optional[
1186
+ Union[bigtable_table_admin.ListAuthorizedViewsRequest, dict]
1187
+ ] = None,
1188
+ *,
1189
+ parent: Optional[str] = None,
1190
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1191
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1192
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1193
+ ) -> pagers.ListAuthorizedViewsAsyncPager:
1194
+ r"""Lists all AuthorizedViews from a specific table.
1195
+
1196
+ Args:
1197
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsRequest, dict]]):
1198
+ The request object. Request message for
1199
+ [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews]
1200
+ parent (:class:`str`):
1201
+ Required. The unique name of the table for which
1202
+ AuthorizedViews should be listed. Values are of the form
1203
+ ``projects/{project}/instances/{instance}/tables/{table}``.
1204
+
1205
+ This corresponds to the ``parent`` field
1206
+ on the ``request`` instance; if ``request`` is provided, this
1207
+ should not be set.
1208
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
1209
+ should be retried.
1210
+ timeout (float): The timeout for this request.
1211
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1212
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1213
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1214
+ be of type `bytes`.
1215
+
1216
+ Returns:
1217
+ google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListAuthorizedViewsAsyncPager:
1218
+ Response message for
1219
+ [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews]
1220
+
1221
+ Iterating over this object will yield results and
1222
+ resolve additional pages automatically.
1223
+
1224
+ """
1225
+ # Create or coerce a protobuf request object.
1226
+ # - Quick check: If we got a request object, we should *not* have
1227
+ # gotten any keyword arguments that map to the request.
1228
+ flattened_params = [parent]
1229
+ has_flattened_params = (
1230
+ len([param for param in flattened_params if param is not None]) > 0
1231
+ )
1232
+ if request is not None and has_flattened_params:
1233
+ raise ValueError(
1234
+ "If the `request` argument is set, then none of "
1235
+ "the individual field arguments should be set."
1236
+ )
1237
+
1238
+ # - Use the request object if provided (there's no risk of modifying the input as
1239
+ # there are no flattened fields), or create one.
1240
+ if not isinstance(request, bigtable_table_admin.ListAuthorizedViewsRequest):
1241
+ request = bigtable_table_admin.ListAuthorizedViewsRequest(request)
1242
+
1243
+ # If we have keyword arguments corresponding to fields on the
1244
+ # request, apply these.
1245
+ if parent is not None:
1246
+ request.parent = parent
1247
+
1248
+ # Wrap the RPC method; this adds retry and timeout information,
1249
+ # and friendly error handling.
1250
+ rpc = self._client._transport._wrapped_methods[
1251
+ self._client._transport.list_authorized_views
1252
+ ]
1253
+
1254
+ # Certain fields should be provided within the metadata header;
1255
+ # add these here.
1256
+ metadata = tuple(metadata) + (
1257
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
1258
+ )
1259
+
1260
+ # Validate the universe domain.
1261
+ self._client._validate_universe_domain()
1262
+
1263
+ # Send the request.
1264
+ response = await rpc(
1265
+ request,
1266
+ retry=retry,
1267
+ timeout=timeout,
1268
+ metadata=metadata,
1269
+ )
1270
+
1271
+ # This method is paged; wrap the response in a pager, which provides
1272
+ # an `__aiter__` convenience method.
1273
+ response = pagers.ListAuthorizedViewsAsyncPager(
1274
+ method=rpc,
1275
+ request=request,
1276
+ response=response,
1277
+ retry=retry,
1278
+ timeout=timeout,
1279
+ metadata=metadata,
1280
+ )
1281
+
1282
+ # Done; return the response.
1283
+ return response
1284
+
1285
+ async def get_authorized_view(
1286
+ self,
1287
+ request: Optional[
1288
+ Union[bigtable_table_admin.GetAuthorizedViewRequest, dict]
1289
+ ] = None,
1290
+ *,
1291
+ name: Optional[str] = None,
1292
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1293
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1294
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1295
+ ) -> table.AuthorizedView:
1296
+ r"""Gets information from a specified AuthorizedView.
1297
+
1298
+ Args:
1299
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetAuthorizedViewRequest, dict]]):
1300
+ The request object. Request message for
1301
+ [google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView]
1302
+ name (:class:`str`):
1303
+ Required. The unique name of the requested
1304
+ AuthorizedView. Values are of the form
1305
+ ``projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}``.
1306
+
1307
+ This corresponds to the ``name`` field
1308
+ on the ``request`` instance; if ``request`` is provided, this
1309
+ should not be set.
1310
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
1311
+ should be retried.
1312
+ timeout (float): The timeout for this request.
1313
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1314
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1315
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1316
+ be of type `bytes`.
1317
+
1318
+ Returns:
1319
+ google.cloud.bigtable_admin_v2.types.AuthorizedView:
1320
+ AuthorizedViews represent subsets of
1321
+ a particular Cloud Bigtable table. Users
1322
+ can configure access to each Authorized
1323
+ View independently from the table and
1324
+ use the existing Data APIs to access the
1325
+ subset of data.
1326
+
1327
+ """
1328
+ # Create or coerce a protobuf request object.
1329
+ # - Quick check: If we got a request object, we should *not* have
1330
+ # gotten any keyword arguments that map to the request.
1331
+ flattened_params = [name]
1332
+ has_flattened_params = (
1333
+ len([param for param in flattened_params if param is not None]) > 0
1334
+ )
1335
+ if request is not None and has_flattened_params:
1336
+ raise ValueError(
1337
+ "If the `request` argument is set, then none of "
1338
+ "the individual field arguments should be set."
1339
+ )
1340
+
1341
+ # - Use the request object if provided (there's no risk of modifying the input as
1342
+ # there are no flattened fields), or create one.
1343
+ if not isinstance(request, bigtable_table_admin.GetAuthorizedViewRequest):
1344
+ request = bigtable_table_admin.GetAuthorizedViewRequest(request)
1345
+
1346
+ # If we have keyword arguments corresponding to fields on the
1347
+ # request, apply these.
1348
+ if name is not None:
1349
+ request.name = name
1350
+
1351
+ # Wrap the RPC method; this adds retry and timeout information,
1352
+ # and friendly error handling.
1353
+ rpc = self._client._transport._wrapped_methods[
1354
+ self._client._transport.get_authorized_view
1355
+ ]
1356
+
1357
+ # Certain fields should be provided within the metadata header;
1358
+ # add these here.
1359
+ metadata = tuple(metadata) + (
1360
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1361
+ )
1362
+
1363
+ # Validate the universe domain.
1364
+ self._client._validate_universe_domain()
1365
+
1366
+ # Send the request.
1367
+ response = await rpc(
1368
+ request,
1369
+ retry=retry,
1370
+ timeout=timeout,
1371
+ metadata=metadata,
1372
+ )
1373
+
1374
+ # Done; return the response.
1375
+ return response
1376
+
1377
+ async def update_authorized_view(
1378
+ self,
1379
+ request: Optional[
1380
+ Union[bigtable_table_admin.UpdateAuthorizedViewRequest, dict]
1381
+ ] = None,
1382
+ *,
1383
+ authorized_view: Optional[table.AuthorizedView] = None,
1384
+ update_mask: Optional[field_mask_pb2.FieldMask] = None,
1385
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1386
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1387
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1388
+ ) -> operation_async.AsyncOperation:
1389
+ r"""Updates an AuthorizedView in a table.
1390
+
1391
+ Args:
1392
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.UpdateAuthorizedViewRequest, dict]]):
1393
+ The request object. The request for
1394
+ [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView].
1395
+ authorized_view (:class:`google.cloud.bigtable_admin_v2.types.AuthorizedView`):
1396
+ Required. The AuthorizedView to update. The ``name`` in
1397
+ ``authorized_view`` is used to identify the
1398
+ AuthorizedView. AuthorizedView name must in this format
1399
+ projects//instances//tables//authorizedViews/<authorized_view>
1400
+
1401
+ This corresponds to the ``authorized_view`` field
1402
+ on the ``request`` instance; if ``request`` is provided, this
1403
+ should not be set.
1404
+ update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
1405
+ Optional. The list of fields to update. A mask
1406
+ specifying which fields in the AuthorizedView resource
1407
+ should be updated. This mask is relative to the
1408
+ AuthorizedView resource, not to the request message. A
1409
+ field will be overwritten if it is in the mask. If
1410
+ empty, all fields set in the request will be
1411
+ overwritten. A special value ``*`` means to overwrite
1412
+ all fields (including fields not set in the request).
1413
+
1414
+ This corresponds to the ``update_mask`` field
1415
+ on the ``request`` instance; if ``request`` is provided, this
1416
+ should not be set.
1417
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
1418
+ should be retried.
1419
+ timeout (float): The timeout for this request.
1420
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1421
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1422
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1423
+ be of type `bytes`.
1424
+
1425
+ Returns:
1426
+ google.api_core.operation_async.AsyncOperation:
1427
+ An object representing a long-running operation.
1428
+
1429
+ The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.AuthorizedView` AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users
1430
+ can configure access to each Authorized View
1431
+ independently from the table and use the existing
1432
+ Data APIs to access the subset of data.
1433
+
1434
+ """
1435
+ # Create or coerce a protobuf request object.
1436
+ # - Quick check: If we got a request object, we should *not* have
1437
+ # gotten any keyword arguments that map to the request.
1438
+ flattened_params = [authorized_view, update_mask]
1439
+ has_flattened_params = (
1440
+ len([param for param in flattened_params if param is not None]) > 0
1441
+ )
1442
+ if request is not None and has_flattened_params:
1443
+ raise ValueError(
1444
+ "If the `request` argument is set, then none of "
1445
+ "the individual field arguments should be set."
1446
+ )
1447
+
1448
+ # - Use the request object if provided (there's no risk of modifying the input as
1449
+ # there are no flattened fields), or create one.
1450
+ if not isinstance(request, bigtable_table_admin.UpdateAuthorizedViewRequest):
1451
+ request = bigtable_table_admin.UpdateAuthorizedViewRequest(request)
1452
+
1453
+ # If we have keyword arguments corresponding to fields on the
1454
+ # request, apply these.
1455
+ if authorized_view is not None:
1456
+ request.authorized_view = authorized_view
1457
+ if update_mask is not None:
1458
+ request.update_mask = update_mask
1459
+
1460
+ # Wrap the RPC method; this adds retry and timeout information,
1461
+ # and friendly error handling.
1462
+ rpc = self._client._transport._wrapped_methods[
1463
+ self._client._transport.update_authorized_view
1464
+ ]
1465
+
1466
+ # Certain fields should be provided within the metadata header;
1467
+ # add these here.
1468
+ metadata = tuple(metadata) + (
1469
+ gapic_v1.routing_header.to_grpc_metadata(
1470
+ (("authorized_view.name", request.authorized_view.name),)
1471
+ ),
1472
+ )
1473
+
1474
+ # Validate the universe domain.
1475
+ self._client._validate_universe_domain()
1476
+
1477
+ # Send the request.
1478
+ response = await rpc(
1479
+ request,
1480
+ retry=retry,
1481
+ timeout=timeout,
1482
+ metadata=metadata,
1483
+ )
1484
+
1485
+ # Wrap the response in an operation future.
1486
+ response = operation_async.from_gapic(
1487
+ response,
1488
+ self._client._transport.operations_client,
1489
+ table.AuthorizedView,
1490
+ metadata_type=bigtable_table_admin.UpdateAuthorizedViewMetadata,
1491
+ )
1492
+
1493
+ # Done; return the response.
1494
+ return response
1495
+
1496
+ async def delete_authorized_view(
1497
+ self,
1498
+ request: Optional[
1499
+ Union[bigtable_table_admin.DeleteAuthorizedViewRequest, dict]
1500
+ ] = None,
1501
+ *,
1502
+ name: Optional[str] = None,
1503
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1504
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1505
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1506
+ ) -> None:
1507
+ r"""Permanently deletes a specified AuthorizedView.
1508
+
1509
+ Args:
1510
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteAuthorizedViewRequest, dict]]):
1511
+ The request object. Request message for
1512
+ [google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView]
1513
+ name (:class:`str`):
1514
+ Required. The unique name of the AuthorizedView to be
1515
+ deleted. Values are of the form
1516
+ ``projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}``.
1517
+
1518
+ This corresponds to the ``name`` field
1519
+ on the ``request`` instance; if ``request`` is provided, this
1520
+ should not be set.
1521
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
1522
+ should be retried.
1523
+ timeout (float): The timeout for this request.
1524
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1525
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1526
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1527
+ be of type `bytes`.
1528
+ """
1529
+ # Create or coerce a protobuf request object.
1530
+ # - Quick check: If we got a request object, we should *not* have
1531
+ # gotten any keyword arguments that map to the request.
1532
+ flattened_params = [name]
1533
+ has_flattened_params = (
1534
+ len([param for param in flattened_params if param is not None]) > 0
1535
+ )
1536
+ if request is not None and has_flattened_params:
1537
+ raise ValueError(
1538
+ "If the `request` argument is set, then none of "
1539
+ "the individual field arguments should be set."
1540
+ )
1541
+
1542
+ # - Use the request object if provided (there's no risk of modifying the input as
1543
+ # there are no flattened fields), or create one.
1544
+ if not isinstance(request, bigtable_table_admin.DeleteAuthorizedViewRequest):
1545
+ request = bigtable_table_admin.DeleteAuthorizedViewRequest(request)
1546
+
1547
+ # If we have keyword arguments corresponding to fields on the
1548
+ # request, apply these.
1549
+ if name is not None:
1550
+ request.name = name
1551
+
1552
+ # Wrap the RPC method; this adds retry and timeout information,
1553
+ # and friendly error handling.
1554
+ rpc = self._client._transport._wrapped_methods[
1555
+ self._client._transport.delete_authorized_view
1556
+ ]
1557
+
1558
+ # Certain fields should be provided within the metadata header;
1559
+ # add these here.
1560
+ metadata = tuple(metadata) + (
1561
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1562
+ )
1563
+
1564
+ # Validate the universe domain.
1565
+ self._client._validate_universe_domain()
1566
+
1567
+ # Send the request.
1568
+ await rpc(
1569
+ request,
1570
+ retry=retry,
1571
+ timeout=timeout,
1572
+ metadata=metadata,
1573
+ )
1574
+
1575
+ async def modify_column_families(
1576
+ self,
1577
+ request: Optional[
1578
+ Union[bigtable_table_admin.ModifyColumnFamiliesRequest, dict]
1579
+ ] = None,
1580
+ *,
1581
+ name: Optional[str] = None,
1582
+ modifications: Optional[
1583
+ MutableSequence[
1584
+ bigtable_table_admin.ModifyColumnFamiliesRequest.Modification
1585
+ ]
1586
+ ] = None,
1587
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1588
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1589
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1590
+ ) -> table.Table:
1591
+ r"""Performs a series of column family modifications on
1592
+ the specified table. Either all or none of the
1593
+ modifications will occur before this method returns, but
1594
+ data requests received prior to that point may see a
1595
+ table where only some modifications have taken effect.
1596
+
1597
+ Args:
1598
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.ModifyColumnFamiliesRequest, dict]]):
1599
+ The request object. Request message for
1600
+ [google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies][google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies]
1601
+ name (:class:`str`):
1602
+ Required. The unique name of the table whose families
1603
+ should be modified. Values are of the form
1604
+ ``projects/{project}/instances/{instance}/tables/{table}``.
1605
+
1606
+ This corresponds to the ``name`` field
1607
+ on the ``request`` instance; if ``request`` is provided, this
1608
+ should not be set.
1609
+ modifications (:class:`MutableSequence[google.cloud.bigtable_admin_v2.types.ModifyColumnFamiliesRequest.Modification]`):
1610
+ Required. Modifications to be
1611
+ atomically applied to the specified
1612
+ table's families. Entries are applied in
1613
+ order, meaning that earlier
1614
+ modifications can be masked by later
1615
+ ones (in the case of repeated updates to
1616
+ the same family, for example).
1617
+
1618
+ This corresponds to the ``modifications`` field
1619
+ on the ``request`` instance; if ``request`` is provided, this
1620
+ should not be set.
1621
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
1622
+ should be retried.
1623
+ timeout (float): The timeout for this request.
1624
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1625
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1626
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1627
+ be of type `bytes`.
1628
+
1629
+ Returns:
1630
+ google.cloud.bigtable_admin_v2.types.Table:
1631
+ A collection of user data indexed by
1632
+ row, column, and timestamp. Each table
1633
+ is served using the resources of its
1634
+ parent cluster.
1635
+
1636
+ """
1637
+ # Create or coerce a protobuf request object.
1638
+ # - Quick check: If we got a request object, we should *not* have
1639
+ # gotten any keyword arguments that map to the request.
1640
+ flattened_params = [name, modifications]
1641
+ has_flattened_params = (
1642
+ len([param for param in flattened_params if param is not None]) > 0
1643
+ )
1644
+ if request is not None and has_flattened_params:
1645
+ raise ValueError(
1646
+ "If the `request` argument is set, then none of "
1647
+ "the individual field arguments should be set."
1648
+ )
1649
+
1650
+ # - Use the request object if provided (there's no risk of modifying the input as
1651
+ # there are no flattened fields), or create one.
1652
+ if not isinstance(request, bigtable_table_admin.ModifyColumnFamiliesRequest):
1653
+ request = bigtable_table_admin.ModifyColumnFamiliesRequest(request)
1654
+
1655
+ # If we have keyword arguments corresponding to fields on the
1656
+ # request, apply these.
1657
+ if name is not None:
1658
+ request.name = name
1659
+ if modifications:
1660
+ request.modifications.extend(modifications)
1661
+
1662
+ # Wrap the RPC method; this adds retry and timeout information,
1663
+ # and friendly error handling.
1664
+ rpc = self._client._transport._wrapped_methods[
1665
+ self._client._transport.modify_column_families
1666
+ ]
1667
+
1668
+ # Certain fields should be provided within the metadata header;
1669
+ # add these here.
1670
+ metadata = tuple(metadata) + (
1671
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1672
+ )
1673
+
1674
+ # Validate the universe domain.
1675
+ self._client._validate_universe_domain()
1676
+
1677
+ # Send the request.
1678
+ response = await rpc(
1679
+ request,
1680
+ retry=retry,
1681
+ timeout=timeout,
1682
+ metadata=metadata,
1683
+ )
1684
+
1685
+ # Done; return the response.
1686
+ return response
1687
+
1688
+ async def drop_row_range(
1689
+ self,
1690
+ request: Optional[Union[bigtable_table_admin.DropRowRangeRequest, dict]] = None,
1691
+ *,
1692
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1693
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1694
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1695
+ ) -> None:
1696
+ r"""Permanently drop/delete a row range from a specified
1697
+ table. The request can specify whether to delete all
1698
+ rows in a table, or only those that match a particular
1699
+ prefix.
1700
+
1701
+ Args:
1702
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.DropRowRangeRequest, dict]]):
1703
+ The request object. Request message for
1704
+ [google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange][google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange]
1705
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
1706
+ should be retried.
1707
+ timeout (float): The timeout for this request.
1708
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1709
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1710
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1711
+ be of type `bytes`.
1712
+ """
1713
+ # Create or coerce a protobuf request object.
1714
+ # - Use the request object if provided (there's no risk of modifying the input as
1715
+ # there are no flattened fields), or create one.
1716
+ if not isinstance(request, bigtable_table_admin.DropRowRangeRequest):
1717
+ request = bigtable_table_admin.DropRowRangeRequest(request)
1718
+
1719
+ # Wrap the RPC method; this adds retry and timeout information,
1720
+ # and friendly error handling.
1721
+ rpc = self._client._transport._wrapped_methods[
1722
+ self._client._transport.drop_row_range
1723
+ ]
1724
+
1725
+ # Certain fields should be provided within the metadata header;
1726
+ # add these here.
1727
+ metadata = tuple(metadata) + (
1728
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1729
+ )
1730
+
1731
+ # Validate the universe domain.
1732
+ self._client._validate_universe_domain()
1733
+
1734
+ # Send the request.
1735
+ await rpc(
1736
+ request,
1737
+ retry=retry,
1738
+ timeout=timeout,
1739
+ metadata=metadata,
1740
+ )
1741
+
1742
+ async def generate_consistency_token(
1743
+ self,
1744
+ request: Optional[
1745
+ Union[bigtable_table_admin.GenerateConsistencyTokenRequest, dict]
1746
+ ] = None,
1747
+ *,
1748
+ name: Optional[str] = None,
1749
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1750
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1751
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1752
+ ) -> bigtable_table_admin.GenerateConsistencyTokenResponse:
1753
+ r"""Generates a consistency token for a Table, which can
1754
+ be used in CheckConsistency to check whether mutations
1755
+ to the table that finished before this call started have
1756
+ been replicated. The tokens will be available for 90
1757
+ days.
1758
+
1759
+ Args:
1760
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.GenerateConsistencyTokenRequest, dict]]):
1761
+ The request object. Request message for
1762
+ [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken]
1763
+ name (:class:`str`):
1764
+ Required. The unique name of the Table for which to
1765
+ create a consistency token. Values are of the form
1766
+ ``projects/{project}/instances/{instance}/tables/{table}``.
1767
+
1768
+ This corresponds to the ``name`` field
1769
+ on the ``request`` instance; if ``request`` is provided, this
1770
+ should not be set.
1771
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
1772
+ should be retried.
1773
+ timeout (float): The timeout for this request.
1774
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1775
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1776
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1777
+ be of type `bytes`.
1778
+
1779
+ Returns:
1780
+ google.cloud.bigtable_admin_v2.types.GenerateConsistencyTokenResponse:
1781
+ Response message for
1782
+ [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken]
1783
+
1784
+ """
1785
+ # Create or coerce a protobuf request object.
1786
+ # - Quick check: If we got a request object, we should *not* have
1787
+ # gotten any keyword arguments that map to the request.
1788
+ flattened_params = [name]
1789
+ has_flattened_params = (
1790
+ len([param for param in flattened_params if param is not None]) > 0
1791
+ )
1792
+ if request is not None and has_flattened_params:
1793
+ raise ValueError(
1794
+ "If the `request` argument is set, then none of "
1795
+ "the individual field arguments should be set."
1796
+ )
1797
+
1798
+ # - Use the request object if provided (there's no risk of modifying the input as
1799
+ # there are no flattened fields), or create one.
1800
+ if not isinstance(
1801
+ request, bigtable_table_admin.GenerateConsistencyTokenRequest
1802
+ ):
1803
+ request = bigtable_table_admin.GenerateConsistencyTokenRequest(request)
1804
+
1805
+ # If we have keyword arguments corresponding to fields on the
1806
+ # request, apply these.
1807
+ if name is not None:
1808
+ request.name = name
1809
+
1810
+ # Wrap the RPC method; this adds retry and timeout information,
1811
+ # and friendly error handling.
1812
+ rpc = self._client._transport._wrapped_methods[
1813
+ self._client._transport.generate_consistency_token
1814
+ ]
1815
+
1816
+ # Certain fields should be provided within the metadata header;
1817
+ # add these here.
1818
+ metadata = tuple(metadata) + (
1819
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1820
+ )
1821
+
1822
+ # Validate the universe domain.
1823
+ self._client._validate_universe_domain()
1824
+
1825
+ # Send the request.
1826
+ response = await rpc(
1827
+ request,
1828
+ retry=retry,
1829
+ timeout=timeout,
1830
+ metadata=metadata,
1831
+ )
1832
+
1833
+ # Done; return the response.
1834
+ return response
1835
+
1836
+ async def check_consistency(
1837
+ self,
1838
+ request: Optional[
1839
+ Union[bigtable_table_admin.CheckConsistencyRequest, dict]
1840
+ ] = None,
1841
+ *,
1842
+ name: Optional[str] = None,
1843
+ consistency_token: Optional[str] = None,
1844
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1845
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1846
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1847
+ ) -> bigtable_table_admin.CheckConsistencyResponse:
1848
+ r"""Checks replication consistency based on a consistency
1849
+ token, that is, if replication has caught up based on
1850
+ the conditions specified in the token and the check
1851
+ request.
1852
+
1853
+ Args:
1854
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.CheckConsistencyRequest, dict]]):
1855
+ The request object. Request message for
1856
+ [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency]
1857
+ name (:class:`str`):
1858
+ Required. The unique name of the Table for which to
1859
+ check replication consistency. Values are of the form
1860
+ ``projects/{project}/instances/{instance}/tables/{table}``.
1861
+
1862
+ This corresponds to the ``name`` field
1863
+ on the ``request`` instance; if ``request`` is provided, this
1864
+ should not be set.
1865
+ consistency_token (:class:`str`):
1866
+ Required. The token created using
1867
+ GenerateConsistencyToken for the Table.
1868
+
1869
+ This corresponds to the ``consistency_token`` field
1870
+ on the ``request`` instance; if ``request`` is provided, this
1871
+ should not be set.
1872
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
1873
+ should be retried.
1874
+ timeout (float): The timeout for this request.
1875
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1876
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1877
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1878
+ be of type `bytes`.
1879
+
1880
+ Returns:
1881
+ google.cloud.bigtable_admin_v2.types.CheckConsistencyResponse:
1882
+ Response message for
1883
+ [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency]
1884
+
1885
+ """
1886
+ # Create or coerce a protobuf request object.
1887
+ # - Quick check: If we got a request object, we should *not* have
1888
+ # gotten any keyword arguments that map to the request.
1889
+ flattened_params = [name, consistency_token]
1890
+ has_flattened_params = (
1891
+ len([param for param in flattened_params if param is not None]) > 0
1892
+ )
1893
+ if request is not None and has_flattened_params:
1894
+ raise ValueError(
1895
+ "If the `request` argument is set, then none of "
1896
+ "the individual field arguments should be set."
1897
+ )
1898
+
1899
+ # - Use the request object if provided (there's no risk of modifying the input as
1900
+ # there are no flattened fields), or create one.
1901
+ if not isinstance(request, bigtable_table_admin.CheckConsistencyRequest):
1902
+ request = bigtable_table_admin.CheckConsistencyRequest(request)
1903
+
1904
+ # If we have keyword arguments corresponding to fields on the
1905
+ # request, apply these.
1906
+ if name is not None:
1907
+ request.name = name
1908
+ if consistency_token is not None:
1909
+ request.consistency_token = consistency_token
1910
+
1911
+ # Wrap the RPC method; this adds retry and timeout information,
1912
+ # and friendly error handling.
1913
+ rpc = self._client._transport._wrapped_methods[
1914
+ self._client._transport.check_consistency
1915
+ ]
1916
+
1917
+ # Certain fields should be provided within the metadata header;
1918
+ # add these here.
1919
+ metadata = tuple(metadata) + (
1920
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1921
+ )
1922
+
1923
+ # Validate the universe domain.
1924
+ self._client._validate_universe_domain()
1925
+
1926
+ # Send the request.
1927
+ response = await rpc(
1928
+ request,
1929
+ retry=retry,
1930
+ timeout=timeout,
1931
+ metadata=metadata,
1932
+ )
1933
+
1934
+ # Done; return the response.
1935
+ return response
1936
+
1937
+ async def snapshot_table(
1938
+ self,
1939
+ request: Optional[
1940
+ Union[bigtable_table_admin.SnapshotTableRequest, dict]
1941
+ ] = None,
1942
+ *,
1943
+ name: Optional[str] = None,
1944
+ cluster: Optional[str] = None,
1945
+ snapshot_id: Optional[str] = None,
1946
+ description: Optional[str] = None,
1947
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1948
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1949
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1950
+ ) -> operation_async.AsyncOperation:
1951
+ r"""Creates a new snapshot in the specified cluster from
1952
+ the specified source table. The cluster and the table
1953
+ must be in the same instance.
1954
+
1955
+ Note: This is a private alpha release of Cloud Bigtable
1956
+ snapshots. This feature is not currently available to
1957
+ most Cloud Bigtable customers. This feature might be
1958
+ changed in backward-incompatible ways and is not
1959
+ recommended for production use. It is not subject to any
1960
+ SLA or deprecation policy.
1961
+
1962
+ Args:
1963
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.SnapshotTableRequest, dict]]):
1964
+ The request object. Request message for
1965
+ [google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable][google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable]
1966
+
1967
+ Note: This is a private alpha release of Cloud Bigtable
1968
+ snapshots. This feature is not currently available to
1969
+ most Cloud Bigtable customers. This feature might be
1970
+ changed in backward-incompatible ways and is not
1971
+ recommended for production use. It is not subject to any
1972
+ SLA or deprecation policy.
1973
+ name (:class:`str`):
1974
+ Required. The unique name of the table to have the
1975
+ snapshot taken. Values are of the form
1976
+ ``projects/{project}/instances/{instance}/tables/{table}``.
1977
+
1978
+ This corresponds to the ``name`` field
1979
+ on the ``request`` instance; if ``request`` is provided, this
1980
+ should not be set.
1981
+ cluster (:class:`str`):
1982
+ Required. The name of the cluster where the snapshot
1983
+ will be created in. Values are of the form
1984
+ ``projects/{project}/instances/{instance}/clusters/{cluster}``.
1985
+
1986
+ This corresponds to the ``cluster`` field
1987
+ on the ``request`` instance; if ``request`` is provided, this
1988
+ should not be set.
1989
+ snapshot_id (:class:`str`):
1990
+ Required. The ID by which the new snapshot should be
1991
+ referred to within the parent cluster, e.g.,
1992
+ ``mysnapshot`` of the form:
1993
+ ``[_a-zA-Z0-9][-_.a-zA-Z0-9]*`` rather than
1994
+ ``projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/mysnapshot``.
1995
+
1996
+ This corresponds to the ``snapshot_id`` field
1997
+ on the ``request`` instance; if ``request`` is provided, this
1998
+ should not be set.
1999
+ description (:class:`str`):
2000
+ Description of the snapshot.
2001
+ This corresponds to the ``description`` field
2002
+ on the ``request`` instance; if ``request`` is provided, this
2003
+ should not be set.
2004
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
2005
+ should be retried.
2006
+ timeout (float): The timeout for this request.
2007
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2008
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2009
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2010
+ be of type `bytes`.
2011
+
2012
+ Returns:
2013
+ google.api_core.operation_async.AsyncOperation:
2014
+ An object representing a long-running operation.
2015
+
2016
+ The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Snapshot` A snapshot of a table at a particular time. A snapshot can be used as a
2017
+ checkpoint for data restoration or a data source for
2018
+ a new table.
2019
+
2020
+ Note: This is a private alpha release of Cloud
2021
+ Bigtable snapshots. This feature is not currently
2022
+ available to most Cloud Bigtable customers. This
2023
+ feature might be changed in backward-incompatible
2024
+ ways and is not recommended for production use. It is
2025
+ not subject to any SLA or deprecation policy.
2026
+
2027
+ """
2028
+ # Create or coerce a protobuf request object.
2029
+ # - Quick check: If we got a request object, we should *not* have
2030
+ # gotten any keyword arguments that map to the request.
2031
+ flattened_params = [name, cluster, snapshot_id, description]
2032
+ has_flattened_params = (
2033
+ len([param for param in flattened_params if param is not None]) > 0
2034
+ )
2035
+ if request is not None and has_flattened_params:
2036
+ raise ValueError(
2037
+ "If the `request` argument is set, then none of "
2038
+ "the individual field arguments should be set."
2039
+ )
2040
+
2041
+ # - Use the request object if provided (there's no risk of modifying the input as
2042
+ # there are no flattened fields), or create one.
2043
+ if not isinstance(request, bigtable_table_admin.SnapshotTableRequest):
2044
+ request = bigtable_table_admin.SnapshotTableRequest(request)
2045
+
2046
+ # If we have keyword arguments corresponding to fields on the
2047
+ # request, apply these.
2048
+ if name is not None:
2049
+ request.name = name
2050
+ if cluster is not None:
2051
+ request.cluster = cluster
2052
+ if snapshot_id is not None:
2053
+ request.snapshot_id = snapshot_id
2054
+ if description is not None:
2055
+ request.description = description
2056
+
2057
+ # Wrap the RPC method; this adds retry and timeout information,
2058
+ # and friendly error handling.
2059
+ rpc = self._client._transport._wrapped_methods[
2060
+ self._client._transport.snapshot_table
2061
+ ]
2062
+
2063
+ # Certain fields should be provided within the metadata header;
2064
+ # add these here.
2065
+ metadata = tuple(metadata) + (
2066
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
2067
+ )
2068
+
2069
+ # Validate the universe domain.
2070
+ self._client._validate_universe_domain()
2071
+
2072
+ # Send the request.
2073
+ response = await rpc(
2074
+ request,
2075
+ retry=retry,
2076
+ timeout=timeout,
2077
+ metadata=metadata,
2078
+ )
2079
+
2080
+ # Wrap the response in an operation future.
2081
+ response = operation_async.from_gapic(
2082
+ response,
2083
+ self._client._transport.operations_client,
2084
+ table.Snapshot,
2085
+ metadata_type=bigtable_table_admin.SnapshotTableMetadata,
2086
+ )
2087
+
2088
+ # Done; return the response.
2089
+ return response
2090
+
2091
+ async def get_snapshot(
2092
+ self,
2093
+ request: Optional[Union[bigtable_table_admin.GetSnapshotRequest, dict]] = None,
2094
+ *,
2095
+ name: Optional[str] = None,
2096
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
2097
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2098
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
2099
+ ) -> table.Snapshot:
2100
+ r"""Gets metadata information about the specified
2101
+ snapshot.
2102
+ Note: This is a private alpha release of Cloud Bigtable
2103
+ snapshots. This feature is not currently available to
2104
+ most Cloud Bigtable customers. This feature might be
2105
+ changed in backward-incompatible ways and is not
2106
+ recommended for production use. It is not subject to any
2107
+ SLA or deprecation policy.
2108
+
2109
+ Args:
2110
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetSnapshotRequest, dict]]):
2111
+ The request object. Request message for
2112
+ [google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot]
2113
+
2114
+ Note: This is a private alpha release of Cloud Bigtable
2115
+ snapshots. This feature is not currently available to
2116
+ most Cloud Bigtable customers. This feature might be
2117
+ changed in backward-incompatible ways and is not
2118
+ recommended for production use. It is not subject to any
2119
+ SLA or deprecation policy.
2120
+ name (:class:`str`):
2121
+ Required. The unique name of the requested snapshot.
2122
+ Values are of the form
2123
+ ``projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}``.
2124
+
2125
+ This corresponds to the ``name`` field
2126
+ on the ``request`` instance; if ``request`` is provided, this
2127
+ should not be set.
2128
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
2129
+ should be retried.
2130
+ timeout (float): The timeout for this request.
2131
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2132
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2133
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2134
+ be of type `bytes`.
2135
+
2136
+ Returns:
2137
+ google.cloud.bigtable_admin_v2.types.Snapshot:
2138
+ A snapshot of a table at a particular
2139
+ time. A snapshot can be used as a
2140
+ checkpoint for data restoration or a
2141
+ data source for a new table.
2142
+
2143
+ Note: This is a private alpha release of
2144
+ Cloud Bigtable snapshots. This feature
2145
+ is not currently available to most Cloud
2146
+ Bigtable customers. This feature might
2147
+ be changed in backward-incompatible ways
2148
+ and is not recommended for production
2149
+ use. It is not subject to any SLA or
2150
+ deprecation policy.
2151
+
2152
+ """
2153
+ # Create or coerce a protobuf request object.
2154
+ # - Quick check: If we got a request object, we should *not* have
2155
+ # gotten any keyword arguments that map to the request.
2156
+ flattened_params = [name]
2157
+ has_flattened_params = (
2158
+ len([param for param in flattened_params if param is not None]) > 0
2159
+ )
2160
+ if request is not None and has_flattened_params:
2161
+ raise ValueError(
2162
+ "If the `request` argument is set, then none of "
2163
+ "the individual field arguments should be set."
2164
+ )
2165
+
2166
+ # - Use the request object if provided (there's no risk of modifying the input as
2167
+ # there are no flattened fields), or create one.
2168
+ if not isinstance(request, bigtable_table_admin.GetSnapshotRequest):
2169
+ request = bigtable_table_admin.GetSnapshotRequest(request)
2170
+
2171
+ # If we have keyword arguments corresponding to fields on the
2172
+ # request, apply these.
2173
+ if name is not None:
2174
+ request.name = name
2175
+
2176
+ # Wrap the RPC method; this adds retry and timeout information,
2177
+ # and friendly error handling.
2178
+ rpc = self._client._transport._wrapped_methods[
2179
+ self._client._transport.get_snapshot
2180
+ ]
2181
+
2182
+ # Certain fields should be provided within the metadata header;
2183
+ # add these here.
2184
+ metadata = tuple(metadata) + (
2185
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
2186
+ )
2187
+
2188
+ # Validate the universe domain.
2189
+ self._client._validate_universe_domain()
2190
+
2191
+ # Send the request.
2192
+ response = await rpc(
2193
+ request,
2194
+ retry=retry,
2195
+ timeout=timeout,
2196
+ metadata=metadata,
2197
+ )
2198
+
2199
+ # Done; return the response.
2200
+ return response
2201
+
2202
+ async def list_snapshots(
2203
+ self,
2204
+ request: Optional[
2205
+ Union[bigtable_table_admin.ListSnapshotsRequest, dict]
2206
+ ] = None,
2207
+ *,
2208
+ parent: Optional[str] = None,
2209
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
2210
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2211
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
2212
+ ) -> pagers.ListSnapshotsAsyncPager:
2213
+ r"""Lists all snapshots associated with the specified
2214
+ cluster.
2215
+ Note: This is a private alpha release of Cloud Bigtable
2216
+ snapshots. This feature is not currently available to
2217
+ most Cloud Bigtable customers. This feature might be
2218
+ changed in backward-incompatible ways and is not
2219
+ recommended for production use. It is not subject to any
2220
+ SLA or deprecation policy.
2221
+
2222
+ Args:
2223
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListSnapshotsRequest, dict]]):
2224
+ The request object. Request message for
2225
+ [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots]
2226
+
2227
+ Note: This is a private alpha release of Cloud Bigtable
2228
+ snapshots. This feature is not currently available to
2229
+ most Cloud Bigtable customers. This feature might be
2230
+ changed in backward-incompatible ways and is not
2231
+ recommended for production use. It is not subject to any
2232
+ SLA or deprecation policy.
2233
+ parent (:class:`str`):
2234
+ Required. The unique name of the cluster for which
2235
+ snapshots should be listed. Values are of the form
2236
+ ``projects/{project}/instances/{instance}/clusters/{cluster}``.
2237
+ Use ``{cluster} = '-'`` to list snapshots for all
2238
+ clusters in an instance, e.g.,
2239
+ ``projects/{project}/instances/{instance}/clusters/-``.
2240
+
2241
+ This corresponds to the ``parent`` field
2242
+ on the ``request`` instance; if ``request`` is provided, this
2243
+ should not be set.
2244
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
2245
+ should be retried.
2246
+ timeout (float): The timeout for this request.
2247
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2248
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2249
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2250
+ be of type `bytes`.
2251
+
2252
+ Returns:
2253
+ google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListSnapshotsAsyncPager:
2254
+ Response message for
2255
+ [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots]
2256
+
2257
+ Note: This is a private alpha release of Cloud
2258
+ Bigtable snapshots. This feature is not currently
2259
+ available to most Cloud Bigtable customers. This
2260
+ feature might be changed in backward-incompatible
2261
+ ways and is not recommended for production use. It is
2262
+ not subject to any SLA or deprecation policy.
2263
+
2264
+ Iterating over this object will yield results and
2265
+ resolve additional pages automatically.
2266
+
2267
+ """
2268
+ # Create or coerce a protobuf request object.
2269
+ # - Quick check: If we got a request object, we should *not* have
2270
+ # gotten any keyword arguments that map to the request.
2271
+ flattened_params = [parent]
2272
+ has_flattened_params = (
2273
+ len([param for param in flattened_params if param is not None]) > 0
2274
+ )
2275
+ if request is not None and has_flattened_params:
2276
+ raise ValueError(
2277
+ "If the `request` argument is set, then none of "
2278
+ "the individual field arguments should be set."
2279
+ )
2280
+
2281
+ # - Use the request object if provided (there's no risk of modifying the input as
2282
+ # there are no flattened fields), or create one.
2283
+ if not isinstance(request, bigtable_table_admin.ListSnapshotsRequest):
2284
+ request = bigtable_table_admin.ListSnapshotsRequest(request)
2285
+
2286
+ # If we have keyword arguments corresponding to fields on the
2287
+ # request, apply these.
2288
+ if parent is not None:
2289
+ request.parent = parent
2290
+
2291
+ # Wrap the RPC method; this adds retry and timeout information,
2292
+ # and friendly error handling.
2293
+ rpc = self._client._transport._wrapped_methods[
2294
+ self._client._transport.list_snapshots
2295
+ ]
2296
+
2297
+ # Certain fields should be provided within the metadata header;
2298
+ # add these here.
2299
+ metadata = tuple(metadata) + (
2300
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
2301
+ )
2302
+
2303
+ # Validate the universe domain.
2304
+ self._client._validate_universe_domain()
2305
+
2306
+ # Send the request.
2307
+ response = await rpc(
2308
+ request,
2309
+ retry=retry,
2310
+ timeout=timeout,
2311
+ metadata=metadata,
2312
+ )
2313
+
2314
+ # This method is paged; wrap the response in a pager, which provides
2315
+ # an `__aiter__` convenience method.
2316
+ response = pagers.ListSnapshotsAsyncPager(
2317
+ method=rpc,
2318
+ request=request,
2319
+ response=response,
2320
+ retry=retry,
2321
+ timeout=timeout,
2322
+ metadata=metadata,
2323
+ )
2324
+
2325
+ # Done; return the response.
2326
+ return response
2327
+
2328
+ async def delete_snapshot(
2329
+ self,
2330
+ request: Optional[
2331
+ Union[bigtable_table_admin.DeleteSnapshotRequest, dict]
2332
+ ] = None,
2333
+ *,
2334
+ name: Optional[str] = None,
2335
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
2336
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2337
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
2338
+ ) -> None:
2339
+ r"""Permanently deletes the specified snapshot.
2340
+
2341
+ Note: This is a private alpha release of Cloud Bigtable
2342
+ snapshots. This feature is not currently available to
2343
+ most Cloud Bigtable customers. This feature might be
2344
+ changed in backward-incompatible ways and is not
2345
+ recommended for production use. It is not subject to any
2346
+ SLA or deprecation policy.
2347
+
2348
+ Args:
2349
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteSnapshotRequest, dict]]):
2350
+ The request object. Request message for
2351
+ [google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot]
2352
+
2353
+ Note: This is a private alpha release of Cloud Bigtable
2354
+ snapshots. This feature is not currently available to
2355
+ most Cloud Bigtable customers. This feature might be
2356
+ changed in backward-incompatible ways and is not
2357
+ recommended for production use. It is not subject to any
2358
+ SLA or deprecation policy.
2359
+ name (:class:`str`):
2360
+ Required. The unique name of the snapshot to be deleted.
2361
+ Values are of the form
2362
+ ``projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}``.
2363
+
2364
+ This corresponds to the ``name`` field
2365
+ on the ``request`` instance; if ``request`` is provided, this
2366
+ should not be set.
2367
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
2368
+ should be retried.
2369
+ timeout (float): The timeout for this request.
2370
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2371
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2372
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2373
+ be of type `bytes`.
2374
+ """
2375
+ # Create or coerce a protobuf request object.
2376
+ # - Quick check: If we got a request object, we should *not* have
2377
+ # gotten any keyword arguments that map to the request.
2378
+ flattened_params = [name]
2379
+ has_flattened_params = (
2380
+ len([param for param in flattened_params if param is not None]) > 0
2381
+ )
2382
+ if request is not None and has_flattened_params:
2383
+ raise ValueError(
2384
+ "If the `request` argument is set, then none of "
2385
+ "the individual field arguments should be set."
2386
+ )
2387
+
2388
+ # - Use the request object if provided (there's no risk of modifying the input as
2389
+ # there are no flattened fields), or create one.
2390
+ if not isinstance(request, bigtable_table_admin.DeleteSnapshotRequest):
2391
+ request = bigtable_table_admin.DeleteSnapshotRequest(request)
2392
+
2393
+ # If we have keyword arguments corresponding to fields on the
2394
+ # request, apply these.
2395
+ if name is not None:
2396
+ request.name = name
2397
+
2398
+ # Wrap the RPC method; this adds retry and timeout information,
2399
+ # and friendly error handling.
2400
+ rpc = self._client._transport._wrapped_methods[
2401
+ self._client._transport.delete_snapshot
2402
+ ]
2403
+
2404
+ # Certain fields should be provided within the metadata header;
2405
+ # add these here.
2406
+ metadata = tuple(metadata) + (
2407
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
2408
+ )
2409
+
2410
+ # Validate the universe domain.
2411
+ self._client._validate_universe_domain()
2412
+
2413
+ # Send the request.
2414
+ await rpc(
2415
+ request,
2416
+ retry=retry,
2417
+ timeout=timeout,
2418
+ metadata=metadata,
2419
+ )
2420
+
2421
+ async def create_backup(
2422
+ self,
2423
+ request: Optional[Union[bigtable_table_admin.CreateBackupRequest, dict]] = None,
2424
+ *,
2425
+ parent: Optional[str] = None,
2426
+ backup_id: Optional[str] = None,
2427
+ backup: Optional[table.Backup] = None,
2428
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
2429
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2430
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
2431
+ ) -> operation_async.AsyncOperation:
2432
+ r"""Starts creating a new Cloud Bigtable Backup. The returned backup
2433
+ [long-running operation][google.longrunning.Operation] can be
2434
+ used to track creation of the backup. The
2435
+ [metadata][google.longrunning.Operation.metadata] field type is
2436
+ [CreateBackupMetadata][google.bigtable.admin.v2.CreateBackupMetadata].
2437
+ The [response][google.longrunning.Operation.response] field type
2438
+ is [Backup][google.bigtable.admin.v2.Backup], if successful.
2439
+ Cancelling the returned operation will stop the creation and
2440
+ delete the backup.
2441
+
2442
+ Args:
2443
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateBackupRequest, dict]]):
2444
+ The request object. The request for
2445
+ [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup].
2446
+ parent (:class:`str`):
2447
+ Required. This must be one of the clusters in the
2448
+ instance in which this table is located. The backup will
2449
+ be stored in this cluster. Values are of the form
2450
+ ``projects/{project}/instances/{instance}/clusters/{cluster}``.
2451
+
2452
+ This corresponds to the ``parent`` field
2453
+ on the ``request`` instance; if ``request`` is provided, this
2454
+ should not be set.
2455
+ backup_id (:class:`str`):
2456
+ Required. The id of the backup to be created. The
2457
+ ``backup_id`` along with the parent ``parent`` are
2458
+ combined as {parent}/backups/{backup_id} to create the
2459
+ full backup name, of the form:
2460
+ ``projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}``.
2461
+ This string must be between 1 and 50 characters in
2462
+ length and match the regex [*a-zA-Z0-9][-*.a-zA-Z0-9]*.
2463
+
2464
+ This corresponds to the ``backup_id`` field
2465
+ on the ``request`` instance; if ``request`` is provided, this
2466
+ should not be set.
2467
+ backup (:class:`google.cloud.bigtable_admin_v2.types.Backup`):
2468
+ Required. The backup to create.
2469
+ This corresponds to the ``backup`` field
2470
+ on the ``request`` instance; if ``request`` is provided, this
2471
+ should not be set.
2472
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
2473
+ should be retried.
2474
+ timeout (float): The timeout for this request.
2475
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2476
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2477
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2478
+ be of type `bytes`.
2479
+
2480
+ Returns:
2481
+ google.api_core.operation_async.AsyncOperation:
2482
+ An object representing a long-running operation.
2483
+
2484
+ The result type for the operation will be
2485
+ :class:`google.cloud.bigtable_admin_v2.types.Backup` A
2486
+ backup of a Cloud Bigtable table.
2487
+
2488
+ """
2489
+ # Create or coerce a protobuf request object.
2490
+ # - Quick check: If we got a request object, we should *not* have
2491
+ # gotten any keyword arguments that map to the request.
2492
+ flattened_params = [parent, backup_id, backup]
2493
+ has_flattened_params = (
2494
+ len([param for param in flattened_params if param is not None]) > 0
2495
+ )
2496
+ if request is not None and has_flattened_params:
2497
+ raise ValueError(
2498
+ "If the `request` argument is set, then none of "
2499
+ "the individual field arguments should be set."
2500
+ )
2501
+
2502
+ # - Use the request object if provided (there's no risk of modifying the input as
2503
+ # there are no flattened fields), or create one.
2504
+ if not isinstance(request, bigtable_table_admin.CreateBackupRequest):
2505
+ request = bigtable_table_admin.CreateBackupRequest(request)
2506
+
2507
+ # If we have keyword arguments corresponding to fields on the
2508
+ # request, apply these.
2509
+ if parent is not None:
2510
+ request.parent = parent
2511
+ if backup_id is not None:
2512
+ request.backup_id = backup_id
2513
+ if backup is not None:
2514
+ request.backup = backup
2515
+
2516
+ # Wrap the RPC method; this adds retry and timeout information,
2517
+ # and friendly error handling.
2518
+ rpc = self._client._transport._wrapped_methods[
2519
+ self._client._transport.create_backup
2520
+ ]
2521
+
2522
+ # Certain fields should be provided within the metadata header;
2523
+ # add these here.
2524
+ metadata = tuple(metadata) + (
2525
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
2526
+ )
2527
+
2528
+ # Validate the universe domain.
2529
+ self._client._validate_universe_domain()
2530
+
2531
+ # Send the request.
2532
+ response = await rpc(
2533
+ request,
2534
+ retry=retry,
2535
+ timeout=timeout,
2536
+ metadata=metadata,
2537
+ )
2538
+
2539
+ # Wrap the response in an operation future.
2540
+ response = operation_async.from_gapic(
2541
+ response,
2542
+ self._client._transport.operations_client,
2543
+ table.Backup,
2544
+ metadata_type=bigtable_table_admin.CreateBackupMetadata,
2545
+ )
2546
+
2547
+ # Done; return the response.
2548
+ return response
2549
+
2550
+ async def get_backup(
2551
+ self,
2552
+ request: Optional[Union[bigtable_table_admin.GetBackupRequest, dict]] = None,
2553
+ *,
2554
+ name: Optional[str] = None,
2555
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
2556
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2557
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
2558
+ ) -> table.Backup:
2559
+ r"""Gets metadata on a pending or completed Cloud
2560
+ Bigtable Backup.
2561
+
2562
+ Args:
2563
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetBackupRequest, dict]]):
2564
+ The request object. The request for
2565
+ [GetBackup][google.bigtable.admin.v2.BigtableTableAdmin.GetBackup].
2566
+ name (:class:`str`):
2567
+ Required. Name of the backup. Values are of the form
2568
+ ``projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}``.
2569
+
2570
+ This corresponds to the ``name`` field
2571
+ on the ``request`` instance; if ``request`` is provided, this
2572
+ should not be set.
2573
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
2574
+ should be retried.
2575
+ timeout (float): The timeout for this request.
2576
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2577
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2578
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2579
+ be of type `bytes`.
2580
+
2581
+ Returns:
2582
+ google.cloud.bigtable_admin_v2.types.Backup:
2583
+ A backup of a Cloud Bigtable table.
2584
+ """
2585
+ # Create or coerce a protobuf request object.
2586
+ # - Quick check: If we got a request object, we should *not* have
2587
+ # gotten any keyword arguments that map to the request.
2588
+ flattened_params = [name]
2589
+ has_flattened_params = (
2590
+ len([param for param in flattened_params if param is not None]) > 0
2591
+ )
2592
+ if request is not None and has_flattened_params:
2593
+ raise ValueError(
2594
+ "If the `request` argument is set, then none of "
2595
+ "the individual field arguments should be set."
2596
+ )
2597
+
2598
+ # - Use the request object if provided (there's no risk of modifying the input as
2599
+ # there are no flattened fields), or create one.
2600
+ if not isinstance(request, bigtable_table_admin.GetBackupRequest):
2601
+ request = bigtable_table_admin.GetBackupRequest(request)
2602
+
2603
+ # If we have keyword arguments corresponding to fields on the
2604
+ # request, apply these.
2605
+ if name is not None:
2606
+ request.name = name
2607
+
2608
+ # Wrap the RPC method; this adds retry and timeout information,
2609
+ # and friendly error handling.
2610
+ rpc = self._client._transport._wrapped_methods[
2611
+ self._client._transport.get_backup
2612
+ ]
2613
+
2614
+ # Certain fields should be provided within the metadata header;
2615
+ # add these here.
2616
+ metadata = tuple(metadata) + (
2617
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
2618
+ )
2619
+
2620
+ # Validate the universe domain.
2621
+ self._client._validate_universe_domain()
2622
+
2623
+ # Send the request.
2624
+ response = await rpc(
2625
+ request,
2626
+ retry=retry,
2627
+ timeout=timeout,
2628
+ metadata=metadata,
2629
+ )
2630
+
2631
+ # Done; return the response.
2632
+ return response
2633
+
2634
+ async def update_backup(
2635
+ self,
2636
+ request: Optional[Union[bigtable_table_admin.UpdateBackupRequest, dict]] = None,
2637
+ *,
2638
+ backup: Optional[table.Backup] = None,
2639
+ update_mask: Optional[field_mask_pb2.FieldMask] = None,
2640
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
2641
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2642
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
2643
+ ) -> table.Backup:
2644
+ r"""Updates a pending or completed Cloud Bigtable Backup.
2645
+
2646
+ Args:
2647
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.UpdateBackupRequest, dict]]):
2648
+ The request object. The request for
2649
+ [UpdateBackup][google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup].
2650
+ backup (:class:`google.cloud.bigtable_admin_v2.types.Backup`):
2651
+ Required. The backup to update. ``backup.name``, and the
2652
+ fields to be updated as specified by ``update_mask`` are
2653
+ required. Other fields are ignored. Update is only
2654
+ supported for the following fields:
2655
+
2656
+ - ``backup.expire_time``.
2657
+
2658
+ This corresponds to the ``backup`` field
2659
+ on the ``request`` instance; if ``request`` is provided, this
2660
+ should not be set.
2661
+ update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
2662
+ Required. A mask specifying which fields (e.g.
2663
+ ``expire_time``) in the Backup resource should be
2664
+ updated. This mask is relative to the Backup resource,
2665
+ not to the request message. The field mask must always
2666
+ be specified; this prevents any future fields from being
2667
+ erased accidentally by clients that do not know about
2668
+ them.
2669
+
2670
+ This corresponds to the ``update_mask`` field
2671
+ on the ``request`` instance; if ``request`` is provided, this
2672
+ should not be set.
2673
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
2674
+ should be retried.
2675
+ timeout (float): The timeout for this request.
2676
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2677
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2678
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2679
+ be of type `bytes`.
2680
+
2681
+ Returns:
2682
+ google.cloud.bigtable_admin_v2.types.Backup:
2683
+ A backup of a Cloud Bigtable table.
2684
+ """
2685
+ # Create or coerce a protobuf request object.
2686
+ # - Quick check: If we got a request object, we should *not* have
2687
+ # gotten any keyword arguments that map to the request.
2688
+ flattened_params = [backup, update_mask]
2689
+ has_flattened_params = (
2690
+ len([param for param in flattened_params if param is not None]) > 0
2691
+ )
2692
+ if request is not None and has_flattened_params:
2693
+ raise ValueError(
2694
+ "If the `request` argument is set, then none of "
2695
+ "the individual field arguments should be set."
2696
+ )
2697
+
2698
+ # - Use the request object if provided (there's no risk of modifying the input as
2699
+ # there are no flattened fields), or create one.
2700
+ if not isinstance(request, bigtable_table_admin.UpdateBackupRequest):
2701
+ request = bigtable_table_admin.UpdateBackupRequest(request)
2702
+
2703
+ # If we have keyword arguments corresponding to fields on the
2704
+ # request, apply these.
2705
+ if backup is not None:
2706
+ request.backup = backup
2707
+ if update_mask is not None:
2708
+ request.update_mask = update_mask
2709
+
2710
+ # Wrap the RPC method; this adds retry and timeout information,
2711
+ # and friendly error handling.
2712
+ rpc = self._client._transport._wrapped_methods[
2713
+ self._client._transport.update_backup
2714
+ ]
2715
+
2716
+ # Certain fields should be provided within the metadata header;
2717
+ # add these here.
2718
+ metadata = tuple(metadata) + (
2719
+ gapic_v1.routing_header.to_grpc_metadata(
2720
+ (("backup.name", request.backup.name),)
2721
+ ),
2722
+ )
2723
+
2724
+ # Validate the universe domain.
2725
+ self._client._validate_universe_domain()
2726
+
2727
+ # Send the request.
2728
+ response = await rpc(
2729
+ request,
2730
+ retry=retry,
2731
+ timeout=timeout,
2732
+ metadata=metadata,
2733
+ )
2734
+
2735
+ # Done; return the response.
2736
+ return response
2737
+
2738
+ async def delete_backup(
2739
+ self,
2740
+ request: Optional[Union[bigtable_table_admin.DeleteBackupRequest, dict]] = None,
2741
+ *,
2742
+ name: Optional[str] = None,
2743
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
2744
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2745
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
2746
+ ) -> None:
2747
+ r"""Deletes a pending or completed Cloud Bigtable backup.
2748
+
2749
+ Args:
2750
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteBackupRequest, dict]]):
2751
+ The request object. The request for
2752
+ [DeleteBackup][google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup].
2753
+ name (:class:`str`):
2754
+ Required. Name of the backup to delete. Values are of
2755
+ the form
2756
+ ``projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup}``.
2757
+
2758
+ This corresponds to the ``name`` field
2759
+ on the ``request`` instance; if ``request`` is provided, this
2760
+ should not be set.
2761
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
2762
+ should be retried.
2763
+ timeout (float): The timeout for this request.
2764
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2765
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2766
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2767
+ be of type `bytes`.
2768
+ """
2769
+ # Create or coerce a protobuf request object.
2770
+ # - Quick check: If we got a request object, we should *not* have
2771
+ # gotten any keyword arguments that map to the request.
2772
+ flattened_params = [name]
2773
+ has_flattened_params = (
2774
+ len([param for param in flattened_params if param is not None]) > 0
2775
+ )
2776
+ if request is not None and has_flattened_params:
2777
+ raise ValueError(
2778
+ "If the `request` argument is set, then none of "
2779
+ "the individual field arguments should be set."
2780
+ )
2781
+
2782
+ # - Use the request object if provided (there's no risk of modifying the input as
2783
+ # there are no flattened fields), or create one.
2784
+ if not isinstance(request, bigtable_table_admin.DeleteBackupRequest):
2785
+ request = bigtable_table_admin.DeleteBackupRequest(request)
2786
+
2787
+ # If we have keyword arguments corresponding to fields on the
2788
+ # request, apply these.
2789
+ if name is not None:
2790
+ request.name = name
2791
+
2792
+ # Wrap the RPC method; this adds retry and timeout information,
2793
+ # and friendly error handling.
2794
+ rpc = self._client._transport._wrapped_methods[
2795
+ self._client._transport.delete_backup
2796
+ ]
2797
+
2798
+ # Certain fields should be provided within the metadata header;
2799
+ # add these here.
2800
+ metadata = tuple(metadata) + (
2801
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
2802
+ )
2803
+
2804
+ # Validate the universe domain.
2805
+ self._client._validate_universe_domain()
2806
+
2807
+ # Send the request.
2808
+ await rpc(
2809
+ request,
2810
+ retry=retry,
2811
+ timeout=timeout,
2812
+ metadata=metadata,
2813
+ )
2814
+
2815
+ async def list_backups(
2816
+ self,
2817
+ request: Optional[Union[bigtable_table_admin.ListBackupsRequest, dict]] = None,
2818
+ *,
2819
+ parent: Optional[str] = None,
2820
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
2821
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2822
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
2823
+ ) -> pagers.ListBackupsAsyncPager:
2824
+ r"""Lists Cloud Bigtable backups. Returns both completed
2825
+ and pending backups.
2826
+
2827
+ Args:
2828
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListBackupsRequest, dict]]):
2829
+ The request object. The request for
2830
+ [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups].
2831
+ parent (:class:`str`):
2832
+ Required. The cluster to list backups from. Values are
2833
+ of the form
2834
+ ``projects/{project}/instances/{instance}/clusters/{cluster}``.
2835
+ Use ``{cluster} = '-'`` to list backups for all clusters
2836
+ in an instance, e.g.,
2837
+ ``projects/{project}/instances/{instance}/clusters/-``.
2838
+
2839
+ This corresponds to the ``parent`` field
2840
+ on the ``request`` instance; if ``request`` is provided, this
2841
+ should not be set.
2842
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
2843
+ should be retried.
2844
+ timeout (float): The timeout for this request.
2845
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2846
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2847
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2848
+ be of type `bytes`.
2849
+
2850
+ Returns:
2851
+ google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListBackupsAsyncPager:
2852
+ The response for
2853
+ [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups].
2854
+
2855
+ Iterating over this object will yield results and
2856
+ resolve additional pages automatically.
2857
+
2858
+ """
2859
+ # Create or coerce a protobuf request object.
2860
+ # - Quick check: If we got a request object, we should *not* have
2861
+ # gotten any keyword arguments that map to the request.
2862
+ flattened_params = [parent]
2863
+ has_flattened_params = (
2864
+ len([param for param in flattened_params if param is not None]) > 0
2865
+ )
2866
+ if request is not None and has_flattened_params:
2867
+ raise ValueError(
2868
+ "If the `request` argument is set, then none of "
2869
+ "the individual field arguments should be set."
2870
+ )
2871
+
2872
+ # - Use the request object if provided (there's no risk of modifying the input as
2873
+ # there are no flattened fields), or create one.
2874
+ if not isinstance(request, bigtable_table_admin.ListBackupsRequest):
2875
+ request = bigtable_table_admin.ListBackupsRequest(request)
2876
+
2877
+ # If we have keyword arguments corresponding to fields on the
2878
+ # request, apply these.
2879
+ if parent is not None:
2880
+ request.parent = parent
2881
+
2882
+ # Wrap the RPC method; this adds retry and timeout information,
2883
+ # and friendly error handling.
2884
+ rpc = self._client._transport._wrapped_methods[
2885
+ self._client._transport.list_backups
2886
+ ]
2887
+
2888
+ # Certain fields should be provided within the metadata header;
2889
+ # add these here.
2890
+ metadata = tuple(metadata) + (
2891
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
2892
+ )
2893
+
2894
+ # Validate the universe domain.
2895
+ self._client._validate_universe_domain()
2896
+
2897
+ # Send the request.
2898
+ response = await rpc(
2899
+ request,
2900
+ retry=retry,
2901
+ timeout=timeout,
2902
+ metadata=metadata,
2903
+ )
2904
+
2905
+ # This method is paged; wrap the response in a pager, which provides
2906
+ # an `__aiter__` convenience method.
2907
+ response = pagers.ListBackupsAsyncPager(
2908
+ method=rpc,
2909
+ request=request,
2910
+ response=response,
2911
+ retry=retry,
2912
+ timeout=timeout,
2913
+ metadata=metadata,
2914
+ )
2915
+
2916
+ # Done; return the response.
2917
+ return response
2918
+
2919
+ async def restore_table(
2920
+ self,
2921
+ request: Optional[Union[bigtable_table_admin.RestoreTableRequest, dict]] = None,
2922
+ *,
2923
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
2924
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2925
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
2926
+ ) -> operation_async.AsyncOperation:
2927
+ r"""Create a new table by restoring from a completed backup. The
2928
+ returned table [long-running
2929
+ operation][google.longrunning.Operation] can be used to track
2930
+ the progress of the operation, and to cancel it. The
2931
+ [metadata][google.longrunning.Operation.metadata] field type is
2932
+ [RestoreTableMetadata][google.bigtable.admin.v2.RestoreTableMetadata].
2933
+ The [response][google.longrunning.Operation.response] type is
2934
+ [Table][google.bigtable.admin.v2.Table], if successful.
2935
+
2936
+ Args:
2937
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.RestoreTableRequest, dict]]):
2938
+ The request object. The request for
2939
+ [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable].
2940
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
2941
+ should be retried.
2942
+ timeout (float): The timeout for this request.
2943
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2944
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2945
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2946
+ be of type `bytes`.
2947
+
2948
+ Returns:
2949
+ google.api_core.operation_async.AsyncOperation:
2950
+ An object representing a long-running operation.
2951
+
2952
+ The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Table` A collection of user data indexed by row, column, and timestamp.
2953
+ Each table is served using the resources of its
2954
+ parent cluster.
2955
+
2956
+ """
2957
+ # Create or coerce a protobuf request object.
2958
+ # - Use the request object if provided (there's no risk of modifying the input as
2959
+ # there are no flattened fields), or create one.
2960
+ if not isinstance(request, bigtable_table_admin.RestoreTableRequest):
2961
+ request = bigtable_table_admin.RestoreTableRequest(request)
2962
+
2963
+ # Wrap the RPC method; this adds retry and timeout information,
2964
+ # and friendly error handling.
2965
+ rpc = self._client._transport._wrapped_methods[
2966
+ self._client._transport.restore_table
2967
+ ]
2968
+
2969
+ # Certain fields should be provided within the metadata header;
2970
+ # add these here.
2971
+ metadata = tuple(metadata) + (
2972
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
2973
+ )
2974
+
2975
+ # Validate the universe domain.
2976
+ self._client._validate_universe_domain()
2977
+
2978
+ # Send the request.
2979
+ response = await rpc(
2980
+ request,
2981
+ retry=retry,
2982
+ timeout=timeout,
2983
+ metadata=metadata,
2984
+ )
2985
+
2986
+ # Wrap the response in an operation future.
2987
+ response = operation_async.from_gapic(
2988
+ response,
2989
+ self._client._transport.operations_client,
2990
+ table.Table,
2991
+ metadata_type=bigtable_table_admin.RestoreTableMetadata,
2992
+ )
2993
+
2994
+ # Done; return the response.
2995
+ return response
2996
+
2997
+ async def copy_backup(
2998
+ self,
2999
+ request: Optional[Union[bigtable_table_admin.CopyBackupRequest, dict]] = None,
3000
+ *,
3001
+ parent: Optional[str] = None,
3002
+ backup_id: Optional[str] = None,
3003
+ source_backup: Optional[str] = None,
3004
+ expire_time: Optional[timestamp_pb2.Timestamp] = None,
3005
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
3006
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3007
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
3008
+ ) -> operation_async.AsyncOperation:
3009
+ r"""Copy a Cloud Bigtable backup to a new backup in the
3010
+ destination cluster located in the destination instance
3011
+ and project.
3012
+
3013
+ Args:
3014
+ request (Optional[Union[google.cloud.bigtable_admin_v2.types.CopyBackupRequest, dict]]):
3015
+ The request object. The request for
3016
+ [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup].
3017
+ parent (:class:`str`):
3018
+ Required. The name of the destination cluster that will
3019
+ contain the backup copy. The cluster must already exist.
3020
+ Values are of the form:
3021
+ ``projects/{project}/instances/{instance}/clusters/{cluster}``.
3022
+
3023
+ This corresponds to the ``parent`` field
3024
+ on the ``request`` instance; if ``request`` is provided, this
3025
+ should not be set.
3026
+ backup_id (:class:`str`):
3027
+ Required. The id of the new backup. The ``backup_id``
3028
+ along with ``parent`` are combined as
3029
+ {parent}/backups/{backup_id} to create the full backup
3030
+ name, of the form:
3031
+ ``projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}``.
3032
+ This string must be between 1 and 50 characters in
3033
+ length and match the regex [*a-zA-Z0-9][-*.a-zA-Z0-9]*.
3034
+
3035
+ This corresponds to the ``backup_id`` field
3036
+ on the ``request`` instance; if ``request`` is provided, this
3037
+ should not be set.
3038
+ source_backup (:class:`str`):
3039
+ Required. The source backup to be copied from. The
3040
+ source backup needs to be in READY state for it to be
3041
+ copied. Copying a copied backup is not allowed. Once
3042
+ CopyBackup is in progress, the source backup cannot be
3043
+ deleted or cleaned up on expiration until CopyBackup is
3044
+ finished. Values are of the form:
3045
+ ``projects/<project>/instances/<instance>/clusters/<cluster>/backups/<backup>``.
3046
+
3047
+ This corresponds to the ``source_backup`` field
3048
+ on the ``request`` instance; if ``request`` is provided, this
3049
+ should not be set.
3050
+ expire_time (:class:`google.protobuf.timestamp_pb2.Timestamp`):
3051
+ Required. Required. The expiration time of the copied
3052
+ backup with microsecond granularity that must be at
3053
+ least 6 hours and at most 30 days from the time the
3054
+ request is received. Once the ``expire_time`` has
3055
+ passed, Cloud Bigtable will delete the backup and free
3056
+ the resources used by the backup.
3057
+
3058
+ This corresponds to the ``expire_time`` field
3059
+ on the ``request`` instance; if ``request`` is provided, this
3060
+ should not be set.
3061
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
3062
+ should be retried.
3063
+ timeout (float): The timeout for this request.
3064
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
3065
+ sent along with the request as metadata. Normally, each value must be of type `str`,
3066
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
3067
+ be of type `bytes`.
3068
+
3069
+ Returns:
3070
+ google.api_core.operation_async.AsyncOperation:
3071
+ An object representing a long-running operation.
3072
+
3073
+ The result type for the operation will be
3074
+ :class:`google.cloud.bigtable_admin_v2.types.Backup` A
3075
+ backup of a Cloud Bigtable table.
3076
+
3077
+ """
3078
+ # Create or coerce a protobuf request object.
3079
+ # - Quick check: If we got a request object, we should *not* have
3080
+ # gotten any keyword arguments that map to the request.
3081
+ flattened_params = [parent, backup_id, source_backup, expire_time]
3082
+ has_flattened_params = (
3083
+ len([param for param in flattened_params if param is not None]) > 0
3084
+ )
3085
+ if request is not None and has_flattened_params:
3086
+ raise ValueError(
3087
+ "If the `request` argument is set, then none of "
3088
+ "the individual field arguments should be set."
3089
+ )
3090
+
3091
+ # - Use the request object if provided (there's no risk of modifying the input as
3092
+ # there are no flattened fields), or create one.
3093
+ if not isinstance(request, bigtable_table_admin.CopyBackupRequest):
3094
+ request = bigtable_table_admin.CopyBackupRequest(request)
3095
+
3096
+ # If we have keyword arguments corresponding to fields on the
3097
+ # request, apply these.
3098
+ if parent is not None:
3099
+ request.parent = parent
3100
+ if backup_id is not None:
3101
+ request.backup_id = backup_id
3102
+ if source_backup is not None:
3103
+ request.source_backup = source_backup
3104
+ if expire_time is not None:
3105
+ request.expire_time = expire_time
3106
+
3107
+ # Wrap the RPC method; this adds retry and timeout information,
3108
+ # and friendly error handling.
3109
+ rpc = self._client._transport._wrapped_methods[
3110
+ self._client._transport.copy_backup
3111
+ ]
3112
+
3113
+ # Certain fields should be provided within the metadata header;
3114
+ # add these here.
3115
+ metadata = tuple(metadata) + (
3116
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
3117
+ )
3118
+
3119
+ # Validate the universe domain.
3120
+ self._client._validate_universe_domain()
3121
+
3122
+ # Send the request.
3123
+ response = await rpc(
3124
+ request,
3125
+ retry=retry,
3126
+ timeout=timeout,
3127
+ metadata=metadata,
3128
+ )
3129
+
3130
+ # Wrap the response in an operation future.
3131
+ response = operation_async.from_gapic(
3132
+ response,
3133
+ self._client._transport.operations_client,
3134
+ table.Backup,
3135
+ metadata_type=bigtable_table_admin.CopyBackupMetadata,
3136
+ )
3137
+
3138
+ # Done; return the response.
3139
+ return response
3140
+
3141
+ async def get_iam_policy(
3142
+ self,
3143
+ request: Optional[Union[iam_policy_pb2.GetIamPolicyRequest, dict]] = None,
3144
+ *,
3145
+ resource: Optional[str] = None,
3146
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
3147
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3148
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
3149
+ ) -> policy_pb2.Policy:
3150
+ r"""Gets the access control policy for a Table or Backup
3151
+ resource. Returns an empty policy if the resource exists
3152
+ but does not have a policy set.
3153
+
3154
+ Args:
3155
+ request (Optional[Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]]):
3156
+ The request object. Request message for ``GetIamPolicy`` method.
3157
+ resource (:class:`str`):
3158
+ REQUIRED: The resource for which the
3159
+ policy is being requested. See the
3160
+ operation documentation for the
3161
+ appropriate value for this field.
3162
+
3163
+ This corresponds to the ``resource`` field
3164
+ on the ``request`` instance; if ``request`` is provided, this
3165
+ should not be set.
3166
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
3167
+ should be retried.
3168
+ timeout (float): The timeout for this request.
3169
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
3170
+ sent along with the request as metadata. Normally, each value must be of type `str`,
3171
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
3172
+ be of type `bytes`.
3173
+
3174
+ Returns:
3175
+ google.iam.v1.policy_pb2.Policy:
3176
+ An Identity and Access Management (IAM) policy, which specifies access
3177
+ controls for Google Cloud resources.
3178
+
3179
+ A Policy is a collection of bindings. A binding binds
3180
+ one or more members, or principals, to a single role.
3181
+ Principals can be user accounts, service accounts,
3182
+ Google groups, and domains (such as G Suite). A role
3183
+ is a named list of permissions; each role can be an
3184
+ IAM predefined role or a user-created custom role.
3185
+
3186
+ For some types of Google Cloud resources, a binding
3187
+ can also specify a condition, which is a logical
3188
+ expression that allows access to a resource only if
3189
+ the expression evaluates to true. A condition can add
3190
+ constraints based on attributes of the request, the
3191
+ resource, or both. To learn which resources support
3192
+ conditions in their IAM policies, see the [IAM
3193
+ documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies).
3194
+
3195
+ **JSON example:**
3196
+
3197
+ :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \`
3198
+
3199
+ **YAML example:**
3200
+
3201
+ :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \`
3202
+
3203
+ For a description of IAM and its features, see the
3204
+ [IAM
3205
+ documentation](\ https://cloud.google.com/iam/docs/).
3206
+
3207
+ """
3208
+ # Create or coerce a protobuf request object.
3209
+ # - Quick check: If we got a request object, we should *not* have
3210
+ # gotten any keyword arguments that map to the request.
3211
+ flattened_params = [resource]
3212
+ has_flattened_params = (
3213
+ len([param for param in flattened_params if param is not None]) > 0
3214
+ )
3215
+ if request is not None and has_flattened_params:
3216
+ raise ValueError(
3217
+ "If the `request` argument is set, then none of "
3218
+ "the individual field arguments should be set."
3219
+ )
3220
+
3221
+ # - The request isn't a proto-plus wrapped type,
3222
+ # so it must be constructed via keyword expansion.
3223
+ if isinstance(request, dict):
3224
+ request = iam_policy_pb2.GetIamPolicyRequest(**request)
3225
+ elif not request:
3226
+ request = iam_policy_pb2.GetIamPolicyRequest(resource=resource)
3227
+
3228
+ # Wrap the RPC method; this adds retry and timeout information,
3229
+ # and friendly error handling.
3230
+ rpc = self._client._transport._wrapped_methods[
3231
+ self._client._transport.get_iam_policy
3232
+ ]
3233
+
3234
+ # Certain fields should be provided within the metadata header;
3235
+ # add these here.
3236
+ metadata = tuple(metadata) + (
3237
+ gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)),
3238
+ )
3239
+
3240
+ # Validate the universe domain.
3241
+ self._client._validate_universe_domain()
3242
+
3243
+ # Send the request.
3244
+ response = await rpc(
3245
+ request,
3246
+ retry=retry,
3247
+ timeout=timeout,
3248
+ metadata=metadata,
3249
+ )
3250
+
3251
+ # Done; return the response.
3252
+ return response
3253
+
3254
+ async def set_iam_policy(
3255
+ self,
3256
+ request: Optional[Union[iam_policy_pb2.SetIamPolicyRequest, dict]] = None,
3257
+ *,
3258
+ resource: Optional[str] = None,
3259
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
3260
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3261
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
3262
+ ) -> policy_pb2.Policy:
3263
+ r"""Sets the access control policy on a Table or Backup
3264
+ resource. Replaces any existing policy.
3265
+
3266
+ Args:
3267
+ request (Optional[Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]]):
3268
+ The request object. Request message for ``SetIamPolicy`` method.
3269
+ resource (:class:`str`):
3270
+ REQUIRED: The resource for which the
3271
+ policy is being specified. See the
3272
+ operation documentation for the
3273
+ appropriate value for this field.
3274
+
3275
+ This corresponds to the ``resource`` field
3276
+ on the ``request`` instance; if ``request`` is provided, this
3277
+ should not be set.
3278
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
3279
+ should be retried.
3280
+ timeout (float): The timeout for this request.
3281
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
3282
+ sent along with the request as metadata. Normally, each value must be of type `str`,
3283
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
3284
+ be of type `bytes`.
3285
+
3286
+ Returns:
3287
+ google.iam.v1.policy_pb2.Policy:
3288
+ An Identity and Access Management (IAM) policy, which specifies access
3289
+ controls for Google Cloud resources.
3290
+
3291
+ A Policy is a collection of bindings. A binding binds
3292
+ one or more members, or principals, to a single role.
3293
+ Principals can be user accounts, service accounts,
3294
+ Google groups, and domains (such as G Suite). A role
3295
+ is a named list of permissions; each role can be an
3296
+ IAM predefined role or a user-created custom role.
3297
+
3298
+ For some types of Google Cloud resources, a binding
3299
+ can also specify a condition, which is a logical
3300
+ expression that allows access to a resource only if
3301
+ the expression evaluates to true. A condition can add
3302
+ constraints based on attributes of the request, the
3303
+ resource, or both. To learn which resources support
3304
+ conditions in their IAM policies, see the [IAM
3305
+ documentation](\ https://cloud.google.com/iam/help/conditions/resource-policies).
3306
+
3307
+ **JSON example:**
3308
+
3309
+ :literal:`\` { "bindings": [ { "role": "roles/resourcemanager.organizationAdmin", "members": [ "user:mike@example.com", "group:admins@example.com", "domain:google.com", "serviceAccount:my-project-id@appspot.gserviceaccount.com" ] }, { "role": "roles/resourcemanager.organizationViewer", "members": [ "user:eve@example.com" ], "condition": { "title": "expirable access", "description": "Does not grant access after Sep 2020", "expression": "request.time < timestamp('2020-10-01T00:00:00.000Z')", } } ], "etag": "BwWWja0YfJA=", "version": 3 }`\ \`
3310
+
3311
+ **YAML example:**
3312
+
3313
+ :literal:`\` bindings: - members: - user:mike@example.com - group:admins@example.com - domain:google.com - serviceAccount:my-project-id@appspot.gserviceaccount.com role: roles/resourcemanager.organizationAdmin - members: - user:eve@example.com role: roles/resourcemanager.organizationViewer condition: title: expirable access description: Does not grant access after Sep 2020 expression: request.time < timestamp('2020-10-01T00:00:00.000Z') etag: BwWWja0YfJA= version: 3`\ \`
3314
+
3315
+ For a description of IAM and its features, see the
3316
+ [IAM
3317
+ documentation](\ https://cloud.google.com/iam/docs/).
3318
+
3319
+ """
3320
+ # Create or coerce a protobuf request object.
3321
+ # - Quick check: If we got a request object, we should *not* have
3322
+ # gotten any keyword arguments that map to the request.
3323
+ flattened_params = [resource]
3324
+ has_flattened_params = (
3325
+ len([param for param in flattened_params if param is not None]) > 0
3326
+ )
3327
+ if request is not None and has_flattened_params:
3328
+ raise ValueError(
3329
+ "If the `request` argument is set, then none of "
3330
+ "the individual field arguments should be set."
3331
+ )
3332
+
3333
+ # - The request isn't a proto-plus wrapped type,
3334
+ # so it must be constructed via keyword expansion.
3335
+ if isinstance(request, dict):
3336
+ request = iam_policy_pb2.SetIamPolicyRequest(**request)
3337
+ elif not request:
3338
+ request = iam_policy_pb2.SetIamPolicyRequest(resource=resource)
3339
+
3340
+ # Wrap the RPC method; this adds retry and timeout information,
3341
+ # and friendly error handling.
3342
+ rpc = self._client._transport._wrapped_methods[
3343
+ self._client._transport.set_iam_policy
3344
+ ]
3345
+
3346
+ # Certain fields should be provided within the metadata header;
3347
+ # add these here.
3348
+ metadata = tuple(metadata) + (
3349
+ gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)),
3350
+ )
3351
+
3352
+ # Validate the universe domain.
3353
+ self._client._validate_universe_domain()
3354
+
3355
+ # Send the request.
3356
+ response = await rpc(
3357
+ request,
3358
+ retry=retry,
3359
+ timeout=timeout,
3360
+ metadata=metadata,
3361
+ )
3362
+
3363
+ # Done; return the response.
3364
+ return response
3365
+
3366
+ async def test_iam_permissions(
3367
+ self,
3368
+ request: Optional[Union[iam_policy_pb2.TestIamPermissionsRequest, dict]] = None,
3369
+ *,
3370
+ resource: Optional[str] = None,
3371
+ permissions: Optional[MutableSequence[str]] = None,
3372
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
3373
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3374
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
3375
+ ) -> iam_policy_pb2.TestIamPermissionsResponse:
3376
+ r"""Returns permissions that the caller has on the
3377
+ specified Table or Backup resource.
3378
+
3379
+ Args:
3380
+ request (Optional[Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]]):
3381
+ The request object. Request message for ``TestIamPermissions`` method.
3382
+ resource (:class:`str`):
3383
+ REQUIRED: The resource for which the
3384
+ policy detail is being requested. See
3385
+ the operation documentation for the
3386
+ appropriate value for this field.
3387
+
3388
+ This corresponds to the ``resource`` field
3389
+ on the ``request`` instance; if ``request`` is provided, this
3390
+ should not be set.
3391
+ permissions (:class:`MutableSequence[str]`):
3392
+ The set of permissions to check for the ``resource``.
3393
+ Permissions with wildcards (such as '*' or 'storage.*')
3394
+ are not allowed. For more information see `IAM
3395
+ Overview <https://cloud.google.com/iam/docs/overview#permissions>`__.
3396
+
3397
+ This corresponds to the ``permissions`` field
3398
+ on the ``request`` instance; if ``request`` is provided, this
3399
+ should not be set.
3400
+ retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
3401
+ should be retried.
3402
+ timeout (float): The timeout for this request.
3403
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
3404
+ sent along with the request as metadata. Normally, each value must be of type `str`,
3405
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
3406
+ be of type `bytes`.
3407
+
3408
+ Returns:
3409
+ google.iam.v1.iam_policy_pb2.TestIamPermissionsResponse:
3410
+ Response message for TestIamPermissions method.
3411
+ """
3412
+ # Create or coerce a protobuf request object.
3413
+ # - Quick check: If we got a request object, we should *not* have
3414
+ # gotten any keyword arguments that map to the request.
3415
+ flattened_params = [resource, permissions]
3416
+ has_flattened_params = (
3417
+ len([param for param in flattened_params if param is not None]) > 0
3418
+ )
3419
+ if request is not None and has_flattened_params:
3420
+ raise ValueError(
3421
+ "If the `request` argument is set, then none of "
3422
+ "the individual field arguments should be set."
3423
+ )
3424
+
3425
+ # - The request isn't a proto-plus wrapped type,
3426
+ # so it must be constructed via keyword expansion.
3427
+ if isinstance(request, dict):
3428
+ request = iam_policy_pb2.TestIamPermissionsRequest(**request)
3429
+ elif not request:
3430
+ request = iam_policy_pb2.TestIamPermissionsRequest(
3431
+ resource=resource, permissions=permissions
3432
+ )
3433
+
3434
+ # Wrap the RPC method; this adds retry and timeout information,
3435
+ # and friendly error handling.
3436
+ rpc = self._client._transport._wrapped_methods[
3437
+ self._client._transport.test_iam_permissions
3438
+ ]
3439
+
3440
+ # Certain fields should be provided within the metadata header;
3441
+ # add these here.
3442
+ metadata = tuple(metadata) + (
3443
+ gapic_v1.routing_header.to_grpc_metadata((("resource", request.resource),)),
3444
+ )
3445
+
3446
+ # Validate the universe domain.
3447
+ self._client._validate_universe_domain()
3448
+
3449
+ # Send the request.
3450
+ response = await rpc(
3451
+ request,
3452
+ retry=retry,
3453
+ timeout=timeout,
3454
+ metadata=metadata,
3455
+ )
3456
+
3457
+ # Done; return the response.
3458
+ return response
3459
+
3460
+ async def __aenter__(self) -> "BigtableTableAdminAsyncClient":
3461
+ return self
3462
+
3463
+ async def __aexit__(self, exc_type, exc, tb):
3464
+ await self.transport.close()
3465
+
3466
+
3467
+ DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
3468
+ gapic_version=package_version.__version__
3469
+ )
3470
+
3471
+
3472
+ __all__ = ("BigtableTableAdminAsyncClient",)