def create_table_from_snapshot(
        self,
        parent,
        table_id,
        source_snapshot,
        retry=google.api_core.gapic_v1.method.DEFAULT,
        timeout=google.api_core.gapic_v1.method.DEFAULT,
        metadata=None,
    ):
        """
        Creates a new table from the specified snapshot. The target table must
        not exist. The snapshot and the table must be in the same instance.

        Note: This is a private alpha release of Cloud Bigtable snapshots. This
        feature is not currently available to most Cloud Bigtable customers. This
        feature might be changed in backward-incompatible ways and is not
        recommended for production use. It is not subject to any SLA or deprecation
        policy.

        Example:
            >>> from google.cloud import bigtable_admin_v2
            >>>
            >>> client = bigtable_admin_v2.BigtableTableAdminClient()
            >>>
            >>> parent = client.instance_path('[PROJECT]', '[INSTANCE]')
            >>>
            >>> # TODO: Initialize `table_id`:
            >>> table_id = ''
            >>>
            >>> # TODO: Initialize `source_snapshot`:
            >>> source_snapshot = ''
            >>>
            >>> response = client.create_table_from_snapshot(parent, table_id, source_snapshot)
            >>>
            >>> def callback(operation_future):
            ...     # Handle result.
            ...     result = operation_future.result()
            >>>
            >>> response.add_done_callback(callback)
            >>>
            >>> # Handle metadata.
            >>> metadata = response.metadata()

        Args:
            parent (str): The unique name of the instance in which to create the table. Values are
                of the form ``projects/<project>/instances/<instance>``.
            table_id (str): The name by which the new table should be referred to within the parent
                instance, e.g., ``foobar`` rather than ``<parent>/tables/foobar``.
            source_snapshot (str): The unique name of the snapshot from which to restore the table. The
                snapshot and the table must be in the same instance. Values are of the
                form
                ``projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>``.
            retry (Optional[google.api_core.retry.Retry]):  A retry object used
                to retry requests. If ``None`` is specified, requests will not
                be retried.
            timeout (Optional[float]): The amount of time, in seconds, to wait
                for the request to complete. Note that if ``retry`` is
                specified, the timeout applies to each individual attempt.
            metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
                that is provided to the method.

        Returns:
            A :class:`~google.cloud.bigtable_admin_v2.types._OperationFuture` instance.

        Raises:
            google.api_core.exceptions.GoogleAPICallError: If the request
                    failed for any reason.
            google.api_core.exceptions.RetryError: If the request failed due
                    to a retryable error and retry attempts failed.
            ValueError: If the parameters are invalid.
        """
        # Wrap the transport method to add retry and timeout logic.
        if "create_table_from_snapshot" not in self._inner_api_calls:
            self._inner_api_calls[
                "create_table_from_snapshot"
            ] = google.api_core.gapic_v1.method.wrap_method(
                self.transport.create_table_from_snapshot,
                default_retry=self._method_configs["CreateTableFromSnapshot"].retry,
                default_timeout=self._method_configs["CreateTableFromSnapshot"].timeout,
                client_info=self._client_info,
            )

        request = bigtable_table_admin_pb2.CreateTableFromSnapshotRequest(
            parent=parent, table_id=table_id, source_snapshot=source_snapshot
        )
        if metadata is None:
            metadata = []
        metadata = list(metadata)
        try:
            routing_header = [("parent", parent)]
        except AttributeError:
            pass
        else:
            routing_metadata = google.api_core.gapic_v1.routing_header.to_grpc_metadata(
                routing_header
            )
            metadata.append(routing_metadata)

        operation = self._inner_api_calls["create_table_from_snapshot"](
            request, retry=retry, timeout=timeout, metadata=metadata
        )
        return google.api_core.operation.from_gapic(
            operation,
            self.transport._operations_client,
            table_pb2.Table,
            metadata_type=bigtable_table_admin_pb2.CreateTableFromSnapshotMetadata,
        )
def create_table_from_snapshot ( self , parent , table_id , source_snapshot , retry = google . api_core . gapic_v1 . method . DEFAULT , timeout = google . api_core . gapic_v1 . method . DEFAULT , metadata = None , ) : if "create_table_from_snapshot" not in self . _inner_api_calls : self . _inner_api_calls [ "create_table_from_snapshot" ] = google . api_core . gapic_v1 . method . wrap_method ( self . transport . create_table_from_snapshot , default_retry = self . _method_configs [ "CreateTableFromSnapshot" ] . retry , default_timeout = self . _method_configs [ "CreateTableFromSnapshot" ] . timeout , client_info = self . _client_info , ) request = bigtable_table_admin_pb2 . CreateTableFromSnapshotRequest ( parent = parent , table_id = table_id , source_snapshot = source_snapshot ) if metadata is None : metadata = [ ] metadata = list ( metadata ) try : routing_header = [ ( "parent" , parent ) ] except AttributeError : pass else : routing_metadata = google . api_core . gapic_v1 . routing_header . to_grpc_metadata ( routing_header ) metadata . append ( routing_metadata ) operation = self . _inner_api_calls [ "create_table_from_snapshot" ] ( request , retry = retry , timeout = timeout , metadata = metadata ) return google . api_core . operation . from_gapic ( operation , self . transport . _operations_client , table_pb2 . Table , metadata_type = bigtable_table_admin_pb2 . CreateTableFromSnapshotMetadata , )
Creates a new table from the specified snapshot. The target table must
        not exist. The snapshot and the table must be in the same instance.

        Note: This is a private alpha release of Cloud Bigtable snapshots. This
        feature is not currently available to most Cloud Bigtable customers. This
        feature might be changed in backward-incompatible ways and is not
        recommended for production use. It is not subject to any SLA or deprecation
        policy.

        Example:
            >>> from google.cloud import bigtable_admin_v2
            >>>
            >>> client = bigtable_admin_v2.BigtableTableAdminClient()
            >>>
            >>> parent = client.instance_path('[PROJECT]', '[INSTANCE]')
            >>>
            >>> # TODO: Initialize `table_id`:
            >>> table_id = ''
            >>>
            >>> # TODO: Initialize `source_snapshot`:
            >>> source_snapshot = ''
            >>>
            >>> response = client.create_table_from_snapshot(parent, table_id, source_snapshot)
            >>>
            >>> def callback(operation_future):
            ...     # Handle result.
            ...     result = operation_future.result()
            >>>
            >>> response.add_done_callback(callback)
            >>>
            >>> # Handle metadata.
            >>> metadata = response.metadata()

        Args:
            parent (str): The unique name of the instance in which to create the table. Values are
                of the form ``projects/<project>/instances/<instance>``.
            table_id (str): The name by which the new table should be referred to within the parent
                instance, e.g., ``foobar`` rather than ``<parent>/tables/foobar``.
            source_snapshot (str): The unique name of the snapshot from which to restore the table. The
                snapshot and the table must be in the same instance. Values are of the
                form
                ``projects/<project>/instances/<instance>/clusters/<cluster>/snapshots/<snapshot>``.
            retry (Optional[google.api_core.retry.Retry]):  A retry object used
                to retry requests. If ``None`` is specified, requests will not
                be retried.
            timeout (Optional[float]): The amount of time, in seconds, to wait
                for the request to complete. Note that if ``retry`` is
                specified, the timeout applies to each individual attempt.
            metadata (Optional[Sequence[Tuple[str, str]]]): Additional metadata
                that is provided to the method.

        Returns:
            A :class:`~google.cloud.bigtable_admin_v2.types._OperationFuture` instance.

        Raises:
            google.api_core.exceptions.GoogleAPICallError: If the request
                    failed for any reason.
            google.api_core.exceptions.RetryError: If the request failed due
                    to a retryable error and retry attempts failed.
            ValueError: If the parameters are invalid.