1717import re
1818
1919from google .cloud ._helpers import _datetime_to_pb_timestamp # type: ignore
20- from google .cloud .bigtable_admin_v2 import BigtableTableAdminClient
21- from google .cloud .bigtable_admin_v2 .types import table
20+ from google .cloud .bigtable . admin_v2 import BaseBigtableTableAdminClient
21+ from google .cloud .bigtable . admin_v2 .types import table
2222from google .cloud .bigtable .encryption_info import EncryptionInfo
2323from google .cloud .bigtable .policy import Policy
2424from google .cloud .exceptions import NotFound # type: ignore
@@ -106,7 +106,7 @@ def name(self):
106106 if not self ._cluster :
107107 raise ValueError ('"cluster" parameter must be set' )
108108
109- return BigtableTableAdminClient .backup_path (
109+ return BaseBigtableTableAdminClient .backup_path (
110110 project = self ._instance ._client .project ,
111111 instance = self ._instance .instance_id ,
112112 cluster = self ._cluster ,
@@ -141,7 +141,7 @@ def parent(self):
141141 :returns: A full path to the parent cluster.
142142 """
143143 if not self ._parent and self ._cluster :
144- self ._parent = BigtableTableAdminClient .cluster_path (
144+ self ._parent = BaseBigtableTableAdminClient .cluster_path (
145145 project = self ._instance ._client .project ,
146146 instance = self ._instance .instance_id ,
147147 cluster = self ._cluster ,
@@ -163,7 +163,7 @@ def source_table(self):
163163 :returns: The Table name.
164164 """
165165 if not self ._source_table and self .table_id :
166- self ._source_table = BigtableTableAdminClient .table_path (
166+ self ._source_table = BaseBigtableTableAdminClient .table_path (
167167 project = self ._instance ._client .project ,
168168 instance = self ._instance .instance_id ,
169169 table = self .table_id ,
@@ -226,7 +226,7 @@ def size_bytes(self):
226226 def state (self ):
227227 """The current state of this Backup.
228228
229- :rtype: :class:`~google.cloud.bigtable_admin_v2.gapic.enums .Backup.State`
229+ :rtype: :class:`~google.cloud.bigtable.admin_v2.types.table .Backup.State`
230230 :returns: The current state of this Backup.
231231 """
232232 return self ._state
@@ -305,8 +305,7 @@ def create(self, cluster_id=None):
305305 created Backup.
306306
307307 :rtype: :class:`~google.api_core.operation.Operation`
308- :returns: :class:`~google.cloud.bigtable_admin_v2.types._OperationFuture`
309- instance, to be used to poll the status of the 'create' request
308+ :returns: A future to be used to poll the status of the 'create' request
310309 :raises Conflict: if the Backup already exists
311310 :raises NotFound: if the Instance owning the Backup does not exist
312311 :raises BadRequest: if the `table` or `expire_time` values are invalid,
@@ -343,7 +342,7 @@ def get(self):
343342 """Retrieves metadata of a pending or completed Backup.
344343
345344 :returns: An instance of
346- :class:`~google.cloud.bigtable_admin_v2 .types.Backup`
345+ :class:`~google.cloud.bigtable.admin_v2 .types.Backup`
347346
348347 :raises google.api_core.exceptions.GoogleAPICallError: If the request
349348 failed for any reason.
@@ -412,7 +411,7 @@ def restore(self, table_id, instance_id=None):
412411 :param instance_id: (Optional) The ID of the Instance to restore the
413412 backup into, if different from the current one.
414413
415- :rtype: :class:`~google.cloud.bigtable_admin_v2.types._OperationFuture `
414+ :rtype: :class:`~google.api_core.operation.Operation `
416415 :returns: A future to be used to poll the status of the 'restore'
417416 request.
418417
@@ -426,14 +425,14 @@ def restore(self, table_id, instance_id=None):
426425 """
427426 api = self ._instance ._client .table_admin_client
428427 if instance_id :
429- parent = BigtableTableAdminClient .instance_path (
428+ parent = BaseBigtableTableAdminClient .instance_path (
430429 project = self ._instance ._client .project ,
431430 instance = instance_id ,
432431 )
433432 else :
434433 parent = self ._instance .name
435434
436- return api .restore_table (
435+ return api ._restore_table (
437436 request = {"parent" : parent , "table_id" : table_id , "backup" : self .name }
438437 )
439438
0 commit comments