diff --git a/docs/admin_client/admin_client_usage.rst b/docs/admin_client/admin_client_usage.rst new file mode 100644 index 000000000..8c6f4a5dc --- /dev/null +++ b/docs/admin_client/admin_client_usage.rst @@ -0,0 +1,11 @@ +Admin Client +============ +.. toctree:: + :maxdepth: 2 + + services_ + types_ + +.. + This should be the only handwritten RST file in this directory. + Everything else should be autogenerated. diff --git a/docs/admin_client/bigtable_instance_admin.rst b/docs/admin_client/bigtable_instance_admin.rst new file mode 100644 index 000000000..acfcc3401 --- /dev/null +++ b/docs/admin_client/bigtable_instance_admin.rst @@ -0,0 +1,10 @@ +BigtableInstanceAdmin +--------------------------------------- + +.. automodule:: google.cloud.bigtable.admin_v2.services.bigtable_instance_admin + :members: + :inherited-members: + +.. automodule:: google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.pagers + :members: + :inherited-members: diff --git a/docs/admin_client/bigtable_table_admin.rst b/docs/admin_client/bigtable_table_admin.rst new file mode 100644 index 000000000..5937faa66 --- /dev/null +++ b/docs/admin_client/bigtable_table_admin.rst @@ -0,0 +1,10 @@ +BigtableTableAdmin +------------------------------------ + +.. automodule:: google.cloud.bigtable.admin_v2.overlay.services.bigtable_table_admin + :members: + :inherited-members: + +.. automodule:: google.cloud.bigtable.admin_v2.services.bigtable_table_admin.pagers + :members: + :inherited-members: diff --git a/docs/admin_client/services_.rst b/docs/admin_client/services_.rst new file mode 100644 index 000000000..ea55c7da1 --- /dev/null +++ b/docs/admin_client/services_.rst @@ -0,0 +1,7 @@ +Services for Google Cloud Bigtable Admin v2 API +=============================================== +.. toctree:: + :maxdepth: 2 + + bigtable_instance_admin + bigtable_table_admin diff --git a/docs/admin_client/types_.rst b/docs/admin_client/types_.rst new file mode 100644 index 000000000..60ad3229b --- /dev/null +++ b/docs/admin_client/types_.rst @@ -0,0 +1,10 @@ +Types for Google Cloud Bigtable Admin v2 API +============================================ + +.. automodule:: google.cloud.bigtable.admin_v2.types + :members: + :show-inheritance: + +.. automodule:: google.cloud.bigtable.admin_v2.overlay.types + :members: + :show-inheritance: diff --git a/docs/index.rst b/docs/index.rst index c7f9721f3..0694c8bb0 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -9,7 +9,7 @@ Client Types data_client/data_client_usage classic_client/usage - + admin_client/admin_client_usage Changelog --------- diff --git a/docs/scripts/patch_devsite_toc.py b/docs/scripts/patch_devsite_toc.py index 5889300d2..f9ccc4c2a 100644 --- a/docs/scripts/patch_devsite_toc.py +++ b/docs/scripts/patch_devsite_toc.py @@ -20,6 +20,7 @@ """ +import glob import yaml import os import shutil @@ -153,6 +154,81 @@ def copy_markdown(self): f"_build/html/docfx_yaml", ) + def validate_section(self, toc): + # Make sure each rst file is listed in the toc. + items_in_toc = [ + d["items"] for d in toc[0]["items"] if d["name"] == self.title and ".rst" + ][0] + items_in_dir = [f for f in os.listdir(self.dir_name) if f.endswith(".rst")] + # subtract 1 for index + assert len(items_in_toc) == len(items_in_dir) - 1 + for file in items_in_dir: + if file != self.index_file_name: + base_name, _ = os.path.splitext(file) + assert any(d["href"] == f"{base_name}.md" for d in items_in_toc) + # make sure the markdown files are present in the docfx_yaml directory + md_files = [d["href"] for d in items_in_toc] + for file in md_files: + assert os.path.exists(f"_build/html/docfx_yaml/{file}") + + +class UIDFilteredTocSection(TocSection): + def __init__(self, toc_file_path, section_name, title, uid_prefix): + """Creates a filtered section denoted by section_name in the toc_file_path to items with the given UID prefix. + + The section is then renamed to the title. + """ + current_toc = yaml.safe_load(open(toc_file_path, "r")) + self.uid_prefix = uid_prefix + + # Since we are looking for a specific section_name there should only + # be one match. + section_items = [ + d for d in current_toc[0]["items"] if d["name"] == section_name + ][0]["items"] + filtered_items = [d for d in section_items if d["uid"].startswith(uid_prefix)] + self.items = filtered_items + self.title = title + + def copy_markdown(self): + """ + No-op because we are filtering on UIDs, not markdown files. + """ + pass + + def validate_section(self, toc): + uids_in_toc = set() + + # A UID-filtered TOC tree looks like the following: + # - items: + # items: + # name: + # uid: + # + # Walk through the TOC tree to find all UIDs recursively. + def find_uids_in_items(items): + uids_in_toc.add(items["uid"]) + for subitem in items.get("items", []): + find_uids_in_items(subitem) + + items_in_toc = [d["items"] for d in toc[0]["items"] if d["name"] == self.title][ + 0 + ] + for item in items_in_toc: + find_uids_in_items(item) + + # Now that we have all the UIDs, first match all of them + # with corresponding .yml files. + for uid in uids_in_toc: + assert os.path.exists(f"_build/html/docfx_yaml/{uid}.yml") + + # Also validate that every uid yml file that starts with the uid_prefix + # exists in the section. + for filename in glob.glob( + f"{self.uid_prefix}*.yml", root_dir="_build/html/docfx_yaml" + ): + assert filename[:-4] in uids_in_toc + def validate_toc(toc_file_path, expected_section_list, added_sections): current_toc = yaml.safe_load(open(toc_file_path, "r")) @@ -164,38 +240,22 @@ def validate_toc(toc_file_path, expected_section_list, added_sections): # make sure each customs ection is in the toc for section in added_sections: assert section.title in found_sections - # make sure each rst file in each custom section dir is listed in the toc - for section in added_sections: - items_in_toc = [ - d["items"] - for d in current_toc[0]["items"] - if d["name"] == section.title and ".rst" - ][0] - items_in_dir = [f for f in os.listdir(section.dir_name) if f.endswith(".rst")] - # subtract 1 for index - assert len(items_in_toc) == len(items_in_dir) - 1 - for file in items_in_dir: - if file != section.index_file_name: - base_name, _ = os.path.splitext(file) - assert any(d["href"] == f"{base_name}.md" for d in items_in_toc) - # make sure the markdown files are present in the docfx_yaml directory - for section in added_sections: - items_in_toc = [ - d["items"] - for d in current_toc[0]["items"] - if d["name"] == section.title and ".rst" - ][0] - md_files = [d["href"] for d in items_in_toc] - for file in md_files: - assert os.path.exists(f"_build/html/docfx_yaml/{file}") + section.validate_section(current_toc) print("Toc validation passed") if __name__ == "__main__": # Add secrtions for the async_data_client and classic_client directories toc_path = "_build/html/docfx_yaml/toc.yml" + custom_sections = [ TocSection(dir_name="data_client", index_file_name="data_client_usage.rst"), + UIDFilteredTocSection( + toc_file_path=toc_path, + section_name="Bigtable", + title="Admin Client", + uid_prefix="google.cloud.bigtable.admin_v2", + ), TocSection(dir_name="classic_client", index_file_name="usage.rst"), ] add_sections(toc_path, custom_sections) @@ -210,6 +270,7 @@ def validate_toc(toc_file_path, expected_section_list, added_sections): "Changelog", "Multiprocessing", "Data Client", + "Admin Client", "Classic Client", ], added_sections=custom_sections, diff --git a/google/cloud/bigtable/admin/__init__.py b/google/cloud/bigtable/admin/__init__.py new file mode 100644 index 000000000..832d712d0 --- /dev/null +++ b/google/cloud/bigtable/admin/__init__.py @@ -0,0 +1,415 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +from google.cloud.bigtable.admin import gapic_version as package_version + +__version__ = package_version.__version__ + + +from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.client import ( + BigtableInstanceAdminClient, +) +from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.async_client import ( + BigtableInstanceAdminAsyncClient, +) +from google.cloud.bigtable.admin_v2.services.bigtable_table_admin.client import ( + BaseBigtableTableAdminClient, +) +from google.cloud.bigtable.admin_v2.services.bigtable_table_admin.async_client import ( + BaseBigtableTableAdminAsyncClient, +) + +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + CreateAppProfileRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + CreateClusterMetadata, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + CreateClusterRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + CreateInstanceMetadata, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + CreateInstanceRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + CreateLogicalViewMetadata, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + CreateLogicalViewRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + CreateMaterializedViewMetadata, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + CreateMaterializedViewRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + DeleteAppProfileRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + DeleteClusterRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + DeleteInstanceRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + DeleteLogicalViewRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + DeleteMaterializedViewRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + GetAppProfileRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + GetClusterRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + GetInstanceRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + GetLogicalViewRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + GetMaterializedViewRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + ListAppProfilesRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + ListAppProfilesResponse, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + ListClustersRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + ListClustersResponse, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + ListHotTabletsRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + ListHotTabletsResponse, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + ListInstancesRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + ListInstancesResponse, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + ListLogicalViewsRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + ListLogicalViewsResponse, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + ListMaterializedViewsRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + ListMaterializedViewsResponse, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + PartialUpdateClusterMetadata, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + PartialUpdateClusterRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + PartialUpdateInstanceRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + UpdateAppProfileMetadata, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + UpdateAppProfileRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + UpdateClusterMetadata, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + UpdateInstanceMetadata, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + UpdateLogicalViewMetadata, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + UpdateLogicalViewRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + UpdateMaterializedViewMetadata, +) +from google.cloud.bigtable.admin_v2.types.bigtable_instance_admin import ( + UpdateMaterializedViewRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + CheckConsistencyRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + CheckConsistencyResponse, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import CopyBackupMetadata +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import CopyBackupRequest +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + CreateAuthorizedViewMetadata, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + CreateAuthorizedViewRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + CreateBackupMetadata, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + CreateBackupRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + CreateTableFromSnapshotMetadata, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + CreateTableFromSnapshotRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import CreateTableRequest +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + DataBoostReadLocalWrites, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + DeleteAuthorizedViewRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + DeleteBackupRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + DeleteSnapshotRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import DeleteTableRequest +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + DropRowRangeRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + GenerateConsistencyTokenRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + GenerateConsistencyTokenResponse, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + GetAuthorizedViewRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import GetBackupRequest +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import GetSnapshotRequest +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import GetTableRequest +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + ListAuthorizedViewsRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + ListAuthorizedViewsResponse, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ListBackupsRequest +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + ListBackupsResponse, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + ListSnapshotsRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + ListSnapshotsResponse, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ListTablesRequest +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ListTablesResponse +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + ModifyColumnFamiliesRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + OptimizeRestoredTableMetadata, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + RestoreTableMetadata, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + RestoreTableRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + SnapshotTableMetadata, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + SnapshotTableRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + StandardReadRemoteWrites, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + UndeleteTableMetadata, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + UndeleteTableRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + UpdateAuthorizedViewMetadata, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + UpdateAuthorizedViewRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + UpdateBackupRequest, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import ( + UpdateTableMetadata, +) +from google.cloud.bigtable.admin_v2.types.bigtable_table_admin import UpdateTableRequest +from google.cloud.bigtable.admin_v2.types.common import OperationProgress +from google.cloud.bigtable.admin_v2.types.common import StorageType +from google.cloud.bigtable.admin_v2.types.instance import AppProfile +from google.cloud.bigtable.admin_v2.types.instance import AutoscalingLimits +from google.cloud.bigtable.admin_v2.types.instance import AutoscalingTargets +from google.cloud.bigtable.admin_v2.types.instance import Cluster +from google.cloud.bigtable.admin_v2.types.instance import HotTablet +from google.cloud.bigtable.admin_v2.types.instance import Instance +from google.cloud.bigtable.admin_v2.types.instance import LogicalView +from google.cloud.bigtable.admin_v2.types.instance import MaterializedView +from google.cloud.bigtable.admin_v2.types.table import AuthorizedView +from google.cloud.bigtable.admin_v2.types.table import Backup +from google.cloud.bigtable.admin_v2.types.table import BackupInfo +from google.cloud.bigtable.admin_v2.types.table import ChangeStreamConfig +from google.cloud.bigtable.admin_v2.types.table import ColumnFamily +from google.cloud.bigtable.admin_v2.types.table import EncryptionInfo +from google.cloud.bigtable.admin_v2.types.table import GcRule +from google.cloud.bigtable.admin_v2.types.table import RestoreInfo +from google.cloud.bigtable.admin_v2.types.table import Snapshot +from google.cloud.bigtable.admin_v2.types.table import Table +from google.cloud.bigtable.admin_v2.types.table import RestoreSourceType +from google.cloud.bigtable.admin_v2.types.types import Type + +__all__ = ( + "BigtableInstanceAdminClient", + "BigtableInstanceAdminAsyncClient", + "BaseBigtableTableAdminClient", + "BaseBigtableTableAdminAsyncClient", + "CreateAppProfileRequest", + "CreateClusterMetadata", + "CreateClusterRequest", + "CreateInstanceMetadata", + "CreateInstanceRequest", + "CreateLogicalViewMetadata", + "CreateLogicalViewRequest", + "CreateMaterializedViewMetadata", + "CreateMaterializedViewRequest", + "DeleteAppProfileRequest", + "DeleteClusterRequest", + "DeleteInstanceRequest", + "DeleteLogicalViewRequest", + "DeleteMaterializedViewRequest", + "GetAppProfileRequest", + "GetClusterRequest", + "GetInstanceRequest", + "GetLogicalViewRequest", + "GetMaterializedViewRequest", + "ListAppProfilesRequest", + "ListAppProfilesResponse", + "ListClustersRequest", + "ListClustersResponse", + "ListHotTabletsRequest", + "ListHotTabletsResponse", + "ListInstancesRequest", + "ListInstancesResponse", + "ListLogicalViewsRequest", + "ListLogicalViewsResponse", + "ListMaterializedViewsRequest", + "ListMaterializedViewsResponse", + "PartialUpdateClusterMetadata", + "PartialUpdateClusterRequest", + "PartialUpdateInstanceRequest", + "UpdateAppProfileMetadata", + "UpdateAppProfileRequest", + "UpdateClusterMetadata", + "UpdateInstanceMetadata", + "UpdateLogicalViewMetadata", + "UpdateLogicalViewRequest", + "UpdateMaterializedViewMetadata", + "UpdateMaterializedViewRequest", + "CheckConsistencyRequest", + "CheckConsistencyResponse", + "CopyBackupMetadata", + "CopyBackupRequest", + "CreateAuthorizedViewMetadata", + "CreateAuthorizedViewRequest", + "CreateBackupMetadata", + "CreateBackupRequest", + "CreateTableFromSnapshotMetadata", + "CreateTableFromSnapshotRequest", + "CreateTableRequest", + "DataBoostReadLocalWrites", + "DeleteAuthorizedViewRequest", + "DeleteBackupRequest", + "DeleteSnapshotRequest", + "DeleteTableRequest", + "DropRowRangeRequest", + "GenerateConsistencyTokenRequest", + "GenerateConsistencyTokenResponse", + "GetAuthorizedViewRequest", + "GetBackupRequest", + "GetSnapshotRequest", + "GetTableRequest", + "ListAuthorizedViewsRequest", + "ListAuthorizedViewsResponse", + "ListBackupsRequest", + "ListBackupsResponse", + "ListSnapshotsRequest", + "ListSnapshotsResponse", + "ListTablesRequest", + "ListTablesResponse", + "ModifyColumnFamiliesRequest", + "OptimizeRestoredTableMetadata", + "RestoreTableMetadata", + "RestoreTableRequest", + "SnapshotTableMetadata", + "SnapshotTableRequest", + "StandardReadRemoteWrites", + "UndeleteTableMetadata", + "UndeleteTableRequest", + "UpdateAuthorizedViewMetadata", + "UpdateAuthorizedViewRequest", + "UpdateBackupRequest", + "UpdateTableMetadata", + "UpdateTableRequest", + "OperationProgress", + "StorageType", + "AppProfile", + "AutoscalingLimits", + "AutoscalingTargets", + "Cluster", + "HotTablet", + "Instance", + "LogicalView", + "MaterializedView", + "AuthorizedView", + "Backup", + "BackupInfo", + "ChangeStreamConfig", + "ColumnFamily", + "EncryptionInfo", + "GcRule", + "RestoreInfo", + "Snapshot", + "Table", + "RestoreSourceType", + "Type", +) + +import google.cloud.bigtable.admin_v2.overlay # noqa: F401 +from google.cloud.bigtable.admin_v2.overlay import * # noqa: F401, F403 + +__all__ += google.cloud.bigtable.admin_v2.overlay.__all__ diff --git a/google/cloud/bigtable_admin/gapic_version.py b/google/cloud/bigtable/admin/gapic_version.py similarity index 95% rename from google/cloud/bigtable_admin/gapic_version.py rename to google/cloud/bigtable/admin/gapic_version.py index 8202296bf..70941e77a 100644 --- a/google/cloud/bigtable_admin/gapic_version.py +++ b/google/cloud/bigtable/admin/gapic_version.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/bigtable_admin/py.typed b/google/cloud/bigtable/admin/py.typed similarity index 100% rename from google/cloud/bigtable_admin/py.typed rename to google/cloud/bigtable/admin/py.typed diff --git a/google/cloud/bigtable_admin_v2/__init__.py b/google/cloud/bigtable/admin_v2/__init__.py similarity index 96% rename from google/cloud/bigtable_admin_v2/__init__.py rename to google/cloud/bigtable/admin_v2/__init__.py index 4ee0cc6b1..01c218109 100644 --- a/google/cloud/bigtable_admin_v2/__init__.py +++ b/google/cloud/bigtable/admin_v2/__init__.py @@ -13,15 +13,15 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from google.cloud.bigtable_admin_v2 import gapic_version as package_version +from google.cloud.bigtable.admin_v2 import gapic_version as package_version __version__ = package_version.__version__ from .services.bigtable_instance_admin import BigtableInstanceAdminClient from .services.bigtable_instance_admin import BigtableInstanceAdminAsyncClient -from .services.bigtable_table_admin import BigtableTableAdminClient -from .services.bigtable_table_admin import BigtableTableAdminAsyncClient +from .services.bigtable_table_admin import BaseBigtableTableAdminClient +from .services.bigtable_table_admin import BaseBigtableTableAdminAsyncClient from .types.bigtable_instance_admin import CreateAppProfileRequest from .types.bigtable_instance_admin import CreateClusterMetadata @@ -134,16 +134,16 @@ from .types.types import Type __all__ = ( + "BaseBigtableTableAdminAsyncClient", "BigtableInstanceAdminAsyncClient", - "BigtableTableAdminAsyncClient", "AppProfile", "AuthorizedView", "AutoscalingLimits", "AutoscalingTargets", "Backup", "BackupInfo", + "BaseBigtableTableAdminClient", "BigtableInstanceAdminClient", - "BigtableTableAdminClient", "ChangeStreamConfig", "CheckConsistencyRequest", "CheckConsistencyResponse", @@ -248,3 +248,7 @@ "UpdateTableMetadata", "UpdateTableRequest", ) + +from .overlay import * # noqa: F403 + +__all__ += overlay.__all__ # noqa: F405 diff --git a/google/cloud/bigtable_admin_v2/gapic_metadata.json b/google/cloud/bigtable/admin_v2/gapic_metadata.json similarity index 96% rename from google/cloud/bigtable_admin_v2/gapic_metadata.json rename to google/cloud/bigtable/admin_v2/gapic_metadata.json index c56fde6e7..4be106a69 100644 --- a/google/cloud/bigtable_admin_v2/gapic_metadata.json +++ b/google/cloud/bigtable/admin_v2/gapic_metadata.json @@ -1,7 +1,7 @@ { "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", "language": "python", - "libraryPackage": "google.cloud.bigtable_admin_v2", + "libraryPackage": "google.cloud.bigtable.admin_v2", "protoPackage": "google.bigtable.admin.v2", "schema": "1.0", "services": { @@ -492,7 +492,7 @@ "BigtableTableAdmin": { "clients": { "grpc": { - "libraryClient": "BigtableTableAdminClient", + "libraryClient": "BaseBigtableTableAdminClient", "rpcs": { "CheckConsistency": { "methods": [ @@ -536,7 +536,7 @@ }, "DeleteSnapshot": { "methods": [ - "delete_snapshot" + "_delete_snapshot" ] }, "DeleteTable": { @@ -571,7 +571,7 @@ }, "GetSnapshot": { "methods": [ - "get_snapshot" + "_get_snapshot" ] }, "GetTable": { @@ -591,7 +591,7 @@ }, "ListSnapshots": { "methods": [ - "list_snapshots" + "_list_snapshots" ] }, "ListTables": { @@ -601,12 +601,12 @@ }, "ModifyColumnFamilies": { "methods": [ - "modify_column_families" + "_modify_column_families" ] }, "RestoreTable": { "methods": [ - "restore_table" + "_restore_table" ] }, "SetIamPolicy": { @@ -616,7 +616,7 @@ }, "SnapshotTable": { "methods": [ - "snapshot_table" + "_snapshot_table" ] }, "TestIamPermissions": { @@ -647,7 +647,7 @@ } }, "grpc-async": { - "libraryClient": "BigtableTableAdminAsyncClient", + "libraryClient": "BaseBigtableTableAdminAsyncClient", "rpcs": { "CheckConsistency": { "methods": [ @@ -691,7 +691,7 @@ }, "DeleteSnapshot": { "methods": [ - "delete_snapshot" + "_delete_snapshot" ] }, "DeleteTable": { @@ -726,7 +726,7 @@ }, "GetSnapshot": { "methods": [ - "get_snapshot" + "_get_snapshot" ] }, "GetTable": { @@ -746,7 +746,7 @@ }, "ListSnapshots": { "methods": [ - "list_snapshots" + "_list_snapshots" ] }, "ListTables": { @@ -756,12 +756,12 @@ }, "ModifyColumnFamilies": { "methods": [ - "modify_column_families" + "_modify_column_families" ] }, "RestoreTable": { "methods": [ - "restore_table" + "_restore_table" ] }, "SetIamPolicy": { @@ -771,7 +771,7 @@ }, "SnapshotTable": { "methods": [ - "snapshot_table" + "_snapshot_table" ] }, "TestIamPermissions": { @@ -802,7 +802,7 @@ } }, "rest": { - "libraryClient": "BigtableTableAdminClient", + "libraryClient": "BaseBigtableTableAdminClient", "rpcs": { "CheckConsistency": { "methods": [ @@ -846,7 +846,7 @@ }, "DeleteSnapshot": { "methods": [ - "delete_snapshot" + "_delete_snapshot" ] }, "DeleteTable": { @@ -881,7 +881,7 @@ }, "GetSnapshot": { "methods": [ - "get_snapshot" + "_get_snapshot" ] }, "GetTable": { @@ -901,7 +901,7 @@ }, "ListSnapshots": { "methods": [ - "list_snapshots" + "_list_snapshots" ] }, "ListTables": { @@ -911,12 +911,12 @@ }, "ModifyColumnFamilies": { "methods": [ - "modify_column_families" + "_modify_column_families" ] }, "RestoreTable": { "methods": [ - "restore_table" + "_restore_table" ] }, "SetIamPolicy": { @@ -926,7 +926,7 @@ }, "SnapshotTable": { "methods": [ - "snapshot_table" + "_snapshot_table" ] }, "TestIamPermissions": { diff --git a/google/cloud/bigtable_admin_v2/gapic_version.py b/google/cloud/bigtable/admin_v2/gapic_version.py similarity index 95% rename from google/cloud/bigtable_admin_v2/gapic_version.py rename to google/cloud/bigtable/admin_v2/gapic_version.py index 8202296bf..70941e77a 100644 --- a/google/cloud/bigtable_admin_v2/gapic_version.py +++ b/google/cloud/bigtable/admin_v2/gapic_version.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# Copyright 2022 Google LLC +# Copyright 2025 Google LLC # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. diff --git a/google/cloud/bigtable/admin_v2/overlay/__init__.py b/google/cloud/bigtable/admin_v2/overlay/__init__.py new file mode 100644 index 000000000..352f1af7e --- /dev/null +++ b/google/cloud/bigtable/admin_v2/overlay/__init__.py @@ -0,0 +1,45 @@ +# Copyright 2025 Google LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# This directory and all its subdirectories are the only handwritten +# components of the otherwise autogenerated google/cloud/bigtable/admin_v2. +# The purpose of the overlay directory is to add additional functionality to +# the autogenerated library while preserving its developer experience. These +# handwritten additions currently consist of the following: +# +# 1. TODO: Document final GcRule design choice here +# 2. An LRO class for restore_table that exposes an Operation for +# OptimizeRestoreTable, if that LRO exists. +# 3. New methods (wait_for_consistency and wait_for_replication) that return +# a polling future class for automatically polling check_consistency. +# +# This directory is structured to mirror that of a typical autogenerated library (e.g. +# services/types subdirectories), and the aforementioned handwritten additions are +# currently implemented as either types under overlay/types or in methods in an overwritten +# client class under overlay/services. + +from .types import ( + RestoreTableOperation, + CheckConsistencyPollingFuture, +) + +from .services.bigtable_table_admin import ( + BigtableTableAdminClient, +) + +__all__ = ( + "RestoreTableOperation", + "CheckConsistencyPollingFuture", + "BigtableTableAdminClient", +) diff --git a/google/cloud/bigtable/admin_v2/overlay/services/__init__.py b/google/cloud/bigtable/admin_v2/overlay/services/__init__.py new file mode 100644 index 000000000..ab7686e26 --- /dev/null +++ b/google/cloud/bigtable/admin_v2/overlay/services/__init__.py @@ -0,0 +1,13 @@ +# Copyright 2025 Google LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. diff --git a/google/cloud/bigtable/admin_v2/overlay/services/bigtable_table_admin/__init__.py b/google/cloud/bigtable/admin_v2/overlay/services/bigtable_table_admin/__init__.py new file mode 100644 index 000000000..ec9de1382 --- /dev/null +++ b/google/cloud/bigtable/admin_v2/overlay/services/bigtable_table_admin/__init__.py @@ -0,0 +1,19 @@ +# Copyright 2025 Google LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# TODO: Add the async client after owlbot changes. + +from .client import BigtableTableAdminClient + +__all__ = ("BigtableTableAdminClient",) diff --git a/google/cloud/bigtable/admin_v2/overlay/services/bigtable_table_admin/client.py b/google/cloud/bigtable/admin_v2/overlay/services/bigtable_table_admin/client.py new file mode 100644 index 000000000..c9e7fe972 --- /dev/null +++ b/google/cloud/bigtable/admin_v2/overlay/services/bigtable_table_admin/client.py @@ -0,0 +1,420 @@ +# Copyright 2025 Google LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import copy +import functools + +from typing import Callable, Optional, Sequence, Tuple, Union +from google.api_core import gapic_v1 +from google.api_core import retry as retries + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object, None] # type: ignore + +from google.api_core import client_options as client_options_lib +from google.auth import credentials as ga_credentials # type: ignore + +from google.cloud.bigtable.admin_v2.types import bigtable_table_admin + +from google.cloud.bigtable.admin_v2.services.bigtable_table_admin import ( + client as base_client, +) +from google.cloud.bigtable.admin_v2.services.bigtable_table_admin.transports.base import ( + BigtableTableAdminTransport, +) +from google.cloud.bigtable.admin_v2.overlay.types import consistency, restore_table + +from google.cloud.bigtable.gapic_version import __version__ as bigtable_version + + +DEFAULT_CLIENT_INFO = copy.copy(base_client.DEFAULT_CLIENT_INFO) +DEFAULT_CLIENT_INFO.client_library_version = f"{bigtable_version}-admin-overlay" + + +class BigtableTableAdminClient(base_client.BaseBigtableTableAdminClient): + def __init__( + self, + *, + credentials: Optional[ga_credentials.Credentials] = None, + transport: Optional[ + Union[ + str, + BigtableTableAdminTransport, + Callable[..., BigtableTableAdminTransport], + ] + ] = None, + client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, + client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, + ) -> None: + """Instantiates the Bigtable table admin client. + + Args: + credentials (Optional[google.auth.credentials.Credentials]): The + authorization credentials to attach to requests. These + credentials identify the application to the service; if none + are specified, the client will attempt to ascertain the + credentials from the environment. + transport (Optional[Union[str,BigtableTableAdminTransport,Callable[..., BigtableTableAdminTransport]]]): + The transport to use, or a Callable that constructs and returns a new transport. + If a Callable is given, it will be called with the same set of initialization + arguments as used in the BigtableTableAdminTransport constructor. + If set to None, a transport is chosen automatically. + client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]): + Custom options for the client. + + 1. The ``api_endpoint`` property can be used to override the + default endpoint provided by the client when ``transport`` is + not explicitly provided. Only if this property is not set and + ``transport`` was not explicitly provided, the endpoint is + determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment + variable, which have one of the following values: + "always" (always use the default mTLS endpoint), "never" (always + use the default regular endpoint) and "auto" (auto-switch to the + default mTLS endpoint if client certificate is present; this is + the default value). + + 2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable + is "true", then the ``client_cert_source`` property can be used + to provide a client certificate for mTLS transport. If + not provided, the default SSL client certificate will be used if + present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not + set, no client certificate will be used. + + 3. The ``universe_domain`` property can be used to override the + default "googleapis.com" universe. Note that the ``api_endpoint`` + property still takes precedence; and ``universe_domain`` is + currently not supported for mTLS. + + client_info (google.api_core.gapic_v1.client_info.ClientInfo): + The client info used to send a user-agent string along with + API requests. If ``None``, then default info will be used. + Generally, you only need to set this if you're developing + your own client library. + + Raises: + google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport + creation failed for any reason. + """ + super(BigtableTableAdminClient, self).__init__( + credentials=credentials, + transport=transport, + client_options=client_options, + client_info=client_info, + ) + + def restore_table( + self, + request: Optional[Union[bigtable_table_admin.RestoreTableRequest, dict]] = None, + *, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> restore_table.RestoreTableOperation: + r"""Create a new table by restoring from a completed backup. The + returned table :class:`long-running operation + ` + can be used to track the progress of the operation, and to cancel it. The + :attr:`metadata ` field type is + :class:`RestoreTableMetadata `. + The :meth:`response ` type is + :class:`google.cloud.bigtable.admin_v2.types.Table`, if successful. + + Additionally, the returned :class:`long-running-operation ` + provides a method, :meth:`google.cloud.bigtable.admin_v2.overlay.types.restore_table.RestoreTableOperation.optimize_restore_table_operation` that + provides access to a :class:`google.api_core.operation.Operation` object representing the OptimizeRestoreTable long-running-operation + after the current one has completed. + + .. code-block:: python + + # This snippet should be regarded as a code template only. + # + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_restore_table(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.RestoreTableRequest( + backup="backup_value", + parent="parent_value", + table_id="table_id_value", + ) + + # Make the request + operation = client.restore_table(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + + # Handle LRO2 + optimize_operation = operation.optimize_restore_table_operation() + + if optimize_operation: + print("Waiting for table optimization to complete...") + + response = optimize_operation.result() + + Args: + request (Union[google.cloud.bigtable.admin_v2.types.RestoreTableRequest, dict]): + The request object. The request for + [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.bigtable.admin_v2.overlay.types.restore_table.RestoreTableOperation: + An object representing a long-running operation. + + 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. + Each table is served using the resources of its + parent cluster. + """ + operation = self._restore_table( + request=request, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + restore_table_operation = restore_table.RestoreTableOperation( + self._transport.operations_client, operation + ) + return restore_table_operation + + def wait_for_consistency( + self, + request: Optional[ + Union[bigtable_table_admin.CheckConsistencyRequest, dict] + ] = None, + *, + name: Optional[str] = None, + consistency_token: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> consistency.CheckConsistencyPollingFuture: + r"""Creates a polling future that periodically checks replication + consistency based on a consistency token, that is, if replication + has caught up based on the conditions specified in the token and + the check request. The future will stop checking once the underlying + :meth:`check_consistency` request involving that token returns True. + + .. code-block:: python + + # This snippet should be regarded as a code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_wait_for_consistency(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.CheckConsistencyRequest( + name="name_value", + consistency_token="consistency_token_value", + ) + + # Make the request + future = client.wait_for_consistency(request=request) + + # Wait for the table to become consistent + print("Waiting for operation to complete...") + + response = future.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.bigtable.admin_v2.types.CheckConsistencyRequest, dict]): + The request object. Request message for + [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency] + name (str): + Required. The unique name of the Table for which to + check replication consistency. Values are of the form + ``projects/{project}/instances/{instance}/tables/{table}``. + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + consistency_token (str): + Required. The token created using + GenerateConsistencyToken for the Table. + + This corresponds to the ``consistency_token`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.bigtable.admin_v2.overlay.types.CheckConsistencyPollingFuture: + An object representing a polling future. + + The result type for the operation will be `bool`, and will return True when the + consistency check involving the given consistency token returns True. + """ + api_call = functools.partial( + self.check_consistency, + request, + name=name, + consistency_token=consistency_token, + timeout=timeout, + metadata=metadata, + ) + return consistency.CheckConsistencyPollingFuture(api_call, default_retry=retry) + + def wait_for_replication( + self, + request: Optional[ + Union[bigtable_table_admin.GenerateConsistencyTokenRequest, dict] + ] = None, + *, + name: Optional[str] = None, + retry: OptionalRetry = gapic_v1.method.DEFAULT, + timeout: Union[float, object] = gapic_v1.method.DEFAULT, + metadata: Sequence[Tuple[str, Union[str, bytes]]] = (), + ) -> consistency.CheckConsistencyPollingFuture: + r"""Generates a consistency token for a Table, which will then + be used to create a polling future for checking the replication + consistency based on that token. The future will stop checking + once the underlying :meth:`check_consistency` request involving + that token returns True. + + .. code-block:: python + + # This snippet should be regarded as a code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_wait_for_replication(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.GenerateConsistencyTokenRequest( + name="name_value", + ) + + # Make the request + future = client.wait_for_replication(request=request) + + # Wait for the table to become consistent + print("Waiting for operation to complete...") + + response = future.result() + + # Handle the response + print(response) + + Args: + request (Union[google.cloud.bigtable.admin_v2.types.GenerateConsistencyTokenRequest, dict]): + The request object. Request message for + [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken] + name (str): + Required. The unique name of the Table for which to + create a consistency token. Values are of the form + ``projects/{project}/instances/{instance}/tables/{table}``. + + This corresponds to the ``name`` field + on the ``request`` instance; if ``request`` is provided, this + should not be set. + retry (google.api_core.retry.Retry): Designation of what errors, if any, + should be retried. + timeout (float): The timeout for this request. + metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be + sent along with the request as metadata. Normally, each value must be of type `str`, + but for metadata keys ending with the suffix `-bin`, the corresponding values must + be of type `bytes`. + + Returns: + google.cloud.bigtable.admin_v2.overlay.types.CheckConsistencyPollingFuture: + An object representing a polling future. + + The result type for the operation will be `bool`, and will return True when the + consistency check involving the given consistency token returns True. + """ + generate_consistency_response = self.generate_consistency_token( + request, + name=name, + retry=retry, + timeout=timeout, + metadata=metadata, + ) + + # Create the CheckConsistencyRequest object. + check_consistency_request = bigtable_table_admin.CheckConsistencyRequest() + + # If the generate_consistency_token request is valid, there's a name in the request object + # or the name parameter. + if isinstance(request, dict): + check_consistency_request.name = request["name"] + elif isinstance(request, bigtable_table_admin.GenerateConsistencyTokenRequest): + check_consistency_request.name = request.name + else: + check_consistency_request.name = name + + check_consistency_request.consistency_token = ( + generate_consistency_response.consistency_token + ) + + return self.wait_for_consistency( + check_consistency_request, retry=retry, timeout=timeout, metadata=metadata + ) diff --git a/google/cloud/bigtable/admin_v2/overlay/types/__init__.py b/google/cloud/bigtable/admin_v2/overlay/types/__init__.py new file mode 100644 index 000000000..01b1f7115 --- /dev/null +++ b/google/cloud/bigtable/admin_v2/overlay/types/__init__.py @@ -0,0 +1,26 @@ +# Copyright 2025 Google LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from .consistency import ( + CheckConsistencyPollingFuture, +) + +from .restore_table import ( + RestoreTableOperation, +) + +__all__ = ( + "CheckConsistencyPollingFuture", + "RestoreTableOperation", +) diff --git a/google/cloud/bigtable/admin_v2/overlay/types/consistency.py b/google/cloud/bigtable/admin_v2/overlay/types/consistency.py new file mode 100644 index 000000000..9c3772f2d --- /dev/null +++ b/google/cloud/bigtable/admin_v2/overlay/types/consistency.py @@ -0,0 +1,110 @@ +# Copyright 2025 Google LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from typing import Union, Callable + +from google.api_core.future import polling +from google.api_core import gapic_v1 +from google.api_core import retry as retries +from google.cloud.bigtable.admin_v2.types import bigtable_table_admin + +try: + OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] +except AttributeError: # pragma: NO COVER + OptionalRetry = Union[retries.Retry, object, None] # type: ignore + + +class CheckConsistencyPollingFuture(polling.PollingFuture): + """A Future that polls an underlying `check_consistency` operation until it returns True. + + **This class should not be instantiated by users** and should only be instantiated by the admin + client's + :meth:`google.cloud.bigtable.admin_v2.overlay.services.bigtable_table_admin.BigtableTableAdminClient.wait_for_consistency` + or + :meth:`google.cloud.bigtable.admin_v2.overlay.services.bigtable_table_admin.BigtableTableAdminClient.wait_for_replication` + methods. + + Args: + check_consistency_call(Callable[ + [Optional[google.api_core.retry.Retry], + google.cloud.bigtable.admin_v2.types.CheckConsistencyResponse]): + A :meth:`check_consistency + ` + call from the admin client. The call should fix every user parameter except for retry, + which will be done via :meth:`functools.partial`. + default_retry(Optional[google.api_core.retry.Retry]): The `retry` parameter passed in to either + :meth:`wait_for_consistency + ` + or :meth:`wait_for_replication + ` + polling (google.api_core.retry.Retry): The configuration used for polling. + This parameter controls how often :meth:`done` is polled. If the + ``timeout`` argument is specified in the :meth:`result + ` method it will + override the ``polling.timeout`` property. + """ + + def __init__( + self, + check_consistency_call: Callable[ + [OptionalRetry], bigtable_table_admin.CheckConsistencyResponse + ], + default_retry: OptionalRetry = gapic_v1.method.DEFAULT, + polling: retries.Retry = polling.DEFAULT_POLLING, + **kwargs + ): + super(CheckConsistencyPollingFuture, self).__init__(polling=polling, **kwargs) + + # Done is called with two different scenarios, retry is specified or not specified. + # API_call will be a functools partial with everything except retry specified because of + # that. + self._check_consistency_call = check_consistency_call + self._default_retry = default_retry + + def done(self, retry: OptionalRetry = None): + """Polls the underlying `check_consistency` call to see if the future is complete. + + This should not be used by the user to wait until the `check_consistency` call finishes; + use the :meth:`result ` method of + this class instead. + + Args: + retry (google.api_core.retry.Retry): (Optional) How to retry the + polling RPC (to not be confused with polling configuration. See + the documentation for :meth:`result ` + for details). + + Returns: + bool: True if the future is complete, False otherwise. + """ + + if self._result_set: + return True + + retry = retry or self._default_retry + + try: + check_consistency_response = self._check_consistency_call(retry=retry) + if check_consistency_response.consistent: + self.set_result(True) + + return check_consistency_response.consistent + except Exception as e: + self.set_exception(e) + + def cancel(self): + raise NotImplementedError("Cannot cancel consistency token operation") + + def cancelled(self): + raise NotImplementedError("Cannot cancel consistency token operation") diff --git a/google/cloud/bigtable/admin_v2/overlay/types/restore_table.py b/google/cloud/bigtable/admin_v2/overlay/types/restore_table.py new file mode 100644 index 000000000..c346a6b79 --- /dev/null +++ b/google/cloud/bigtable/admin_v2/overlay/types/restore_table.py @@ -0,0 +1,127 @@ +# Copyright 2025 Google LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import enum +from typing import Optional, Union + +from google.api_core import retry +from google.api_core import operation +from google.protobuf import empty_pb2 + +from google.cloud.bigtable.admin_v2.types import OptimizeRestoredTableMetadata + + +# This is needed due to a documentation issue with using object() as the default +# value for a parameter. +class Timeout(enum.Enum): + DEFAULT_TIMEOUT = "DEFAULT_TIMEOUT" + + +class RestoreTableOperation(operation.Operation): + """A Future for interacting with Bigtable Admin's RestoreTable Long-Running Operation. + + This is needed to expose a potential long-running operation that might run after this operation + finishes, OptimizeRestoreTable. This is exposed via the the :meth:`optimize_restore_table_operation` + method. + + **This class should not be instantiated by users** and should only be instantiated by the admin + client's :meth:`restore_table + ` + method. + + Args: + operations_client (google.api_core.operations_v1.AbstractOperationsClient): The operations + client from the admin client class's transport. + restore_table_operation (google.api_core.operation.Operation): A :class:`google.api_core.operation.Operation` + instance resembling a RestoreTable long-running operation + """ + + def __init__(self, operations_client, restore_table_operation: operation.Operation): + self._operations_client = operations_client + self._optimize_restored_table_operation = None + super().__init__( + restore_table_operation._operation, + restore_table_operation._refresh, + restore_table_operation._cancel, + restore_table_operation._result_type, + restore_table_operation._metadata_type, + polling=restore_table_operation._polling, + ) + + def optimize_restored_table_operation( + self, + timeout: Optional[Union[int, Timeout]] = Timeout.DEFAULT_TIMEOUT, + retry: Optional[retry.Retry] = None, + polling: Optional[retry.Retry] = None, + ) -> Optional[operation.Operation]: + """Gets the OptimizeRestoredTable long-running operation that runs after this operation finishes. + + This is a blocking call that will return the operation after this current long-running operation + finishes, just like :meth:`google.api_core.operation.Operation.result`. The follow-up operation has + :attr:`metadata ` type + :class:`OptimizeRestoredTableMetadata + ` + and no return value, but can be waited for with `result`. + + The current operation might not trigger a follow-up OptimizeRestoredTable operation, in which case, this + method will return `None`. + + Args: + timeout (Optional[int | google.cloud.bigtable.admin_v2.overlay.types.restore_table.Timeout]): + How long (in seconds) to wait for the operation to complete. If None, wait indefinitely. If + `Timeout.DEFAULT_TIMEOUT`, wait the default amount. + retry (Optional[google.api_core.retry.Retry]): How to retry the polling RPC. This defines ONLY + how the polling RPC call is retried (i.e. what to do if the RPC we used for polling returned + an error). It does NOT define how the polling is done (i.e. how frequently and for how long + to call the polling RPC). + polling (Optional[google.api_core.retry.Retry]): How often and for how long to call polling RPC + periodically. This parameter does NOT define how to retry each individual polling RPC call + (use the `retry` parameter for that). + + Returns: + Optional[google.api_core.operation.Operation]: + An object representing a long-running operation, or None if there is no OptimizeRestoredTable operation + after this one. + """ + if timeout == Timeout.DEFAULT_TIMEOUT: + timeout = operation.Operation._DEFAULT_VALUE + + self._blocking_poll(timeout=timeout, retry=retry, polling=polling) + + if self._exception is not None: + # pylint: disable=raising-bad-type + # Pylint doesn't recognize that this is valid in this case. + raise self._exception + + return self._optimize_restored_table_operation + + def set_result(self, response): + optimize_restored_table_operation_name = ( + self.metadata.optimize_table_operation_name + ) + + # When the RestoreTable operation finishes, it might not necessarily trigger + # an optimize operation. + if optimize_restored_table_operation_name: + optimize_restore_table_operation = self._operations_client.get_operation( + name=optimize_restored_table_operation_name + ) + self._optimize_restored_table_operation = operation.from_gapic( + optimize_restore_table_operation, + self._operations_client, + empty_pb2.Empty, + metadata_type=OptimizeRestoredTableMetadata, + ) + + super().set_result(response) diff --git a/google/cloud/bigtable_admin_v2/py.typed b/google/cloud/bigtable/admin_v2/py.typed similarity index 100% rename from google/cloud/bigtable_admin_v2/py.typed rename to google/cloud/bigtable/admin_v2/py.typed diff --git a/google/cloud/bigtable_admin_v2/services/__init__.py b/google/cloud/bigtable/admin_v2/services/__init__.py similarity index 100% rename from google/cloud/bigtable_admin_v2/services/__init__.py rename to google/cloud/bigtable/admin_v2/services/__init__.py diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/__init__.py b/google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/__init__.py similarity index 100% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/__init__.py rename to google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/__init__.py diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/async_client.py b/google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/async_client.py similarity index 78% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/async_client.py rename to google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/async_client.py index a9c7ebc21..1d89dc172 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/async_client.py +++ b/google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/async_client.py @@ -29,7 +29,7 @@ Union, ) -from google.cloud.bigtable_admin_v2 import gapic_version as package_version +from google.cloud.bigtable.admin_v2 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -37,6 +37,7 @@ from google.api_core import retry_async as retries from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import google.protobuf try: @@ -46,11 +47,11 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore -from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import pagers -from google.cloud.bigtable_admin_v2.types import bigtable_instance_admin -from google.cloud.bigtable_admin_v2.types import common -from google.cloud.bigtable_admin_v2.types import instance -from google.cloud.bigtable_admin_v2.types import instance as gba_instance +from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import pagers +from google.cloud.bigtable.admin_v2.types import bigtable_instance_admin +from google.cloud.bigtable.admin_v2.types import common +from google.cloud.bigtable.admin_v2.types import instance +from google.cloud.bigtable.admin_v2.types import instance as gba_instance from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore @@ -353,8 +354,43 @@ async def create_instance( scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_create_instance(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + instance = admin_v2.Instance() + instance.display_name = "display_name_value" + + request = admin_v2.CreateInstanceRequest( + parent="parent_value", + instance_id="instance_id_value", + instance=instance, + ) + + # Make the request + operation = client.create_instance(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateInstanceRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.CreateInstanceRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.CreateInstance. parent (:class:`str`): @@ -373,14 +409,14 @@ async def create_instance( This corresponds to the ``instance_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - instance (:class:`google.cloud.bigtable_admin_v2.types.Instance`): + instance (:class:`google.cloud.bigtable.admin_v2.types.Instance`): Required. The instance to create. Fields marked ``OutputOnly`` must be left blank. This corresponds to the ``instance`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - clusters (:class:`MutableMapping[str, google.cloud.bigtable_admin_v2.types.Cluster]`): + clusters (:class:`MutableMapping[str, google.cloud.bigtable.admin_v2.types.Cluster]`): Required. The clusters to be created within the instance, mapped by desired cluster ID, e.g., just ``mycluster`` rather than @@ -402,7 +438,7 @@ async def create_instance( google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Instance` A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and + The result type for the operation will be :class:`google.cloud.bigtable.admin_v2.types.Instance` A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and the resources that serve them. All tables in an instance are served from all [Clusters][google.bigtable.admin.v2.Cluster] in the @@ -486,8 +522,34 @@ async def get_instance( ) -> instance.Instance: r"""Gets information about an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_get_instance(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.GetInstanceRequest( + name="name_value", + ) + + # Make the request + response = await client.get_instance(request=request) + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetInstanceRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.GetInstanceRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.GetInstance. name (:class:`str`): @@ -507,7 +569,7 @@ async def get_instance( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Instance: + google.cloud.bigtable.admin_v2.types.Instance: A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and the resources that serve them. All tables in an instance are served from all @@ -577,8 +639,34 @@ async def list_instances( ) -> bigtable_instance_admin.ListInstancesResponse: r"""Lists information about instances in a project. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_list_instances(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ListInstancesRequest( + parent="parent_value", + ) + + # Make the request + response = await client.list_instances(request=request) + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListInstancesRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.ListInstancesRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.ListInstances. parent (:class:`str`): @@ -598,7 +686,7 @@ async def list_instances( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.ListInstancesResponse: + google.cloud.bigtable.admin_v2.types.ListInstancesResponse: Response message for BigtableInstanceAdmin.ListInstances. @@ -665,8 +753,34 @@ async def update_instance( To update other Instance properties, such as labels, use PartialUpdateInstance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_update_instance(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.Instance( + display_name="display_name_value", + ) + + # Make the request + response = await client.update_instance(request=request) + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.Instance, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.Instance, dict]]): The request object. A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and the resources that serve them. All tables in an instance are @@ -682,7 +796,7 @@ async def update_instance( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Instance: + google.cloud.bigtable.admin_v2.types.Instance: A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and the resources that serve them. All tables in an instance are served from all @@ -738,11 +852,44 @@ async def partial_update_instance( method can modify all fields of an Instance and is the preferred way to update an Instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_partial_update_instance(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + instance = admin_v2.Instance() + instance.display_name = "display_name_value" + + request = admin_v2.PartialUpdateInstanceRequest( + instance=instance, + ) + + # Make the request + operation = client.partial_update_instance(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.PartialUpdateInstanceRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.PartialUpdateInstanceRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.PartialUpdateInstance. - instance (:class:`google.cloud.bigtable_admin_v2.types.Instance`): + instance (:class:`google.cloud.bigtable.admin_v2.types.Instance`): Required. The Instance which will (partially) replace the current value. @@ -769,7 +916,7 @@ async def partial_update_instance( google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Instance` A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and + The result type for the operation will be :class:`google.cloud.bigtable.admin_v2.types.Instance` A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and the resources that serve them. All tables in an instance are served from all [Clusters][google.bigtable.admin.v2.Cluster] in the @@ -852,8 +999,31 @@ async def delete_instance( ) -> None: r"""Delete an instance from a project. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_delete_instance(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.DeleteInstanceRequest( + name="name_value", + ) + + # Make the request + await client.delete_instance(request=request) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteInstanceRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.DeleteInstanceRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.DeleteInstance. name (:class:`str`): @@ -939,8 +1109,39 @@ async def create_cluster( scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_create_cluster(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.CreateClusterRequest( + parent="parent_value", + cluster_id="cluster_id_value", + ) + + # Make the request + operation = client.create_cluster(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateClusterRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.CreateClusterRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.CreateCluster. parent (:class:`str`): @@ -960,7 +1161,7 @@ async def create_cluster( This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster (:class:`google.cloud.bigtable_admin_v2.types.Cluster`): + cluster (:class:`google.cloud.bigtable.admin_v2.types.Cluster`): Required. The cluster to be created. Fields marked ``OutputOnly`` must be left blank. @@ -979,7 +1180,7 @@ async def create_cluster( google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Cluster` A resizable group of nodes in a particular cloud location, capable + The result type for the operation will be :class:`google.cloud.bigtable.admin_v2.types.Cluster` A resizable group of nodes in a particular cloud location, capable of serving all [Tables][google.bigtable.admin.v2.Table] in the parent [Instance][google.bigtable.admin.v2.Instance]. @@ -1059,8 +1260,34 @@ async def get_cluster( ) -> instance.Cluster: r"""Gets information about a cluster. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_get_cluster(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.GetClusterRequest( + name="name_value", + ) + + # Make the request + response = await client.get_cluster(request=request) + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetClusterRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.GetClusterRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.GetCluster. name (:class:`str`): @@ -1080,7 +1307,7 @@ async def get_cluster( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Cluster: + google.cloud.bigtable.admin_v2.types.Cluster: A resizable group of nodes in a particular cloud location, capable of serving all [Tables][google.bigtable.admin.v2.Table] in the @@ -1149,8 +1376,34 @@ async def list_clusters( ) -> bigtable_instance_admin.ListClustersResponse: r"""Lists information about clusters in an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_list_clusters(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ListClustersRequest( + parent="parent_value", + ) + + # Make the request + response = await client.list_clusters(request=request) + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListClustersRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.ListClustersRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.ListClusters. parent (:class:`str`): @@ -1172,7 +1425,7 @@ async def list_clusters( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.ListClustersResponse: + google.cloud.bigtable.admin_v2.types.ListClustersResponse: Response message for BigtableInstanceAdmin.ListClusters. @@ -1240,8 +1493,37 @@ async def update_cluster( cluster_config.cluster_autoscaling_config. In order to update it, you must use PartialUpdateCluster. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_update_cluster(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.Cluster( + ) + + # Make the request + operation = client.update_cluster(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.Cluster, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.Cluster, dict]]): The request object. A resizable group of nodes in a particular cloud location, capable of serving all [Tables][google.bigtable.admin.v2.Table] in the parent @@ -1258,7 +1540,7 @@ async def update_cluster( google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Cluster` A resizable group of nodes in a particular cloud location, capable + The result type for the operation will be :class:`google.cloud.bigtable.admin_v2.types.Cluster` A resizable group of nodes in a particular cloud location, capable of serving all [Tables][google.bigtable.admin.v2.Table] in the parent [Instance][google.bigtable.admin.v2.Instance]. @@ -1331,11 +1613,40 @@ async def partial_update_cluster( cluster_config.cluster_autoscaling_config, and explicitly set a serve_node count via the update_mask. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_partial_update_cluster(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.PartialUpdateClusterRequest( + ) + + # Make the request + operation = client.partial_update_cluster(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.PartialUpdateClusterRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.PartialUpdateClusterRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.PartialUpdateCluster. - cluster (:class:`google.cloud.bigtable_admin_v2.types.Cluster`): + cluster (:class:`google.cloud.bigtable.admin_v2.types.Cluster`): Required. The Cluster which contains the partial updates to be applied, subject to the update_mask. @@ -1361,7 +1672,7 @@ async def partial_update_cluster( google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Cluster` A resizable group of nodes in a particular cloud location, capable + The result type for the operation will be :class:`google.cloud.bigtable.admin_v2.types.Cluster` A resizable group of nodes in a particular cloud location, capable of serving all [Tables][google.bigtable.admin.v2.Table] in the parent [Instance][google.bigtable.admin.v2.Instance]. @@ -1441,8 +1752,31 @@ async def delete_cluster( ) -> None: r"""Deletes a cluster from an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_delete_cluster(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.DeleteClusterRequest( + name="name_value", + ) + + # Make the request + await client.delete_cluster(request=request) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteClusterRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.DeleteClusterRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.DeleteCluster. name (:class:`str`): @@ -1522,8 +1856,39 @@ async def create_app_profile( ) -> instance.AppProfile: r"""Creates an app profile within an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_create_app_profile(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + app_profile = admin_v2.AppProfile() + app_profile.priority = "PRIORITY_HIGH" + + request = admin_v2.CreateAppProfileRequest( + parent="parent_value", + app_profile_id="app_profile_id_value", + app_profile=app_profile, + ) + + # Make the request + response = await client.create_app_profile(request=request) + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateAppProfileRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.CreateAppProfileRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.CreateAppProfile. parent (:class:`str`): @@ -1543,7 +1908,7 @@ async def create_app_profile( This corresponds to the ``app_profile_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - app_profile (:class:`google.cloud.bigtable_admin_v2.types.AppProfile`): + app_profile (:class:`google.cloud.bigtable.admin_v2.types.AppProfile`): Required. The app profile to be created. Fields marked ``OutputOnly`` will be ignored. @@ -1559,7 +1924,7 @@ async def create_app_profile( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.AppProfile: + google.cloud.bigtable.admin_v2.types.AppProfile: A configuration object describing how Cloud Bigtable should treat traffic from a particular end user application. @@ -1631,8 +1996,34 @@ async def get_app_profile( ) -> instance.AppProfile: r"""Gets information about an app profile. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_get_app_profile(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.GetAppProfileRequest( + name="name_value", + ) + + # Make the request + response = await client.get_app_profile(request=request) + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetAppProfileRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.GetAppProfileRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.GetAppProfile. name (:class:`str`): @@ -1652,7 +2043,7 @@ async def get_app_profile( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.AppProfile: + google.cloud.bigtable.admin_v2.types.AppProfile: A configuration object describing how Cloud Bigtable should treat traffic from a particular end user application. @@ -1720,8 +2111,35 @@ async def list_app_profiles( ) -> pagers.ListAppProfilesAsyncPager: r"""Lists information about app profiles in an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_list_app_profiles(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ListAppProfilesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_app_profiles(request=request) + + # Handle the response + async for response in page_result: + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListAppProfilesRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.ListAppProfilesRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.ListAppProfiles. parent (:class:`str`): @@ -1744,7 +2162,7 @@ async def list_app_profiles( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers.ListAppProfilesAsyncPager: + google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.pagers.ListAppProfilesAsyncPager: Response message for BigtableInstanceAdmin.ListAppProfiles. Iterating over this object will yield @@ -1826,11 +2244,44 @@ async def update_app_profile( ) -> operation_async.AsyncOperation: r"""Updates an app profile within an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_update_app_profile(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + app_profile = admin_v2.AppProfile() + app_profile.priority = "PRIORITY_HIGH" + + request = admin_v2.UpdateAppProfileRequest( + app_profile=app_profile, + ) + + # Make the request + operation = client.update_app_profile(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.UpdateAppProfileRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.UpdateAppProfileRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.UpdateAppProfile. - app_profile (:class:`google.cloud.bigtable_admin_v2.types.AppProfile`): + app_profile (:class:`google.cloud.bigtable.admin_v2.types.AppProfile`): Required. The app profile which will (partially) replace the current value. @@ -1857,7 +2308,7 @@ async def update_app_profile( google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.AppProfile` A configuration object describing how Cloud Bigtable should treat traffic + The result type for the operation will be :class:`google.cloud.bigtable.admin_v2.types.AppProfile` A configuration object describing how Cloud Bigtable should treat traffic from a particular end user application. """ @@ -1936,8 +2387,32 @@ async def delete_app_profile( ) -> None: r"""Deletes an app profile from an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_delete_app_profile(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.DeleteAppProfileRequest( + name="name_value", + ignore_warnings=True, + ) + + # Make the request + await client.delete_app_profile(request=request) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteAppProfileRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.DeleteAppProfileRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.DeleteAppProfile. name (:class:`str`): @@ -2024,6 +2499,33 @@ async def get_iam_policy( resource. Returns an empty policy if an instance exists but does not have a policy set. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + from google.iam.v1 import iam_policy_pb2 # type: ignore + + async def sample_get_iam_policy(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = iam_policy_pb2.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = await client.get_iam_policy(request=request) + + # Handle the response + print(response) + Args: request (Optional[Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]]): The request object. Request message for ``GetIamPolicy`` method. @@ -2136,6 +2638,33 @@ async def set_iam_policy( r"""Sets the access control policy on an instance resource. Replaces any existing policy. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + from google.iam.v1 import iam_policy_pb2 # type: ignore + + async def sample_set_iam_policy(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = iam_policy_pb2.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = await client.set_iam_policy(request=request) + + # Handle the response + print(response) + Args: request (Optional[Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]]): The request object. Request message for ``SetIamPolicy`` method. @@ -2249,6 +2778,34 @@ async def test_iam_permissions( r"""Returns permissions that the caller has on the specified instance resource. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + from google.iam.v1 import iam_policy_pb2 # type: ignore + + async def sample_test_iam_permissions(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = iam_policy_pb2.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value1', 'permissions_value2'], + ) + + # Make the request + response = await client.test_iam_permissions(request=request) + + # Handle the response + print(response) + Args: request (Optional[Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]]): The request object. Request message for ``TestIamPermissions`` method. @@ -2344,8 +2901,35 @@ async def list_hot_tablets( r"""Lists hot tablets in a cluster, within the time range provided. Hot tablets are ordered based on CPU usage. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_list_hot_tablets(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ListHotTabletsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_hot_tablets(request=request) + + # Handle the response + async for response in page_result: + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListHotTabletsRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.ListHotTabletsRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.ListHotTablets. parent (:class:`str`): @@ -2365,7 +2949,7 @@ async def list_hot_tablets( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers.ListHotTabletsAsyncPager: + google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.pagers.ListHotTabletsAsyncPager: Response message for BigtableInstanceAdmin.ListHotTablets. Iterating over this object will yield @@ -2448,8 +3032,43 @@ async def create_logical_view( ) -> operation_async.AsyncOperation: r"""Creates a logical view within an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_create_logical_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + logical_view = admin_v2.LogicalView() + logical_view.query = "query_value" + + request = admin_v2.CreateLogicalViewRequest( + parent="parent_value", + logical_view_id="logical_view_id_value", + logical_view=logical_view, + ) + + # Make the request + operation = client.create_logical_view(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateLogicalViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.CreateLogicalViewRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.CreateLogicalView. parent (:class:`str`): @@ -2460,7 +3079,7 @@ async def create_logical_view( This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - logical_view (:class:`google.cloud.bigtable_admin_v2.types.LogicalView`): + logical_view (:class:`google.cloud.bigtable.admin_v2.types.LogicalView`): Required. The logical view to create. This corresponds to the ``logical_view`` field on the ``request`` instance; if ``request`` is provided, this @@ -2487,7 +3106,7 @@ async def create_logical_view( An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.LogicalView` + :class:`google.cloud.bigtable.admin_v2.types.LogicalView` A SQL logical view object that can be referenced in SQL queries. @@ -2566,8 +3185,34 @@ async def get_logical_view( ) -> instance.LogicalView: r"""Gets information about a logical view. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_get_logical_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.GetLogicalViewRequest( + name="name_value", + ) + + # Make the request + response = await client.get_logical_view(request=request) + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetLogicalViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.GetLogicalViewRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.GetLogicalView. name (:class:`str`): @@ -2587,7 +3232,7 @@ async def get_logical_view( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.LogicalView: + google.cloud.bigtable.admin_v2.types.LogicalView: A SQL logical view object that can be referenced in SQL queries. @@ -2654,8 +3299,35 @@ async def list_logical_views( ) -> pagers.ListLogicalViewsAsyncPager: r"""Lists information about logical views in an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_list_logical_views(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ListLogicalViewsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_logical_views(request=request) + + # Handle the response + async for response in page_result: + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListLogicalViewsRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.ListLogicalViewsRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.ListLogicalViews. parent (:class:`str`): @@ -2675,7 +3347,7 @@ async def list_logical_views( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers.ListLogicalViewsAsyncPager: + google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.pagers.ListLogicalViewsAsyncPager: Response message for BigtableInstanceAdmin.ListLogicalViews. Iterating over this object will yield @@ -2757,11 +3429,44 @@ async def update_logical_view( ) -> operation_async.AsyncOperation: r"""Updates a logical view within an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_update_logical_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + logical_view = admin_v2.LogicalView() + logical_view.query = "query_value" + + request = admin_v2.UpdateLogicalViewRequest( + logical_view=logical_view, + ) + + # Make the request + operation = client.update_logical_view(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.UpdateLogicalViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.UpdateLogicalViewRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.UpdateLogicalView. - logical_view (:class:`google.cloud.bigtable_admin_v2.types.LogicalView`): + logical_view (:class:`google.cloud.bigtable.admin_v2.types.LogicalView`): Required. The logical view to update. The logical view's ``name`` field is used to identify @@ -2791,7 +3496,7 @@ async def update_logical_view( An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.LogicalView` + :class:`google.cloud.bigtable.admin_v2.types.LogicalView` A SQL logical view object that can be referenced in SQL queries. @@ -2870,8 +3575,31 @@ async def delete_logical_view( ) -> None: r"""Deletes a logical view from an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_delete_logical_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.DeleteLogicalViewRequest( + name="name_value", + ) + + # Make the request + await client.delete_logical_view(request=request) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteLogicalViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.DeleteLogicalViewRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.DeleteLogicalView. name (:class:`str`): @@ -2951,8 +3679,43 @@ async def create_materialized_view( ) -> operation_async.AsyncOperation: r"""Creates a materialized view within an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_create_materialized_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + materialized_view = admin_v2.MaterializedView() + materialized_view.query = "query_value" + + request = admin_v2.CreateMaterializedViewRequest( + parent="parent_value", + materialized_view_id="materialized_view_id_value", + materialized_view=materialized_view, + ) + + # Make the request + operation = client.create_materialized_view(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateMaterializedViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.CreateMaterializedViewRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.CreateMaterializedView. parent (:class:`str`): @@ -2963,7 +3726,7 @@ async def create_materialized_view( This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - materialized_view (:class:`google.cloud.bigtable_admin_v2.types.MaterializedView`): + materialized_view (:class:`google.cloud.bigtable.admin_v2.types.MaterializedView`): Required. The materialized view to create. @@ -2992,7 +3755,7 @@ async def create_materialized_view( An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.MaterializedView` + :class:`google.cloud.bigtable.admin_v2.types.MaterializedView` A materialized view object that can be referenced in SQL queries. @@ -3073,8 +3836,34 @@ async def get_materialized_view( ) -> instance.MaterializedView: r"""Gets information about a materialized view. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_get_materialized_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.GetMaterializedViewRequest( + name="name_value", + ) + + # Make the request + response = await client.get_materialized_view(request=request) + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetMaterializedViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.GetMaterializedViewRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.GetMaterializedView. name (:class:`str`): @@ -3094,7 +3883,7 @@ async def get_materialized_view( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.MaterializedView: + google.cloud.bigtable.admin_v2.types.MaterializedView: A materialized view object that can be referenced in SQL queries. @@ -3162,8 +3951,35 @@ async def list_materialized_views( r"""Lists information about materialized views in an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_list_materialized_views(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ListMaterializedViewsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_materialized_views(request=request) + + # Handle the response + async for response in page_result: + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListMaterializedViewsRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.ListMaterializedViewsRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.ListMaterializedViews. parent (:class:`str`): @@ -3183,7 +3999,7 @@ async def list_materialized_views( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers.ListMaterializedViewsAsyncPager: + google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.pagers.ListMaterializedViewsAsyncPager: Response message for BigtableInstanceAdmin.ListMaterializedViews. Iterating over this object will yield @@ -3267,11 +4083,44 @@ async def update_materialized_view( ) -> operation_async.AsyncOperation: r"""Updates a materialized view within an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_update_materialized_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + materialized_view = admin_v2.MaterializedView() + materialized_view.query = "query_value" + + request = admin_v2.UpdateMaterializedViewRequest( + materialized_view=materialized_view, + ) + + # Make the request + operation = client.update_materialized_view(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.UpdateMaterializedViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.UpdateMaterializedViewRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.UpdateMaterializedView. - materialized_view (:class:`google.cloud.bigtable_admin_v2.types.MaterializedView`): + materialized_view (:class:`google.cloud.bigtable.admin_v2.types.MaterializedView`): Required. The materialized view to update. The materialized view's ``name`` field is used to @@ -3301,7 +4150,7 @@ async def update_materialized_view( An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.MaterializedView` + :class:`google.cloud.bigtable.admin_v2.types.MaterializedView` A materialized view object that can be referenced in SQL queries. @@ -3382,8 +4231,31 @@ async def delete_materialized_view( ) -> None: r"""Deletes a materialized view from an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_delete_materialized_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.DeleteMaterializedViewRequest( + name="name_value", + ) + + # Make the request + await client.delete_materialized_view(request=request) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteMaterializedViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.DeleteMaterializedViewRequest, dict]]): The request object. Request message for BigtableInstanceAdmin.DeleteMaterializedView. name (:class:`str`): @@ -3461,5 +4333,8 @@ async def __aexit__(self, exc_type, exc, tb): gapic_version=package_version.__version__ ) +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ + __all__ = ("BigtableInstanceAdminAsyncClient",) diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/client.py b/google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/client.py similarity index 80% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/client.py rename to google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/client.py index 72fd030ac..7e3fea9d5 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/client.py +++ b/google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/client.py @@ -34,7 +34,7 @@ ) import warnings -from google.cloud.bigtable_admin_v2 import gapic_version as package_version +from google.cloud.bigtable.admin_v2 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -45,6 +45,7 @@ from google.auth.transport.grpc import SslCredentials # type: ignore from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import google.protobuf try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] @@ -62,11 +63,11 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore -from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import pagers -from google.cloud.bigtable_admin_v2.types import bigtable_instance_admin -from google.cloud.bigtable_admin_v2.types import common -from google.cloud.bigtable_admin_v2.types import instance -from google.cloud.bigtable_admin_v2.types import instance as gba_instance +from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import pagers +from google.cloud.bigtable.admin_v2.types import bigtable_instance_admin +from google.cloud.bigtable.admin_v2.types import common +from google.cloud.bigtable.admin_v2.types import instance +from google.cloud.bigtable.admin_v2.types import instance as gba_instance from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore @@ -905,8 +906,43 @@ def create_instance( scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_create_instance(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + instance = admin_v2.Instance() + instance.display_name = "display_name_value" + + request = admin_v2.CreateInstanceRequest( + parent="parent_value", + instance_id="instance_id_value", + instance=instance, + ) + + # Make the request + operation = client.create_instance(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.CreateInstanceRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.CreateInstanceRequest, dict]): The request object. Request message for BigtableInstanceAdmin.CreateInstance. parent (str): @@ -925,14 +961,14 @@ def create_instance( This corresponds to the ``instance_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - instance (google.cloud.bigtable_admin_v2.types.Instance): + instance (google.cloud.bigtable.admin_v2.types.Instance): Required. The instance to create. Fields marked ``OutputOnly`` must be left blank. This corresponds to the ``instance`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - clusters (MutableMapping[str, google.cloud.bigtable_admin_v2.types.Cluster]): + clusters (MutableMapping[str, google.cloud.bigtable.admin_v2.types.Cluster]): Required. The clusters to be created within the instance, mapped by desired cluster ID, e.g., just ``mycluster`` rather than @@ -954,7 +990,7 @@ def create_instance( google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Instance` A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and + The result type for the operation will be :class:`google.cloud.bigtable.admin_v2.types.Instance` A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and the resources that serve them. All tables in an instance are served from all [Clusters][google.bigtable.admin.v2.Cluster] in the @@ -1034,8 +1070,34 @@ def get_instance( ) -> instance.Instance: r"""Gets information about an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_get_instance(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.GetInstanceRequest( + name="name_value", + ) + + # Make the request + response = client.get_instance(request=request) + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.GetInstanceRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.GetInstanceRequest, dict]): The request object. Request message for BigtableInstanceAdmin.GetInstance. name (str): @@ -1055,7 +1117,7 @@ def get_instance( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Instance: + google.cloud.bigtable.admin_v2.types.Instance: A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and the resources that serve them. All tables in an instance are served from all @@ -1122,8 +1184,34 @@ def list_instances( ) -> bigtable_instance_admin.ListInstancesResponse: r"""Lists information about instances in a project. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_list_instances(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.ListInstancesRequest( + parent="parent_value", + ) + + # Make the request + response = client.list_instances(request=request) + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListInstancesRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.ListInstancesRequest, dict]): The request object. Request message for BigtableInstanceAdmin.ListInstances. parent (str): @@ -1143,7 +1231,7 @@ def list_instances( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.ListInstancesResponse: + google.cloud.bigtable.admin_v2.types.ListInstancesResponse: Response message for BigtableInstanceAdmin.ListInstances. @@ -1207,8 +1295,34 @@ def update_instance( To update other Instance properties, such as labels, use PartialUpdateInstance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_update_instance(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.Instance( + display_name="display_name_value", + ) + + # Make the request + response = client.update_instance(request=request) + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.Instance, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.Instance, dict]): The request object. A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and the resources that serve them. All tables in an instance are @@ -1224,7 +1338,7 @@ def update_instance( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Instance: + google.cloud.bigtable.admin_v2.types.Instance: A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and the resources that serve them. All tables in an instance are served from all @@ -1278,11 +1392,44 @@ def partial_update_instance( method can modify all fields of an Instance and is the preferred way to update an Instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_partial_update_instance(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + instance = admin_v2.Instance() + instance.display_name = "display_name_value" + + request = admin_v2.PartialUpdateInstanceRequest( + instance=instance, + ) + + # Make the request + operation = client.partial_update_instance(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.PartialUpdateInstanceRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.PartialUpdateInstanceRequest, dict]): The request object. Request message for BigtableInstanceAdmin.PartialUpdateInstance. - instance (google.cloud.bigtable_admin_v2.types.Instance): + instance (google.cloud.bigtable.admin_v2.types.Instance): Required. The Instance which will (partially) replace the current value. @@ -1309,7 +1456,7 @@ def partial_update_instance( google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Instance` A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and + The result type for the operation will be :class:`google.cloud.bigtable.admin_v2.types.Instance` A collection of Bigtable [Tables][google.bigtable.admin.v2.Table] and the resources that serve them. All tables in an instance are served from all [Clusters][google.bigtable.admin.v2.Cluster] in the @@ -1389,8 +1536,31 @@ def delete_instance( ) -> None: r"""Delete an instance from a project. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_delete_instance(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.DeleteInstanceRequest( + name="name_value", + ) + + # Make the request + client.delete_instance(request=request) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.DeleteInstanceRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.DeleteInstanceRequest, dict]): The request object. Request message for BigtableInstanceAdmin.DeleteInstance. name (str): @@ -1473,8 +1643,39 @@ def create_cluster( scaled. If cluster_config.cluster_autoscaling_config is non-empty, then autoscaling is enabled. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_create_cluster(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.CreateClusterRequest( + parent="parent_value", + cluster_id="cluster_id_value", + ) + + # Make the request + operation = client.create_cluster(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.CreateClusterRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.CreateClusterRequest, dict]): The request object. Request message for BigtableInstanceAdmin.CreateCluster. parent (str): @@ -1494,7 +1695,7 @@ def create_cluster( This corresponds to the ``cluster_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - cluster (google.cloud.bigtable_admin_v2.types.Cluster): + cluster (google.cloud.bigtable.admin_v2.types.Cluster): Required. The cluster to be created. Fields marked ``OutputOnly`` must be left blank. @@ -1513,7 +1714,7 @@ def create_cluster( google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Cluster` A resizable group of nodes in a particular cloud location, capable + The result type for the operation will be :class:`google.cloud.bigtable.admin_v2.types.Cluster` A resizable group of nodes in a particular cloud location, capable of serving all [Tables][google.bigtable.admin.v2.Table] in the parent [Instance][google.bigtable.admin.v2.Instance]. @@ -1590,8 +1791,34 @@ def get_cluster( ) -> instance.Cluster: r"""Gets information about a cluster. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_get_cluster(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.GetClusterRequest( + name="name_value", + ) + + # Make the request + response = client.get_cluster(request=request) + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.GetClusterRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.GetClusterRequest, dict]): The request object. Request message for BigtableInstanceAdmin.GetCluster. name (str): @@ -1611,7 +1838,7 @@ def get_cluster( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Cluster: + google.cloud.bigtable.admin_v2.types.Cluster: A resizable group of nodes in a particular cloud location, capable of serving all [Tables][google.bigtable.admin.v2.Table] in the @@ -1677,8 +1904,34 @@ def list_clusters( ) -> bigtable_instance_admin.ListClustersResponse: r"""Lists information about clusters in an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_list_clusters(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.ListClustersRequest( + parent="parent_value", + ) + + # Make the request + response = client.list_clusters(request=request) + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListClustersRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.ListClustersRequest, dict]): The request object. Request message for BigtableInstanceAdmin.ListClusters. parent (str): @@ -1700,7 +1953,7 @@ def list_clusters( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.ListClustersResponse: + google.cloud.bigtable.admin_v2.types.ListClustersResponse: Response message for BigtableInstanceAdmin.ListClusters. @@ -1765,8 +2018,37 @@ def update_cluster( cluster_config.cluster_autoscaling_config. In order to update it, you must use PartialUpdateCluster. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_update_cluster(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.Cluster( + ) + + # Make the request + operation = client.update_cluster(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.Cluster, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.Cluster, dict]): The request object. A resizable group of nodes in a particular cloud location, capable of serving all [Tables][google.bigtable.admin.v2.Table] in the parent @@ -1783,7 +2065,7 @@ def update_cluster( google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Cluster` A resizable group of nodes in a particular cloud location, capable + The result type for the operation will be :class:`google.cloud.bigtable.admin_v2.types.Cluster` A resizable group of nodes in a particular cloud location, capable of serving all [Tables][google.bigtable.admin.v2.Table] in the parent [Instance][google.bigtable.admin.v2.Instance]. @@ -1854,11 +2136,40 @@ def partial_update_cluster( cluster_config.cluster_autoscaling_config, and explicitly set a serve_node count via the update_mask. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_partial_update_cluster(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.PartialUpdateClusterRequest( + ) + + # Make the request + operation = client.partial_update_cluster(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.PartialUpdateClusterRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.PartialUpdateClusterRequest, dict]): The request object. Request message for BigtableInstanceAdmin.PartialUpdateCluster. - cluster (google.cloud.bigtable_admin_v2.types.Cluster): + cluster (google.cloud.bigtable.admin_v2.types.Cluster): Required. The Cluster which contains the partial updates to be applied, subject to the update_mask. @@ -1884,7 +2195,7 @@ def partial_update_cluster( google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.Cluster` A resizable group of nodes in a particular cloud location, capable + The result type for the operation will be :class:`google.cloud.bigtable.admin_v2.types.Cluster` A resizable group of nodes in a particular cloud location, capable of serving all [Tables][google.bigtable.admin.v2.Table] in the parent [Instance][google.bigtable.admin.v2.Instance]. @@ -1961,8 +2272,31 @@ def delete_cluster( ) -> None: r"""Deletes a cluster from an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_delete_cluster(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.DeleteClusterRequest( + name="name_value", + ) + + # Make the request + client.delete_cluster(request=request) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.DeleteClusterRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.DeleteClusterRequest, dict]): The request object. Request message for BigtableInstanceAdmin.DeleteCluster. name (str): @@ -2039,8 +2373,39 @@ def create_app_profile( ) -> instance.AppProfile: r"""Creates an app profile within an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_create_app_profile(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + app_profile = admin_v2.AppProfile() + app_profile.priority = "PRIORITY_HIGH" + + request = admin_v2.CreateAppProfileRequest( + parent="parent_value", + app_profile_id="app_profile_id_value", + app_profile=app_profile, + ) + + # Make the request + response = client.create_app_profile(request=request) + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.CreateAppProfileRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.CreateAppProfileRequest, dict]): The request object. Request message for BigtableInstanceAdmin.CreateAppProfile. parent (str): @@ -2060,7 +2425,7 @@ def create_app_profile( This corresponds to the ``app_profile_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - app_profile (google.cloud.bigtable_admin_v2.types.AppProfile): + app_profile (google.cloud.bigtable.admin_v2.types.AppProfile): Required. The app profile to be created. Fields marked ``OutputOnly`` will be ignored. @@ -2076,7 +2441,7 @@ def create_app_profile( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.AppProfile: + google.cloud.bigtable.admin_v2.types.AppProfile: A configuration object describing how Cloud Bigtable should treat traffic from a particular end user application. @@ -2145,8 +2510,34 @@ def get_app_profile( ) -> instance.AppProfile: r"""Gets information about an app profile. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_get_app_profile(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.GetAppProfileRequest( + name="name_value", + ) + + # Make the request + response = client.get_app_profile(request=request) + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.GetAppProfileRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.GetAppProfileRequest, dict]): The request object. Request message for BigtableInstanceAdmin.GetAppProfile. name (str): @@ -2166,7 +2557,7 @@ def get_app_profile( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.AppProfile: + google.cloud.bigtable.admin_v2.types.AppProfile: A configuration object describing how Cloud Bigtable should treat traffic from a particular end user application. @@ -2231,8 +2622,35 @@ def list_app_profiles( ) -> pagers.ListAppProfilesPager: r"""Lists information about app profiles in an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_list_app_profiles(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.ListAppProfilesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_app_profiles(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListAppProfilesRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.ListAppProfilesRequest, dict]): The request object. Request message for BigtableInstanceAdmin.ListAppProfiles. parent (str): @@ -2255,7 +2673,7 @@ def list_app_profiles( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers.ListAppProfilesPager: + google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.pagers.ListAppProfilesPager: Response message for BigtableInstanceAdmin.ListAppProfiles. Iterating over this object will yield @@ -2334,11 +2752,44 @@ def update_app_profile( ) -> operation.Operation: r"""Updates an app profile within an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_update_app_profile(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + app_profile = admin_v2.AppProfile() + app_profile.priority = "PRIORITY_HIGH" + + request = admin_v2.UpdateAppProfileRequest( + app_profile=app_profile, + ) + + # Make the request + operation = client.update_app_profile(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.UpdateAppProfileRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.UpdateAppProfileRequest, dict]): The request object. Request message for BigtableInstanceAdmin.UpdateAppProfile. - app_profile (google.cloud.bigtable_admin_v2.types.AppProfile): + app_profile (google.cloud.bigtable.admin_v2.types.AppProfile): Required. The app profile which will (partially) replace the current value. @@ -2365,7 +2816,7 @@ def update_app_profile( google.api_core.operation.Operation: An object representing a long-running operation. - The result type for the operation will be :class:`google.cloud.bigtable_admin_v2.types.AppProfile` A configuration object describing how Cloud Bigtable should treat traffic + The result type for the operation will be :class:`google.cloud.bigtable.admin_v2.types.AppProfile` A configuration object describing how Cloud Bigtable should treat traffic from a particular end user application. """ @@ -2441,8 +2892,32 @@ def delete_app_profile( ) -> None: r"""Deletes an app profile from an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_delete_app_profile(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.DeleteAppProfileRequest( + name="name_value", + ignore_warnings=True, + ) + + # Make the request + client.delete_app_profile(request=request) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.DeleteAppProfileRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.DeleteAppProfileRequest, dict]): The request object. Request message for BigtableInstanceAdmin.DeleteAppProfile. name (str): @@ -2526,6 +3001,33 @@ def get_iam_policy( resource. Returns an empty policy if an instance exists but does not have a policy set. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + from google.iam.v1 import iam_policy_pb2 # type: ignore + + def sample_get_iam_policy(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = iam_policy_pb2.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]): The request object. Request message for ``GetIamPolicy`` method. @@ -2639,6 +3141,33 @@ def set_iam_policy( r"""Sets the access control policy on an instance resource. Replaces any existing policy. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + from google.iam.v1 import iam_policy_pb2 # type: ignore + + def sample_set_iam_policy(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = iam_policy_pb2.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]): The request object. Request message for ``SetIamPolicy`` method. @@ -2753,6 +3282,34 @@ def test_iam_permissions( r"""Returns permissions that the caller has on the specified instance resource. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + from google.iam.v1 import iam_policy_pb2 # type: ignore + + def sample_test_iam_permissions(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = iam_policy_pb2.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value1', 'permissions_value2'], + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]): The request object. Request message for ``TestIamPermissions`` method. @@ -2849,8 +3406,35 @@ def list_hot_tablets( r"""Lists hot tablets in a cluster, within the time range provided. Hot tablets are ordered based on CPU usage. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_list_hot_tablets(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.ListHotTabletsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_hot_tablets(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListHotTabletsRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.ListHotTabletsRequest, dict]): The request object. Request message for BigtableInstanceAdmin.ListHotTablets. parent (str): @@ -2870,7 +3454,7 @@ def list_hot_tablets( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers.ListHotTabletsPager: + google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.pagers.ListHotTabletsPager: Response message for BigtableInstanceAdmin.ListHotTablets. Iterating over this object will yield @@ -2950,8 +3534,43 @@ def create_logical_view( ) -> operation.Operation: r"""Creates a logical view within an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_create_logical_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + logical_view = admin_v2.LogicalView() + logical_view.query = "query_value" + + request = admin_v2.CreateLogicalViewRequest( + parent="parent_value", + logical_view_id="logical_view_id_value", + logical_view=logical_view, + ) + + # Make the request + operation = client.create_logical_view(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.CreateLogicalViewRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.CreateLogicalViewRequest, dict]): The request object. Request message for BigtableInstanceAdmin.CreateLogicalView. parent (str): @@ -2962,7 +3581,7 @@ def create_logical_view( This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - logical_view (google.cloud.bigtable_admin_v2.types.LogicalView): + logical_view (google.cloud.bigtable.admin_v2.types.LogicalView): Required. The logical view to create. This corresponds to the ``logical_view`` field on the ``request`` instance; if ``request`` is provided, this @@ -2989,7 +3608,7 @@ def create_logical_view( An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.LogicalView` + :class:`google.cloud.bigtable.admin_v2.types.LogicalView` A SQL logical view object that can be referenced in SQL queries. @@ -3065,8 +3684,34 @@ def get_logical_view( ) -> instance.LogicalView: r"""Gets information about a logical view. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_get_logical_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.GetLogicalViewRequest( + name="name_value", + ) + + # Make the request + response = client.get_logical_view(request=request) + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.GetLogicalViewRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.GetLogicalViewRequest, dict]): The request object. Request message for BigtableInstanceAdmin.GetLogicalView. name (str): @@ -3086,7 +3731,7 @@ def get_logical_view( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.LogicalView: + google.cloud.bigtable.admin_v2.types.LogicalView: A SQL logical view object that can be referenced in SQL queries. @@ -3150,8 +3795,35 @@ def list_logical_views( ) -> pagers.ListLogicalViewsPager: r"""Lists information about logical views in an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_list_logical_views(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.ListLogicalViewsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_logical_views(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListLogicalViewsRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.ListLogicalViewsRequest, dict]): The request object. Request message for BigtableInstanceAdmin.ListLogicalViews. parent (str): @@ -3171,7 +3843,7 @@ def list_logical_views( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers.ListLogicalViewsPager: + google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.pagers.ListLogicalViewsPager: Response message for BigtableInstanceAdmin.ListLogicalViews. Iterating over this object will yield @@ -3250,11 +3922,44 @@ def update_logical_view( ) -> operation.Operation: r"""Updates a logical view within an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_update_logical_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + logical_view = admin_v2.LogicalView() + logical_view.query = "query_value" + + request = admin_v2.UpdateLogicalViewRequest( + logical_view=logical_view, + ) + + # Make the request + operation = client.update_logical_view(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.UpdateLogicalViewRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.UpdateLogicalViewRequest, dict]): The request object. Request message for BigtableInstanceAdmin.UpdateLogicalView. - logical_view (google.cloud.bigtable_admin_v2.types.LogicalView): + logical_view (google.cloud.bigtable.admin_v2.types.LogicalView): Required. The logical view to update. The logical view's ``name`` field is used to identify @@ -3284,7 +3989,7 @@ def update_logical_view( An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.LogicalView` + :class:`google.cloud.bigtable.admin_v2.types.LogicalView` A SQL logical view object that can be referenced in SQL queries. @@ -3360,8 +4065,31 @@ def delete_logical_view( ) -> None: r"""Deletes a logical view from an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_delete_logical_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.DeleteLogicalViewRequest( + name="name_value", + ) + + # Make the request + client.delete_logical_view(request=request) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.DeleteLogicalViewRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.DeleteLogicalViewRequest, dict]): The request object. Request message for BigtableInstanceAdmin.DeleteLogicalView. name (str): @@ -3438,8 +4166,43 @@ def create_materialized_view( ) -> operation.Operation: r"""Creates a materialized view within an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_create_materialized_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + materialized_view = admin_v2.MaterializedView() + materialized_view.query = "query_value" + + request = admin_v2.CreateMaterializedViewRequest( + parent="parent_value", + materialized_view_id="materialized_view_id_value", + materialized_view=materialized_view, + ) + + # Make the request + operation = client.create_materialized_view(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.CreateMaterializedViewRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.CreateMaterializedViewRequest, dict]): The request object. Request message for BigtableInstanceAdmin.CreateMaterializedView. parent (str): @@ -3450,7 +4213,7 @@ def create_materialized_view( This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - materialized_view (google.cloud.bigtable_admin_v2.types.MaterializedView): + materialized_view (google.cloud.bigtable.admin_v2.types.MaterializedView): Required. The materialized view to create. @@ -3479,7 +4242,7 @@ def create_materialized_view( An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.MaterializedView` + :class:`google.cloud.bigtable.admin_v2.types.MaterializedView` A materialized view object that can be referenced in SQL queries. @@ -3557,8 +4320,34 @@ def get_materialized_view( ) -> instance.MaterializedView: r"""Gets information about a materialized view. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_get_materialized_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.GetMaterializedViewRequest( + name="name_value", + ) + + # Make the request + response = client.get_materialized_view(request=request) + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.GetMaterializedViewRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.GetMaterializedViewRequest, dict]): The request object. Request message for BigtableInstanceAdmin.GetMaterializedView. name (str): @@ -3578,7 +4367,7 @@ def get_materialized_view( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.MaterializedView: + google.cloud.bigtable.admin_v2.types.MaterializedView: A materialized view object that can be referenced in SQL queries. @@ -3643,8 +4432,35 @@ def list_materialized_views( r"""Lists information about materialized views in an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_list_materialized_views(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.ListMaterializedViewsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_materialized_views(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListMaterializedViewsRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.ListMaterializedViewsRequest, dict]): The request object. Request message for BigtableInstanceAdmin.ListMaterializedViews. parent (str): @@ -3664,7 +4480,7 @@ def list_materialized_views( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.pagers.ListMaterializedViewsPager: + google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.pagers.ListMaterializedViewsPager: Response message for BigtableInstanceAdmin.ListMaterializedViews. Iterating over this object will yield @@ -3745,11 +4561,44 @@ def update_materialized_view( ) -> operation.Operation: r"""Updates a materialized view within an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_update_materialized_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + materialized_view = admin_v2.MaterializedView() + materialized_view.query = "query_value" + + request = admin_v2.UpdateMaterializedViewRequest( + materialized_view=materialized_view, + ) + + # Make the request + operation = client.update_materialized_view(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.UpdateMaterializedViewRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.UpdateMaterializedViewRequest, dict]): The request object. Request message for BigtableInstanceAdmin.UpdateMaterializedView. - materialized_view (google.cloud.bigtable_admin_v2.types.MaterializedView): + materialized_view (google.cloud.bigtable.admin_v2.types.MaterializedView): Required. The materialized view to update. The materialized view's ``name`` field is used to @@ -3779,7 +4628,7 @@ def update_materialized_view( An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.MaterializedView` + :class:`google.cloud.bigtable.admin_v2.types.MaterializedView` A materialized view object that can be referenced in SQL queries. @@ -3857,8 +4706,31 @@ def delete_materialized_view( ) -> None: r"""Deletes a materialized view from an instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_delete_materialized_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.DeleteMaterializedViewRequest( + name="name_value", + ) + + # Make the request + client.delete_materialized_view(request=request) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.DeleteMaterializedViewRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.DeleteMaterializedViewRequest, dict]): The request object. Request message for BigtableInstanceAdmin.DeleteMaterializedView. name (str): @@ -3940,5 +4812,7 @@ def __exit__(self, type, value, traceback): gapic_version=package_version.__version__ ) +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ __all__ = ("BigtableInstanceAdminClient",) diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/pagers.py b/google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/pagers.py similarity index 92% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/pagers.py rename to google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/pagers.py index ce5b67b27..bc7348063 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/pagers.py +++ b/google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/pagers.py @@ -37,15 +37,15 @@ OptionalRetry = Union[retries.Retry, object, None] # type: ignore OptionalAsyncRetry = Union[retries_async.AsyncRetry, object, None] # type: ignore -from google.cloud.bigtable_admin_v2.types import bigtable_instance_admin -from google.cloud.bigtable_admin_v2.types import instance +from google.cloud.bigtable.admin_v2.types import bigtable_instance_admin +from google.cloud.bigtable.admin_v2.types import instance class ListAppProfilesPager: """A pager for iterating through ``list_app_profiles`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListAppProfilesResponse` object, and + :class:`google.cloud.bigtable.admin_v2.types.ListAppProfilesResponse` object, and provides an ``__iter__`` method to iterate through its ``app_profiles`` field. @@ -54,7 +54,7 @@ class ListAppProfilesPager: through the ``app_profiles`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListAppProfilesResponse` + All the usual :class:`google.cloud.bigtable.admin_v2.types.ListAppProfilesResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -74,9 +74,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListAppProfilesRequest): + request (google.cloud.bigtable.admin_v2.types.ListAppProfilesRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListAppProfilesResponse): + response (google.cloud.bigtable.admin_v2.types.ListAppProfilesResponse): The initial response object. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -121,7 +121,7 @@ class ListAppProfilesAsyncPager: """A pager for iterating through ``list_app_profiles`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListAppProfilesResponse` object, and + :class:`google.cloud.bigtable.admin_v2.types.ListAppProfilesResponse` object, and provides an ``__aiter__`` method to iterate through its ``app_profiles`` field. @@ -130,7 +130,7 @@ class ListAppProfilesAsyncPager: through the ``app_profiles`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListAppProfilesResponse` + All the usual :class:`google.cloud.bigtable.admin_v2.types.ListAppProfilesResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -152,9 +152,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListAppProfilesRequest): + request (google.cloud.bigtable.admin_v2.types.ListAppProfilesRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListAppProfilesResponse): + response (google.cloud.bigtable.admin_v2.types.ListAppProfilesResponse): The initial response object. retry (google.api_core.retry.AsyncRetry): Designation of what errors, if any, should be retried. @@ -205,7 +205,7 @@ class ListHotTabletsPager: """A pager for iterating through ``list_hot_tablets`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListHotTabletsResponse` object, and + :class:`google.cloud.bigtable.admin_v2.types.ListHotTabletsResponse` object, and provides an ``__iter__`` method to iterate through its ``hot_tablets`` field. @@ -214,7 +214,7 @@ class ListHotTabletsPager: through the ``hot_tablets`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListHotTabletsResponse` + All the usual :class:`google.cloud.bigtable.admin_v2.types.ListHotTabletsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -234,9 +234,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListHotTabletsRequest): + request (google.cloud.bigtable.admin_v2.types.ListHotTabletsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListHotTabletsResponse): + response (google.cloud.bigtable.admin_v2.types.ListHotTabletsResponse): The initial response object. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -281,7 +281,7 @@ class ListHotTabletsAsyncPager: """A pager for iterating through ``list_hot_tablets`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListHotTabletsResponse` object, and + :class:`google.cloud.bigtable.admin_v2.types.ListHotTabletsResponse` object, and provides an ``__aiter__`` method to iterate through its ``hot_tablets`` field. @@ -290,7 +290,7 @@ class ListHotTabletsAsyncPager: through the ``hot_tablets`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListHotTabletsResponse` + All the usual :class:`google.cloud.bigtable.admin_v2.types.ListHotTabletsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -312,9 +312,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListHotTabletsRequest): + request (google.cloud.bigtable.admin_v2.types.ListHotTabletsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListHotTabletsResponse): + response (google.cloud.bigtable.admin_v2.types.ListHotTabletsResponse): The initial response object. retry (google.api_core.retry.AsyncRetry): Designation of what errors, if any, should be retried. @@ -365,7 +365,7 @@ class ListLogicalViewsPager: """A pager for iterating through ``list_logical_views`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListLogicalViewsResponse` object, and + :class:`google.cloud.bigtable.admin_v2.types.ListLogicalViewsResponse` object, and provides an ``__iter__`` method to iterate through its ``logical_views`` field. @@ -374,7 +374,7 @@ class ListLogicalViewsPager: through the ``logical_views`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListLogicalViewsResponse` + All the usual :class:`google.cloud.bigtable.admin_v2.types.ListLogicalViewsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -394,9 +394,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListLogicalViewsRequest): + request (google.cloud.bigtable.admin_v2.types.ListLogicalViewsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListLogicalViewsResponse): + response (google.cloud.bigtable.admin_v2.types.ListLogicalViewsResponse): The initial response object. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -441,7 +441,7 @@ class ListLogicalViewsAsyncPager: """A pager for iterating through ``list_logical_views`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListLogicalViewsResponse` object, and + :class:`google.cloud.bigtable.admin_v2.types.ListLogicalViewsResponse` object, and provides an ``__aiter__`` method to iterate through its ``logical_views`` field. @@ -450,7 +450,7 @@ class ListLogicalViewsAsyncPager: through the ``logical_views`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListLogicalViewsResponse` + All the usual :class:`google.cloud.bigtable.admin_v2.types.ListLogicalViewsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -472,9 +472,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListLogicalViewsRequest): + request (google.cloud.bigtable.admin_v2.types.ListLogicalViewsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListLogicalViewsResponse): + response (google.cloud.bigtable.admin_v2.types.ListLogicalViewsResponse): The initial response object. retry (google.api_core.retry.AsyncRetry): Designation of what errors, if any, should be retried. @@ -525,7 +525,7 @@ class ListMaterializedViewsPager: """A pager for iterating through ``list_materialized_views`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListMaterializedViewsResponse` object, and + :class:`google.cloud.bigtable.admin_v2.types.ListMaterializedViewsResponse` object, and provides an ``__iter__`` method to iterate through its ``materialized_views`` field. @@ -534,7 +534,7 @@ class ListMaterializedViewsPager: through the ``materialized_views`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListMaterializedViewsResponse` + All the usual :class:`google.cloud.bigtable.admin_v2.types.ListMaterializedViewsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -554,9 +554,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListMaterializedViewsRequest): + request (google.cloud.bigtable.admin_v2.types.ListMaterializedViewsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListMaterializedViewsResponse): + response (google.cloud.bigtable.admin_v2.types.ListMaterializedViewsResponse): The initial response object. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -601,7 +601,7 @@ class ListMaterializedViewsAsyncPager: """A pager for iterating through ``list_materialized_views`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListMaterializedViewsResponse` object, and + :class:`google.cloud.bigtable.admin_v2.types.ListMaterializedViewsResponse` object, and provides an ``__aiter__`` method to iterate through its ``materialized_views`` field. @@ -610,7 +610,7 @@ class ListMaterializedViewsAsyncPager: through the ``materialized_views`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListMaterializedViewsResponse` + All the usual :class:`google.cloud.bigtable.admin_v2.types.ListMaterializedViewsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -632,9 +632,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListMaterializedViewsRequest): + request (google.cloud.bigtable.admin_v2.types.ListMaterializedViewsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListMaterializedViewsResponse): + response (google.cloud.bigtable.admin_v2.types.ListMaterializedViewsResponse): The initial response object. retry (google.api_core.retry.AsyncRetry): Designation of what errors, if any, should be retried. diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/README.rst b/google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/transports/README.rst similarity index 100% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/README.rst rename to google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/transports/README.rst diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/__init__.py b/google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/transports/__init__.py similarity index 100% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/__init__.py rename to google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/transports/__init__.py diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/base.py b/google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/transports/base.py similarity index 98% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/base.py rename to google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/transports/base.py index cd3289655..d0846b3e6 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/base.py +++ b/google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/transports/base.py @@ -16,7 +16,7 @@ import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -from google.cloud.bigtable_admin_v2 import gapic_version as package_version +from google.cloud.bigtable.admin_v2 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -26,9 +26,10 @@ from google.api_core import operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import google.protobuf -from google.cloud.bigtable_admin_v2.types import bigtable_instance_admin -from google.cloud.bigtable_admin_v2.types import instance +from google.cloud.bigtable.admin_v2.types import bigtable_instance_admin +from google.cloud.bigtable.admin_v2.types import instance from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -38,6 +39,9 @@ gapic_version=package_version.__version__ ) +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ + class BigtableInstanceAdminTransport(abc.ABC): """Abstract transport class for BigtableInstanceAdmin.""" diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc.py b/google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/transports/grpc.py similarity index 99% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc.py rename to google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/transports/grpc.py index 36eae1ddf..495e38872 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc.py +++ b/google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/transports/grpc.py @@ -31,8 +31,8 @@ import grpc # type: ignore import proto # type: ignore -from google.cloud.bigtable_admin_v2.types import bigtable_instance_admin -from google.cloud.bigtable_admin_v2.types import instance +from google.cloud.bigtable.admin_v2.types import bigtable_instance_admin +from google.cloud.bigtable.admin_v2.types import instance from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -76,12 +76,11 @@ def intercept_unary_unary(self, continuation, client_call_details, request): f"Sending request for {client_call_details.method}", extra={ "serviceName": "google.bigtable.admin.v2.BigtableInstanceAdmin", - "rpcName": client_call_details.method, + "rpcName": str(client_call_details.method), "request": grpc_request, "metadata": grpc_request["metadata"], }, ) - response = continuation(client_call_details, request) if logging_enabled: # pragma: NO COVER response_metadata = response.trailing_metadata() diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc_asyncio.py b/google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/transports/grpc_asyncio.py similarity index 99% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc_asyncio.py rename to google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/transports/grpc_asyncio.py index aae0f44c4..4f2a65429 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/grpc_asyncio.py +++ b/google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/transports/grpc_asyncio.py @@ -34,8 +34,8 @@ import proto # type: ignore from grpc.experimental import aio # type: ignore -from google.cloud.bigtable_admin_v2.types import bigtable_instance_admin -from google.cloud.bigtable_admin_v2.types import instance +from google.cloud.bigtable.admin_v2.types import bigtable_instance_admin +from google.cloud.bigtable.admin_v2.types import instance from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest.py b/google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/transports/rest.py similarity index 99% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest.py rename to google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/transports/rest.py index 0d2239ad8..f4254434d 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest.py +++ b/google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/transports/rest.py @@ -23,6 +23,7 @@ from google.api_core import rest_helpers from google.api_core import rest_streaming from google.api_core import gapic_v1 +import google.protobuf from google.protobuf import json_format from google.api_core import operations_v1 @@ -33,8 +34,8 @@ import warnings -from google.cloud.bigtable_admin_v2.types import bigtable_instance_admin -from google.cloud.bigtable_admin_v2.types import instance +from google.cloud.bigtable.admin_v2.types import bigtable_instance_admin +from google.cloud.bigtable.admin_v2.types import instance from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore @@ -64,6 +65,9 @@ rest_version=f"requests@{requests_version}", ) +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ + class BigtableInstanceAdminRestInterceptor: """Interceptor for BigtableInstanceAdmin. diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest_base.py b/google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/transports/rest_base.py similarity index 99% rename from google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest_base.py rename to google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/transports/rest_base.py index 9855756b8..f23399a0b 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_instance_admin/transports/rest_base.py +++ b/google/cloud/bigtable/admin_v2/services/bigtable_instance_admin/transports/rest_base.py @@ -24,8 +24,8 @@ from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union -from google.cloud.bigtable_admin_v2.types import bigtable_instance_admin -from google.cloud.bigtable_admin_v2.types import instance +from google.cloud.bigtable.admin_v2.types import bigtable_instance_admin +from google.cloud.bigtable.admin_v2.types import instance from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/__init__.py b/google/cloud/bigtable/admin_v2/services/bigtable_table_admin/__init__.py similarity index 76% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/__init__.py rename to google/cloud/bigtable/admin_v2/services/bigtable_table_admin/__init__.py index cd916a2c8..c5e8544d6 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/__init__.py +++ b/google/cloud/bigtable/admin_v2/services/bigtable_table_admin/__init__.py @@ -13,10 +13,10 @@ # See the License for the specific language governing permissions and # limitations under the License. # -from .client import BigtableTableAdminClient -from .async_client import BigtableTableAdminAsyncClient +from .client import BaseBigtableTableAdminClient +from .async_client import BaseBigtableTableAdminAsyncClient __all__ = ( - "BigtableTableAdminClient", - "BigtableTableAdminAsyncClient", + "BaseBigtableTableAdminClient", + "BaseBigtableTableAdminAsyncClient", ) diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/async_client.py b/google/cloud/bigtable/admin_v2/services/bigtable_table_admin/async_client.py similarity index 78% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/async_client.py rename to google/cloud/bigtable/admin_v2/services/bigtable_table_admin/async_client.py index 2eaebae35..09b6a747f 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/async_client.py +++ b/google/cloud/bigtable/admin_v2/services/bigtable_table_admin/async_client.py @@ -29,7 +29,7 @@ Union, ) -from google.cloud.bigtable_admin_v2 import gapic_version as package_version +from google.cloud.bigtable.admin_v2 import gapic_version as package_version from google.api_core.client_options import ClientOptions from google.api_core import exceptions as core_exceptions @@ -37,6 +37,7 @@ from google.api_core import retry_async as retries from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import google.protobuf try: @@ -46,18 +47,18 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import pagers -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.types import table -from google.cloud.bigtable_admin_v2.types import table as gba_table -from google.cloud.bigtable_admin_v2.types import types +from google.cloud.bigtable.admin_v2.services.bigtable_table_admin import pagers +from google.cloud.bigtable.admin_v2.types import bigtable_table_admin +from google.cloud.bigtable.admin_v2.types import table +from google.cloud.bigtable.admin_v2.types import table as gba_table +from google.cloud.bigtable.admin_v2.types import types from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore from .transports.base import BigtableTableAdminTransport, DEFAULT_CLIENT_INFO from .transports.grpc_asyncio import BigtableTableAdminGrpcAsyncIOTransport -from .client import BigtableTableAdminClient +from .client import BaseBigtableTableAdminClient try: from google.api_core import client_logging # type: ignore @@ -69,7 +70,7 @@ _LOGGER = std_logging.getLogger(__name__) -class BigtableTableAdminAsyncClient: +class BaseBigtableTableAdminAsyncClient: """Service for creating, configuring, and deleting Cloud Bigtable tables. @@ -77,58 +78,62 @@ class BigtableTableAdminAsyncClient: within the tables. """ - _client: BigtableTableAdminClient + _client: BaseBigtableTableAdminClient # Copy defaults from the synchronous client for use here. # Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead. - DEFAULT_ENDPOINT = BigtableTableAdminClient.DEFAULT_ENDPOINT - DEFAULT_MTLS_ENDPOINT = BigtableTableAdminClient.DEFAULT_MTLS_ENDPOINT - _DEFAULT_ENDPOINT_TEMPLATE = BigtableTableAdminClient._DEFAULT_ENDPOINT_TEMPLATE - _DEFAULT_UNIVERSE = BigtableTableAdminClient._DEFAULT_UNIVERSE + DEFAULT_ENDPOINT = BaseBigtableTableAdminClient.DEFAULT_ENDPOINT + DEFAULT_MTLS_ENDPOINT = BaseBigtableTableAdminClient.DEFAULT_MTLS_ENDPOINT + _DEFAULT_ENDPOINT_TEMPLATE = BaseBigtableTableAdminClient._DEFAULT_ENDPOINT_TEMPLATE + _DEFAULT_UNIVERSE = BaseBigtableTableAdminClient._DEFAULT_UNIVERSE - authorized_view_path = staticmethod(BigtableTableAdminClient.authorized_view_path) + authorized_view_path = staticmethod( + BaseBigtableTableAdminClient.authorized_view_path + ) parse_authorized_view_path = staticmethod( - BigtableTableAdminClient.parse_authorized_view_path + BaseBigtableTableAdminClient.parse_authorized_view_path ) - backup_path = staticmethod(BigtableTableAdminClient.backup_path) - parse_backup_path = staticmethod(BigtableTableAdminClient.parse_backup_path) - cluster_path = staticmethod(BigtableTableAdminClient.cluster_path) - parse_cluster_path = staticmethod(BigtableTableAdminClient.parse_cluster_path) + backup_path = staticmethod(BaseBigtableTableAdminClient.backup_path) + parse_backup_path = staticmethod(BaseBigtableTableAdminClient.parse_backup_path) + cluster_path = staticmethod(BaseBigtableTableAdminClient.cluster_path) + parse_cluster_path = staticmethod(BaseBigtableTableAdminClient.parse_cluster_path) crypto_key_version_path = staticmethod( - BigtableTableAdminClient.crypto_key_version_path + BaseBigtableTableAdminClient.crypto_key_version_path ) parse_crypto_key_version_path = staticmethod( - BigtableTableAdminClient.parse_crypto_key_version_path + BaseBigtableTableAdminClient.parse_crypto_key_version_path ) - instance_path = staticmethod(BigtableTableAdminClient.instance_path) - parse_instance_path = staticmethod(BigtableTableAdminClient.parse_instance_path) - snapshot_path = staticmethod(BigtableTableAdminClient.snapshot_path) - parse_snapshot_path = staticmethod(BigtableTableAdminClient.parse_snapshot_path) - table_path = staticmethod(BigtableTableAdminClient.table_path) - parse_table_path = staticmethod(BigtableTableAdminClient.parse_table_path) + instance_path = staticmethod(BaseBigtableTableAdminClient.instance_path) + parse_instance_path = staticmethod(BaseBigtableTableAdminClient.parse_instance_path) + snapshot_path = staticmethod(BaseBigtableTableAdminClient.snapshot_path) + parse_snapshot_path = staticmethod(BaseBigtableTableAdminClient.parse_snapshot_path) + table_path = staticmethod(BaseBigtableTableAdminClient.table_path) + parse_table_path = staticmethod(BaseBigtableTableAdminClient.parse_table_path) common_billing_account_path = staticmethod( - BigtableTableAdminClient.common_billing_account_path + BaseBigtableTableAdminClient.common_billing_account_path ) parse_common_billing_account_path = staticmethod( - BigtableTableAdminClient.parse_common_billing_account_path + BaseBigtableTableAdminClient.parse_common_billing_account_path ) - common_folder_path = staticmethod(BigtableTableAdminClient.common_folder_path) + common_folder_path = staticmethod(BaseBigtableTableAdminClient.common_folder_path) parse_common_folder_path = staticmethod( - BigtableTableAdminClient.parse_common_folder_path + BaseBigtableTableAdminClient.parse_common_folder_path ) common_organization_path = staticmethod( - BigtableTableAdminClient.common_organization_path + BaseBigtableTableAdminClient.common_organization_path ) parse_common_organization_path = staticmethod( - BigtableTableAdminClient.parse_common_organization_path + BaseBigtableTableAdminClient.parse_common_organization_path ) - common_project_path = staticmethod(BigtableTableAdminClient.common_project_path) + common_project_path = staticmethod(BaseBigtableTableAdminClient.common_project_path) parse_common_project_path = staticmethod( - BigtableTableAdminClient.parse_common_project_path + BaseBigtableTableAdminClient.parse_common_project_path + ) + common_location_path = staticmethod( + BaseBigtableTableAdminClient.common_location_path ) - common_location_path = staticmethod(BigtableTableAdminClient.common_location_path) parse_common_location_path = staticmethod( - BigtableTableAdminClient.parse_common_location_path + BaseBigtableTableAdminClient.parse_common_location_path ) @classmethod @@ -142,9 +147,9 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): kwargs: Additional arguments to pass to the constructor. Returns: - BigtableTableAdminAsyncClient: The constructed client. + BaseBigtableTableAdminAsyncClient: The constructed client. """ - return BigtableTableAdminClient.from_service_account_info.__func__(BigtableTableAdminAsyncClient, info, *args, **kwargs) # type: ignore + return BaseBigtableTableAdminClient.from_service_account_info.__func__(BaseBigtableTableAdminAsyncClient, info, *args, **kwargs) # type: ignore @classmethod def from_service_account_file(cls, filename: str, *args, **kwargs): @@ -158,9 +163,9 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): kwargs: Additional arguments to pass to the constructor. Returns: - BigtableTableAdminAsyncClient: The constructed client. + BaseBigtableTableAdminAsyncClient: The constructed client. """ - return BigtableTableAdminClient.from_service_account_file.__func__(BigtableTableAdminAsyncClient, filename, *args, **kwargs) # type: ignore + return BaseBigtableTableAdminClient.from_service_account_file.__func__(BaseBigtableTableAdminAsyncClient, filename, *args, **kwargs) # type: ignore from_service_account_json = from_service_account_file @@ -198,7 +203,7 @@ def get_mtls_endpoint_and_cert_source( Raises: google.auth.exceptions.MutualTLSChannelError: If any errors happen. """ - return BigtableTableAdminClient.get_mtls_endpoint_and_cert_source(client_options) # type: ignore + return BaseBigtableTableAdminClient.get_mtls_endpoint_and_cert_source(client_options) # type: ignore @property def transport(self) -> BigtableTableAdminTransport: @@ -228,7 +233,7 @@ def universe_domain(self) -> str: """ return self._client._universe_domain - get_transport_class = BigtableTableAdminClient.get_transport_class + get_transport_class = BaseBigtableTableAdminClient.get_transport_class def __init__( self, @@ -244,7 +249,7 @@ def __init__( client_options: Optional[ClientOptions] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: - """Instantiates the bigtable table admin async client. + """Instantiates the base bigtable table admin async client. Args: credentials (Optional[google.auth.credentials.Credentials]): The @@ -293,7 +298,7 @@ def __init__( google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport creation failed for any reason. """ - self._client = BigtableTableAdminClient( + self._client = BaseBigtableTableAdminClient( credentials=credentials, transport=transport, client_options=client_options, @@ -304,7 +309,7 @@ def __init__( std_logging.DEBUG ): # pragma: NO COVER _LOGGER.debug( - "Created client `google.bigtable.admin_v2.BigtableTableAdminAsyncClient`.", + "Created client `google.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient`.", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "universeDomain": getattr( @@ -337,8 +342,35 @@ async def create_table( The table can be created with a full set of initial column families, specified in the request. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_create_table(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.CreateTableRequest( + parent="parent_value", + table_id="table_id_value", + ) + + # Make the request + response = await client.create_table(request=request) + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateTableRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.CreateTableRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.CreateTable][google.bigtable.admin.v2.BigtableTableAdmin.CreateTable] parent (:class:`str`): @@ -358,7 +390,7 @@ async def create_table( This corresponds to the ``table_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - table (:class:`google.cloud.bigtable_admin_v2.types.Table`): + table (:class:`google.cloud.bigtable.admin_v2.types.Table`): Required. The Table to create. This corresponds to the ``table`` field on the ``request`` instance; if ``request`` is provided, this @@ -372,7 +404,7 @@ async def create_table( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Table: + google.cloud.bigtable.admin_v2.types.Table: A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its @@ -456,8 +488,40 @@ async def create_table_from_snapshot( recommended for production use. It is not subject to any SLA or deprecation policy. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_create_table_from_snapshot(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.CreateTableFromSnapshotRequest( + parent="parent_value", + table_id="table_id_value", + source_snapshot="source_snapshot_value", + ) + + # Make the request + operation = client.create_table_from_snapshot(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateTableFromSnapshotRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.CreateTableFromSnapshotRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot] @@ -504,7 +568,7 @@ async def create_table_from_snapshot( google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - 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. + 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. Each table is served using the resources of its parent cluster. @@ -581,8 +645,35 @@ async def list_tables( ) -> pagers.ListTablesAsyncPager: r"""Lists all tables served from a specified instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_list_tables(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ListTablesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tables(request=request) + + # Handle the response + async for response in page_result: + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListTablesRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.ListTablesRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables] parent (:class:`str`): @@ -602,7 +693,7 @@ async def list_tables( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListTablesAsyncPager: + google.cloud.bigtable.admin_v2.services.bigtable_table_admin.pagers.ListTablesAsyncPager: Response message for [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables] @@ -681,8 +772,34 @@ async def get_table( ) -> table.Table: r"""Gets metadata information about the specified table. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_get_table(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.GetTableRequest( + name="name_value", + ) + + # Make the request + response = await client.get_table(request=request) + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetTableRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.GetTableRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.GetTable][google.bigtable.admin.v2.BigtableTableAdmin.GetTable] name (:class:`str`): @@ -702,7 +819,7 @@ async def get_table( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Table: + google.cloud.bigtable.admin_v2.types.Table: A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its @@ -770,11 +887,40 @@ async def update_table( ) -> operation_async.AsyncOperation: r"""Updates a specified table. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_update_table(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.UpdateTableRequest( + ) + + # Make the request + operation = client.update_table(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.UpdateTableRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.UpdateTableRequest, dict]]): The request object. The request for [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable]. - table (:class:`google.cloud.bigtable_admin_v2.types.Table`): + table (:class:`google.cloud.bigtable.admin_v2.types.Table`): Required. The table to update. The table's ``name`` field is used to identify the table to update. @@ -813,7 +959,7 @@ async def update_table( google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - 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. + 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. Each table is served using the resources of its parent cluster. @@ -891,8 +1037,31 @@ async def delete_table( r"""Permanently deletes a specified table and all of its data. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_delete_table(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.DeleteTableRequest( + name="name_value", + ) + + # Make the request + await client.delete_table(request=request) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteTableRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.DeleteTableRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable] name (:class:`str`): @@ -971,8 +1140,38 @@ async def undelete_table( r"""Restores a specified table which was accidentally deleted. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_undelete_table(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.UndeleteTableRequest( + name="name_value", + ) + + # Make the request + operation = client.undelete_table(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.UndeleteTableRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.UndeleteTableRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable] name (:class:`str`): @@ -995,7 +1194,7 @@ async def undelete_table( google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - 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. + 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. Each table is served using the resources of its parent cluster. @@ -1072,8 +1271,39 @@ async def create_authorized_view( ) -> operation_async.AsyncOperation: r"""Creates a new AuthorizedView in a table. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_create_authorized_view(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.CreateAuthorizedViewRequest( + parent="parent_value", + authorized_view_id="authorized_view_id_value", + ) + + # Make the request + operation = client.create_authorized_view(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateAuthorizedViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.CreateAuthorizedViewRequest, dict]]): The request object. The request for [CreateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedView] parent (:class:`str`): @@ -1084,7 +1314,7 @@ async def create_authorized_view( This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - authorized_view (:class:`google.cloud.bigtable_admin_v2.types.AuthorizedView`): + authorized_view (:class:`google.cloud.bigtable.admin_v2.types.AuthorizedView`): Required. The AuthorizedView to create. @@ -1113,7 +1343,7 @@ async def create_authorized_view( google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - 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 + 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 can configure access to each Authorized View independently from the table and use the existing Data APIs to access the subset of data. @@ -1193,8 +1423,35 @@ async def list_authorized_views( ) -> pagers.ListAuthorizedViewsAsyncPager: r"""Lists all AuthorizedViews from a specific table. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_list_authorized_views(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ListAuthorizedViewsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_authorized_views(request=request) + + # Handle the response + async for response in page_result: + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.ListAuthorizedViewsRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews] parent (:class:`str`): @@ -1214,7 +1471,7 @@ async def list_authorized_views( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListAuthorizedViewsAsyncPager: + google.cloud.bigtable.admin_v2.services.bigtable_table_admin.pagers.ListAuthorizedViewsAsyncPager: Response message for [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews] @@ -1295,8 +1552,34 @@ async def get_authorized_view( ) -> table.AuthorizedView: r"""Gets information from a specified AuthorizedView. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_get_authorized_view(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.GetAuthorizedViewRequest( + name="name_value", + ) + + # Make the request + response = await client.get_authorized_view(request=request) + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetAuthorizedViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.GetAuthorizedViewRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView] name (:class:`str`): @@ -1316,7 +1599,7 @@ async def get_authorized_view( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.AuthorizedView: + google.cloud.bigtable.admin_v2.types.AuthorizedView: AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users can configure access to each Authorized @@ -1388,11 +1671,40 @@ async def update_authorized_view( ) -> operation_async.AsyncOperation: r"""Updates an AuthorizedView in a table. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_update_authorized_view(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.UpdateAuthorizedViewRequest( + ) + + # Make the request + operation = client.update_authorized_view(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.UpdateAuthorizedViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.UpdateAuthorizedViewRequest, dict]]): The request object. The request for [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView]. - authorized_view (:class:`google.cloud.bigtable_admin_v2.types.AuthorizedView`): + authorized_view (:class:`google.cloud.bigtable.admin_v2.types.AuthorizedView`): Required. The AuthorizedView to update. The ``name`` in ``authorized_view`` is used to identify the AuthorizedView. AuthorizedView name must in this format @@ -1426,7 +1738,7 @@ async def update_authorized_view( google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - 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 + 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 can configure access to each Authorized View independently from the table and use the existing Data APIs to access the subset of data. @@ -1506,8 +1818,31 @@ async def delete_authorized_view( ) -> None: r"""Permanently deletes a specified AuthorizedView. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_delete_authorized_view(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.DeleteAuthorizedViewRequest( + name="name_value", + ) + + # Make the request + await client.delete_authorized_view(request=request) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteAuthorizedViewRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.DeleteAuthorizedViewRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView] name (:class:`str`): @@ -1572,7 +1907,7 @@ async def delete_authorized_view( metadata=metadata, ) - async def modify_column_families( + async def _modify_column_families( self, request: Optional[ Union[bigtable_table_admin.ModifyColumnFamiliesRequest, dict] @@ -1594,8 +1929,34 @@ async def modify_column_families( data requests received prior to that point may see a table where only some modifications have taken effect. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_modify_column_families(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ModifyColumnFamiliesRequest( + name="name_value", + ) + + # Make the request + response = await client._modify_column_families(request=request) + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ModifyColumnFamiliesRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.ModifyColumnFamiliesRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies][google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies] name (:class:`str`): @@ -1606,7 +1967,7 @@ async def modify_column_families( This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - modifications (:class:`MutableSequence[google.cloud.bigtable_admin_v2.types.ModifyColumnFamiliesRequest.Modification]`): + modifications (:class:`MutableSequence[google.cloud.bigtable.admin_v2.types.ModifyColumnFamiliesRequest.Modification]`): Required. Modifications to be atomically applied to the specified table's families. Entries are applied in @@ -1627,7 +1988,7 @@ async def modify_column_families( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Table: + google.cloud.bigtable.admin_v2.types.Table: A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its @@ -1698,8 +2059,32 @@ async def drop_row_range( rows in a table, or only those that match a particular prefix. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_drop_row_range(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.DropRowRangeRequest( + row_key_prefix=b'row_key_prefix_blob', + name="name_value", + ) + + # Make the request + await client.drop_row_range(request=request) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DropRowRangeRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.DropRowRangeRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange][google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange] retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, @@ -1756,8 +2141,34 @@ async def generate_consistency_token( been replicated. The tokens will be available for 90 days. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_generate_consistency_token(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.GenerateConsistencyTokenRequest( + name="name_value", + ) + + # Make the request + response = await client.generate_consistency_token(request=request) + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GenerateConsistencyTokenRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.GenerateConsistencyTokenRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken] name (:class:`str`): @@ -1777,7 +2188,7 @@ async def generate_consistency_token( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.GenerateConsistencyTokenResponse: + google.cloud.bigtable.admin_v2.types.GenerateConsistencyTokenResponse: Response message for [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken] @@ -1850,8 +2261,35 @@ async def check_consistency( the conditions specified in the token and the check request. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_check_consistency(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.CheckConsistencyRequest( + name="name_value", + consistency_token="consistency_token_value", + ) + + # Make the request + response = await client.check_consistency(request=request) + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CheckConsistencyRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.CheckConsistencyRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency] name (:class:`str`): @@ -1878,7 +2316,7 @@ async def check_consistency( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.CheckConsistencyResponse: + google.cloud.bigtable.admin_v2.types.CheckConsistencyResponse: Response message for [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency] @@ -1934,7 +2372,7 @@ async def check_consistency( # Done; return the response. return response - async def snapshot_table( + async def _snapshot_table( self, request: Optional[ Union[bigtable_table_admin.SnapshotTableRequest, dict] @@ -1959,8 +2397,40 @@ async def snapshot_table( recommended for production use. It is not subject to any SLA or deprecation policy. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_snapshot_table(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.SnapshotTableRequest( + name="name_value", + cluster="cluster_value", + snapshot_id="snapshot_id_value", + ) + + # Make the request + operation = client._snapshot_table(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.SnapshotTableRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.SnapshotTableRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable][google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable] @@ -2013,7 +2483,7 @@ async def snapshot_table( google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - 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 + 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 checkpoint for data restoration or a data source for a new table. @@ -2088,7 +2558,7 @@ async def snapshot_table( # Done; return the response. return response - async def get_snapshot( + async def _get_snapshot( self, request: Optional[Union[bigtable_table_admin.GetSnapshotRequest, dict]] = None, *, @@ -2106,8 +2576,34 @@ async def get_snapshot( recommended for production use. It is not subject to any SLA or deprecation policy. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_get_snapshot(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.GetSnapshotRequest( + name="name_value", + ) + + # Make the request + response = await client._get_snapshot(request=request) + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetSnapshotRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.GetSnapshotRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot] @@ -2134,7 +2630,7 @@ async def get_snapshot( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Snapshot: + google.cloud.bigtable.admin_v2.types.Snapshot: A snapshot of a table at a particular time. A snapshot can be used as a checkpoint for data restoration or a @@ -2199,7 +2695,7 @@ async def get_snapshot( # Done; return the response. return response - async def list_snapshots( + async def _list_snapshots( self, request: Optional[ Union[bigtable_table_admin.ListSnapshotsRequest, dict] @@ -2219,8 +2715,35 @@ async def list_snapshots( recommended for production use. It is not subject to any SLA or deprecation policy. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_list_snapshots(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ListSnapshotsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client._list_snapshots(request=request) + + # Handle the response + async for response in page_result: + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListSnapshotsRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.ListSnapshotsRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots] @@ -2250,7 +2773,7 @@ async def list_snapshots( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListSnapshotsAsyncPager: + google.cloud.bigtable.admin_v2.services.bigtable_table_admin.pagers.ListSnapshotsAsyncPager: Response message for [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots] @@ -2325,7 +2848,7 @@ async def list_snapshots( # Done; return the response. return response - async def delete_snapshot( + async def _delete_snapshot( self, request: Optional[ Union[bigtable_table_admin.DeleteSnapshotRequest, dict] @@ -2345,8 +2868,31 @@ async def delete_snapshot( recommended for production use. It is not subject to any SLA or deprecation policy. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_delete_snapshot(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.DeleteSnapshotRequest( + name="name_value", + ) + + # Make the request + await client._delete_snapshot(request=request) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteSnapshotRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.DeleteSnapshotRequest, dict]]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot] @@ -2439,8 +2985,43 @@ async def create_backup( Cancelling the returned operation will stop the creation and delete the backup. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_create_backup(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + backup = admin_v2.Backup() + backup.source_table = "source_table_value" + + request = admin_v2.CreateBackupRequest( + parent="parent_value", + backup_id="backup_id_value", + backup=backup, + ) + + # Make the request + operation = client.create_backup(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CreateBackupRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.CreateBackupRequest, dict]]): The request object. The request for [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]. parent (:class:`str`): @@ -2464,7 +3045,7 @@ async def create_backup( This corresponds to the ``backup_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - backup (:class:`google.cloud.bigtable_admin_v2.types.Backup`): + backup (:class:`google.cloud.bigtable.admin_v2.types.Backup`): Required. The backup to create. This corresponds to the ``backup`` field on the ``request`` instance; if ``request`` is provided, this @@ -2482,7 +3063,7 @@ async def create_backup( An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.Backup` A + :class:`google.cloud.bigtable.admin_v2.types.Backup` A backup of a Cloud Bigtable table. """ @@ -2559,8 +3140,34 @@ async def get_backup( r"""Gets metadata on a pending or completed Cloud Bigtable Backup. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_get_backup(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.GetBackupRequest( + name="name_value", + ) + + # Make the request + response = await client.get_backup(request=request) + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.GetBackupRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.GetBackupRequest, dict]]): The request object. The request for [GetBackup][google.bigtable.admin.v2.BigtableTableAdmin.GetBackup]. name (:class:`str`): @@ -2579,7 +3186,7 @@ async def get_backup( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Backup: + google.cloud.bigtable.admin_v2.types.Backup: A backup of a Cloud Bigtable table. """ # Create or coerce a protobuf request object. @@ -2643,11 +3250,40 @@ async def update_backup( ) -> table.Backup: r"""Updates a pending or completed Cloud Bigtable Backup. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_update_backup(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + backup = admin_v2.Backup() + backup.source_table = "source_table_value" + + request = admin_v2.UpdateBackupRequest( + backup=backup, + ) + + # Make the request + response = await client.update_backup(request=request) + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.UpdateBackupRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.UpdateBackupRequest, dict]]): The request object. The request for [UpdateBackup][google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup]. - backup (:class:`google.cloud.bigtable_admin_v2.types.Backup`): + backup (:class:`google.cloud.bigtable.admin_v2.types.Backup`): Required. The backup to update. ``backup.name``, and the fields to be updated as specified by ``update_mask`` are required. Other fields are ignored. Update is only @@ -2679,7 +3315,7 @@ async def update_backup( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Backup: + google.cloud.bigtable.admin_v2.types.Backup: A backup of a Cloud Bigtable table. """ # Create or coerce a protobuf request object. @@ -2746,8 +3382,31 @@ async def delete_backup( ) -> None: r"""Deletes a pending or completed Cloud Bigtable backup. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_delete_backup(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.DeleteBackupRequest( + name="name_value", + ) + + # Make the request + await client.delete_backup(request=request) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.DeleteBackupRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.DeleteBackupRequest, dict]]): The request object. The request for [DeleteBackup][google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup]. name (:class:`str`): @@ -2824,8 +3483,35 @@ async def list_backups( r"""Lists Cloud Bigtable backups. Returns both completed and pending backups. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_list_backups(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ListBackupsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_backups(request=request) + + # Handle the response + async for response in page_result: + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.ListBackupsRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.ListBackupsRequest, dict]]): The request object. The request for [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]. parent (:class:`str`): @@ -2848,7 +3534,7 @@ async def list_backups( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListBackupsAsyncPager: + google.cloud.bigtable.admin_v2.services.bigtable_table_admin.pagers.ListBackupsAsyncPager: The response for [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]. @@ -2916,7 +3602,7 @@ async def list_backups( # Done; return the response. return response - async def restore_table( + async def _restore_table( self, request: Optional[Union[bigtable_table_admin.RestoreTableRequest, dict]] = None, *, @@ -2933,8 +3619,40 @@ async def restore_table( The [response][google.longrunning.Operation.response] type is [Table][google.bigtable.admin.v2.Table], if successful. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_restore_table(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.RestoreTableRequest( + backup="backup_value", + parent="parent_value", + table_id="table_id_value", + ) + + # Make the request + operation = client._restore_table(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.RestoreTableRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.RestoreTableRequest, dict]]): The request object. The request for [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]. retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any, @@ -2949,7 +3667,7 @@ async def restore_table( google.api_core.operation_async.AsyncOperation: An object representing a long-running operation. - 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. + 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. Each table is served using the resources of its parent cluster. @@ -3010,8 +3728,40 @@ async def copy_backup( destination cluster located in the destination instance and project. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + async def sample_copy_backup(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.CopyBackupRequest( + parent="parent_value", + backup_id="backup_id_value", + source_backup="source_backup_value", + ) + + # Make the request + operation = client.copy_backup(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + Args: - request (Optional[Union[google.cloud.bigtable_admin_v2.types.CopyBackupRequest, dict]]): + request (Optional[Union[google.cloud.bigtable.admin_v2.types.CopyBackupRequest, dict]]): The request object. The request for [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]. parent (:class:`str`): @@ -3071,7 +3821,7 @@ async def copy_backup( An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.Backup` A + :class:`google.cloud.bigtable.admin_v2.types.Backup` A backup of a Cloud Bigtable table. """ @@ -3151,6 +3901,33 @@ async def get_iam_policy( resource. Returns an empty policy if the resource exists but does not have a policy set. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + from google.iam.v1 import iam_policy_pb2 # type: ignore + + async def sample_get_iam_policy(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = iam_policy_pb2.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = await client.get_iam_policy(request=request) + + # Handle the response + print(response) + Args: request (Optional[Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]]): The request object. Request message for ``GetIamPolicy`` method. @@ -3263,6 +4040,33 @@ async def set_iam_policy( r"""Sets the access control policy on a Table or Backup resource. Replaces any existing policy. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + from google.iam.v1 import iam_policy_pb2 # type: ignore + + async def sample_set_iam_policy(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = iam_policy_pb2.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = await client.set_iam_policy(request=request) + + # Handle the response + print(response) + Args: request (Optional[Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]]): The request object. Request message for ``SetIamPolicy`` method. @@ -3376,6 +4180,34 @@ async def test_iam_permissions( r"""Returns permissions that the caller has on the specified Table or Backup resource. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + from google.iam.v1 import iam_policy_pb2 # type: ignore + + async def sample_test_iam_permissions(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = iam_policy_pb2.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value1', 'permissions_value2'], + ) + + # Make the request + response = await client.test_iam_permissions(request=request) + + # Handle the response + print(response) + Args: request (Optional[Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]]): The request object. Request message for ``TestIamPermissions`` method. @@ -3457,7 +4289,7 @@ async def test_iam_permissions( # Done; return the response. return response - async def __aenter__(self) -> "BigtableTableAdminAsyncClient": + async def __aenter__(self) -> "BaseBigtableTableAdminAsyncClient": return self async def __aexit__(self, exc_type, exc, tb): @@ -3468,5 +4300,8 @@ async def __aexit__(self, exc_type, exc, tb): gapic_version=package_version.__version__ ) +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ + -__all__ = ("BigtableTableAdminAsyncClient",) +__all__ = ("BaseBigtableTableAdminAsyncClient",) diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/client.py b/google/cloud/bigtable/admin_v2/services/bigtable_table_admin/client.py similarity index 81% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/client.py rename to google/cloud/bigtable/admin_v2/services/bigtable_table_admin/client.py index cc69fa051..1cc5b2252 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/client.py +++ b/google/cloud/bigtable/admin_v2/services/bigtable_table_admin/client.py @@ -34,7 +34,7 @@ ) import warnings -from google.cloud.bigtable_admin_v2 import gapic_version as package_version +from google.cloud.bigtable.admin_v2 import gapic_version as package_version from google.api_core import client_options as client_options_lib from google.api_core import exceptions as core_exceptions @@ -45,6 +45,7 @@ from google.auth.transport.grpc import SslCredentials # type: ignore from google.auth.exceptions import MutualTLSChannelError # type: ignore from google.oauth2 import service_account # type: ignore +import google.protobuf try: OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None] @@ -62,11 +63,11 @@ from google.api_core import operation # type: ignore from google.api_core import operation_async # type: ignore -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import pagers -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.types import table -from google.cloud.bigtable_admin_v2.types import table as gba_table -from google.cloud.bigtable_admin_v2.types import types +from google.cloud.bigtable.admin_v2.services.bigtable_table_admin import pagers +from google.cloud.bigtable.admin_v2.types import bigtable_table_admin +from google.cloud.bigtable.admin_v2.types import table +from google.cloud.bigtable.admin_v2.types import table as gba_table +from google.cloud.bigtable.admin_v2.types import types from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore @@ -77,7 +78,7 @@ from .transports.rest import BigtableTableAdminRestTransport -class BigtableTableAdminClientMeta(type): +class BaseBigtableTableAdminClientMeta(type): """Metaclass for the BigtableTableAdmin client. This provides class-level methods for building and retrieving @@ -114,7 +115,7 @@ def get_transport_class( return next(iter(cls._transport_registry.values())) -class BigtableTableAdminClient(metaclass=BigtableTableAdminClientMeta): +class BaseBigtableTableAdminClient(metaclass=BaseBigtableTableAdminClientMeta): """Service for creating, configuring, and deleting Cloud Bigtable tables. @@ -172,7 +173,7 @@ def from_service_account_info(cls, info: dict, *args, **kwargs): kwargs: Additional arguments to pass to the constructor. Returns: - BigtableTableAdminClient: The constructed client. + BaseBigtableTableAdminClient: The constructed client. """ credentials = service_account.Credentials.from_service_account_info(info) kwargs["credentials"] = credentials @@ -190,7 +191,7 @@ def from_service_account_file(cls, filename: str, *args, **kwargs): kwargs: Additional arguments to pass to the constructor. Returns: - BigtableTableAdminClient: The constructed client. + BaseBigtableTableAdminClient: The constructed client. """ credentials = service_account.Credentials.from_service_account_file(filename) kwargs["credentials"] = credentials @@ -586,15 +587,17 @@ def _get_api_endpoint( elif use_mtls_endpoint == "always" or ( use_mtls_endpoint == "auto" and client_cert_source ): - _default_universe = BigtableTableAdminClient._DEFAULT_UNIVERSE + _default_universe = BaseBigtableTableAdminClient._DEFAULT_UNIVERSE if universe_domain != _default_universe: raise MutualTLSChannelError( f"mTLS is not supported in any universe other than {_default_universe}." ) - api_endpoint = BigtableTableAdminClient.DEFAULT_MTLS_ENDPOINT + api_endpoint = BaseBigtableTableAdminClient.DEFAULT_MTLS_ENDPOINT else: - api_endpoint = BigtableTableAdminClient._DEFAULT_ENDPOINT_TEMPLATE.format( - UNIVERSE_DOMAIN=universe_domain + api_endpoint = ( + BaseBigtableTableAdminClient._DEFAULT_ENDPOINT_TEMPLATE.format( + UNIVERSE_DOMAIN=universe_domain + ) ) return api_endpoint @@ -614,7 +617,7 @@ def _get_universe_domain( Raises: ValueError: If the universe domain is an empty string. """ - universe_domain = BigtableTableAdminClient._DEFAULT_UNIVERSE + universe_domain = BaseBigtableTableAdminClient._DEFAULT_UNIVERSE if client_universe_domain is not None: universe_domain = client_universe_domain elif universe_domain_env is not None: @@ -695,7 +698,7 @@ def __init__( client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None, client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO, ) -> None: - """Instantiates the bigtable table admin client. + """Instantiates the base bigtable table admin client. Args: credentials (Optional[google.auth.credentials.Credentials]): The @@ -759,11 +762,11 @@ def __init__( self._use_client_cert, self._use_mtls_endpoint, self._universe_domain_env, - ) = BigtableTableAdminClient._read_environment_variables() - self._client_cert_source = BigtableTableAdminClient._get_client_cert_source( + ) = BaseBigtableTableAdminClient._read_environment_variables() + self._client_cert_source = BaseBigtableTableAdminClient._get_client_cert_source( self._client_options.client_cert_source, self._use_client_cert ) - self._universe_domain = BigtableTableAdminClient._get_universe_domain( + self._universe_domain = BaseBigtableTableAdminClient._get_universe_domain( universe_domain_opt, self._universe_domain_env ) self._api_endpoint = None # updated below, depending on `transport` @@ -802,7 +805,7 @@ def __init__( self._api_endpoint = ( self._api_endpoint - or BigtableTableAdminClient._get_api_endpoint( + or BaseBigtableTableAdminClient._get_api_endpoint( self._client_options.api_endpoint, self._client_cert_source, self._universe_domain, @@ -824,7 +827,7 @@ def __init__( Type[BigtableTableAdminTransport], Callable[..., BigtableTableAdminTransport], ] = ( - BigtableTableAdminClient.get_transport_class(transport) + BaseBigtableTableAdminClient.get_transport_class(transport) if isinstance(transport, str) or transport is None else cast(Callable[..., BigtableTableAdminTransport], transport) ) @@ -846,7 +849,7 @@ def __init__( std_logging.DEBUG ): # pragma: NO COVER _LOGGER.debug( - "Created client `google.bigtable.admin_v2.BigtableTableAdminClient`.", + "Created client `google.bigtable.admin_v2.BaseBigtableTableAdminClient`.", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "universeDomain": getattr( @@ -879,8 +882,35 @@ def create_table( The table can be created with a full set of initial column families, specified in the request. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_create_table(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.CreateTableRequest( + parent="parent_value", + table_id="table_id_value", + ) + + # Make the request + response = client.create_table(request=request) + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.CreateTableRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.CreateTableRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.CreateTable][google.bigtable.admin.v2.BigtableTableAdmin.CreateTable] parent (str): @@ -900,7 +930,7 @@ def create_table( This corresponds to the ``table_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - table (google.cloud.bigtable_admin_v2.types.Table): + table (google.cloud.bigtable.admin_v2.types.Table): Required. The Table to create. This corresponds to the ``table`` field on the ``request`` instance; if ``request`` is provided, this @@ -914,7 +944,7 @@ def create_table( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Table: + google.cloud.bigtable.admin_v2.types.Table: A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its @@ -995,8 +1025,40 @@ def create_table_from_snapshot( recommended for production use. It is not subject to any SLA or deprecation policy. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_create_table_from_snapshot(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.CreateTableFromSnapshotRequest( + parent="parent_value", + table_id="table_id_value", + source_snapshot="source_snapshot_value", + ) + + # Make the request + operation = client.create_table_from_snapshot(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.CreateTableFromSnapshotRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.CreateTableFromSnapshotRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot] @@ -1043,7 +1105,7 @@ def create_table_from_snapshot( google.api_core.operation.Operation: An object representing a long-running operation. - 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. + 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. Each table is served using the resources of its parent cluster. @@ -1119,8 +1181,35 @@ def list_tables( ) -> pagers.ListTablesPager: r"""Lists all tables served from a specified instance. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_list_tables(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.ListTablesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tables(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListTablesRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.ListTablesRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables] parent (str): @@ -1140,7 +1229,7 @@ def list_tables( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListTablesPager: + google.cloud.bigtable.admin_v2.services.bigtable_table_admin.pagers.ListTablesPager: Response message for [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables] @@ -1216,8 +1305,34 @@ def get_table( ) -> table.Table: r"""Gets metadata information about the specified table. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_get_table(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.GetTableRequest( + name="name_value", + ) + + # Make the request + response = client.get_table(request=request) + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.GetTableRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.GetTableRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.GetTable][google.bigtable.admin.v2.BigtableTableAdmin.GetTable] name (str): @@ -1237,7 +1352,7 @@ def get_table( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Table: + google.cloud.bigtable.admin_v2.types.Table: A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its @@ -1302,11 +1417,40 @@ def update_table( ) -> operation.Operation: r"""Updates a specified table. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_update_table(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.UpdateTableRequest( + ) + + # Make the request + operation = client.update_table(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.UpdateTableRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.UpdateTableRequest, dict]): The request object. The request for [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable]. - table (google.cloud.bigtable_admin_v2.types.Table): + table (google.cloud.bigtable.admin_v2.types.Table): Required. The table to update. The table's ``name`` field is used to identify the table to update. @@ -1345,7 +1489,7 @@ def update_table( google.api_core.operation.Operation: An object representing a long-running operation. - 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. + 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. Each table is served using the resources of its parent cluster. @@ -1420,8 +1564,31 @@ def delete_table( r"""Permanently deletes a specified table and all of its data. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_delete_table(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.DeleteTableRequest( + name="name_value", + ) + + # Make the request + client.delete_table(request=request) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.DeleteTableRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.DeleteTableRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable] name (str): @@ -1497,8 +1664,38 @@ def undelete_table( r"""Restores a specified table which was accidentally deleted. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_undelete_table(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.UndeleteTableRequest( + name="name_value", + ) + + # Make the request + operation = client.undelete_table(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.UndeleteTableRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.UndeleteTableRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable][google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable] name (str): @@ -1521,7 +1718,7 @@ def undelete_table( google.api_core.operation.Operation: An object representing a long-running operation. - 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. + 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. Each table is served using the resources of its parent cluster. @@ -1595,8 +1792,39 @@ def create_authorized_view( ) -> operation.Operation: r"""Creates a new AuthorizedView in a table. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_create_authorized_view(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.CreateAuthorizedViewRequest( + parent="parent_value", + authorized_view_id="authorized_view_id_value", + ) + + # Make the request + operation = client.create_authorized_view(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.CreateAuthorizedViewRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.CreateAuthorizedViewRequest, dict]): The request object. The request for [CreateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedView] parent (str): @@ -1607,7 +1835,7 @@ def create_authorized_view( This corresponds to the ``parent`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - authorized_view (google.cloud.bigtable_admin_v2.types.AuthorizedView): + authorized_view (google.cloud.bigtable.admin_v2.types.AuthorizedView): Required. The AuthorizedView to create. @@ -1636,7 +1864,7 @@ def create_authorized_view( google.api_core.operation.Operation: An object representing a long-running operation. - 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 + 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 can configure access to each Authorized View independently from the table and use the existing Data APIs to access the subset of data. @@ -1713,8 +1941,35 @@ def list_authorized_views( ) -> pagers.ListAuthorizedViewsPager: r"""Lists all AuthorizedViews from a specific table. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_list_authorized_views(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.ListAuthorizedViewsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_authorized_views(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.ListAuthorizedViewsRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews] parent (str): @@ -1734,7 +1989,7 @@ def list_authorized_views( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListAuthorizedViewsPager: + google.cloud.bigtable.admin_v2.services.bigtable_table_admin.pagers.ListAuthorizedViewsPager: Response message for [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews] @@ -1812,8 +2067,34 @@ def get_authorized_view( ) -> table.AuthorizedView: r"""Gets information from a specified AuthorizedView. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_get_authorized_view(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.GetAuthorizedViewRequest( + name="name_value", + ) + + # Make the request + response = client.get_authorized_view(request=request) + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.GetAuthorizedViewRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.GetAuthorizedViewRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView] name (str): @@ -1833,7 +2114,7 @@ def get_authorized_view( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.AuthorizedView: + google.cloud.bigtable.admin_v2.types.AuthorizedView: AuthorizedViews represent subsets of a particular Cloud Bigtable table. Users can configure access to each Authorized @@ -1902,11 +2183,40 @@ def update_authorized_view( ) -> operation.Operation: r"""Updates an AuthorizedView in a table. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_update_authorized_view(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.UpdateAuthorizedViewRequest( + ) + + # Make the request + operation = client.update_authorized_view(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.UpdateAuthorizedViewRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.UpdateAuthorizedViewRequest, dict]): The request object. The request for [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView]. - authorized_view (google.cloud.bigtable_admin_v2.types.AuthorizedView): + authorized_view (google.cloud.bigtable.admin_v2.types.AuthorizedView): Required. The AuthorizedView to update. The ``name`` in ``authorized_view`` is used to identify the AuthorizedView. AuthorizedView name must in this format @@ -1940,7 +2250,7 @@ def update_authorized_view( google.api_core.operation.Operation: An object representing a long-running operation. - 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 + 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 can configure access to each Authorized View independently from the table and use the existing Data APIs to access the subset of data. @@ -2017,8 +2327,31 @@ def delete_authorized_view( ) -> None: r"""Permanently deletes a specified AuthorizedView. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_delete_authorized_view(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.DeleteAuthorizedViewRequest( + name="name_value", + ) + + # Make the request + client.delete_authorized_view(request=request) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.DeleteAuthorizedViewRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.DeleteAuthorizedViewRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView] name (str): @@ -2080,7 +2413,7 @@ def delete_authorized_view( metadata=metadata, ) - def modify_column_families( + def _modify_column_families( self, request: Optional[ Union[bigtable_table_admin.ModifyColumnFamiliesRequest, dict] @@ -2102,8 +2435,34 @@ def modify_column_families( data requests received prior to that point may see a table where only some modifications have taken effect. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_modify_column_families(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.ModifyColumnFamiliesRequest( + name="name_value", + ) + + # Make the request + response = client._modify_column_families(request=request) + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.ModifyColumnFamiliesRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.ModifyColumnFamiliesRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies][google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies] name (str): @@ -2114,7 +2473,7 @@ def modify_column_families( This corresponds to the ``name`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - modifications (MutableSequence[google.cloud.bigtable_admin_v2.types.ModifyColumnFamiliesRequest.Modification]): + modifications (MutableSequence[google.cloud.bigtable.admin_v2.types.ModifyColumnFamiliesRequest.Modification]): Required. Modifications to be atomically applied to the specified table's families. Entries are applied in @@ -2135,7 +2494,7 @@ def modify_column_families( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Table: + google.cloud.bigtable.admin_v2.types.Table: A collection of user data indexed by row, column, and timestamp. Each table is served using the resources of its @@ -2203,8 +2562,32 @@ def drop_row_range( rows in a table, or only those that match a particular prefix. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_drop_row_range(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.DropRowRangeRequest( + row_key_prefix=b'row_key_prefix_blob', + name="name_value", + ) + + # Make the request + client.drop_row_range(request=request) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.DropRowRangeRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.DropRowRangeRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange][google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange] retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -2259,8 +2642,34 @@ def generate_consistency_token( been replicated. The tokens will be available for 90 days. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_generate_consistency_token(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.GenerateConsistencyTokenRequest( + name="name_value", + ) + + # Make the request + response = client.generate_consistency_token(request=request) + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.GenerateConsistencyTokenRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.GenerateConsistencyTokenRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken] name (str): @@ -2280,7 +2689,7 @@ def generate_consistency_token( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.GenerateConsistencyTokenResponse: + google.cloud.bigtable.admin_v2.types.GenerateConsistencyTokenResponse: Response message for [google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken][google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken] @@ -2352,8 +2761,35 @@ def check_consistency( the conditions specified in the token and the check request. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_check_consistency(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.CheckConsistencyRequest( + name="name_value", + consistency_token="consistency_token_value", + ) + + # Make the request + response = client.check_consistency(request=request) + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.CheckConsistencyRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.CheckConsistencyRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency] name (str): @@ -2380,7 +2816,7 @@ def check_consistency( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.CheckConsistencyResponse: + google.cloud.bigtable.admin_v2.types.CheckConsistencyResponse: Response message for [google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency][google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency] @@ -2433,7 +2869,7 @@ def check_consistency( # Done; return the response. return response - def snapshot_table( + def _snapshot_table( self, request: Optional[ Union[bigtable_table_admin.SnapshotTableRequest, dict] @@ -2458,8 +2894,40 @@ def snapshot_table( recommended for production use. It is not subject to any SLA or deprecation policy. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_snapshot_table(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.SnapshotTableRequest( + name="name_value", + cluster="cluster_value", + snapshot_id="snapshot_id_value", + ) + + # Make the request + operation = client._snapshot_table(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.SnapshotTableRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.SnapshotTableRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable][google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable] @@ -2512,7 +2980,7 @@ def snapshot_table( google.api_core.operation.Operation: An object representing a long-running operation. - 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 + 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 checkpoint for data restoration or a data source for a new table. @@ -2584,7 +3052,7 @@ def snapshot_table( # Done; return the response. return response - def get_snapshot( + def _get_snapshot( self, request: Optional[Union[bigtable_table_admin.GetSnapshotRequest, dict]] = None, *, @@ -2602,8 +3070,34 @@ def get_snapshot( recommended for production use. It is not subject to any SLA or deprecation policy. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_get_snapshot(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.GetSnapshotRequest( + name="name_value", + ) + + # Make the request + response = client._get_snapshot(request=request) + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.GetSnapshotRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.GetSnapshotRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot] @@ -2630,7 +3124,7 @@ def get_snapshot( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Snapshot: + google.cloud.bigtable.admin_v2.types.Snapshot: A snapshot of a table at a particular time. A snapshot can be used as a checkpoint for data restoration or a @@ -2692,7 +3186,7 @@ def get_snapshot( # Done; return the response. return response - def list_snapshots( + def _list_snapshots( self, request: Optional[ Union[bigtable_table_admin.ListSnapshotsRequest, dict] @@ -2712,8 +3206,35 @@ def list_snapshots( recommended for production use. It is not subject to any SLA or deprecation policy. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_list_snapshots(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.ListSnapshotsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client._list_snapshots(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListSnapshotsRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.ListSnapshotsRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots] @@ -2743,7 +3264,7 @@ def list_snapshots( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListSnapshotsPager: + google.cloud.bigtable.admin_v2.services.bigtable_table_admin.pagers.ListSnapshotsPager: Response message for [google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots][google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots] @@ -2815,7 +3336,7 @@ def list_snapshots( # Done; return the response. return response - def delete_snapshot( + def _delete_snapshot( self, request: Optional[ Union[bigtable_table_admin.DeleteSnapshotRequest, dict] @@ -2835,8 +3356,31 @@ def delete_snapshot( recommended for production use. It is not subject to any SLA or deprecation policy. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_delete_snapshot(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.DeleteSnapshotRequest( + name="name_value", + ) + + # Make the request + client._delete_snapshot(request=request) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.DeleteSnapshotRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.DeleteSnapshotRequest, dict]): The request object. Request message for [google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot][google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot] @@ -2926,8 +3470,43 @@ def create_backup( Cancelling the returned operation will stop the creation and delete the backup. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_create_backup(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + backup = admin_v2.Backup() + backup.source_table = "source_table_value" + + request = admin_v2.CreateBackupRequest( + parent="parent_value", + backup_id="backup_id_value", + backup=backup, + ) + + # Make the request + operation = client.create_backup(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.CreateBackupRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.CreateBackupRequest, dict]): The request object. The request for [CreateBackup][google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup]. parent (str): @@ -2951,7 +3530,7 @@ def create_backup( This corresponds to the ``backup_id`` field on the ``request`` instance; if ``request`` is provided, this should not be set. - backup (google.cloud.bigtable_admin_v2.types.Backup): + backup (google.cloud.bigtable.admin_v2.types.Backup): Required. The backup to create. This corresponds to the ``backup`` field on the ``request`` instance; if ``request`` is provided, this @@ -2969,7 +3548,7 @@ def create_backup( An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.Backup` A + :class:`google.cloud.bigtable.admin_v2.types.Backup` A backup of a Cloud Bigtable table. """ @@ -3043,8 +3622,34 @@ def get_backup( r"""Gets metadata on a pending or completed Cloud Bigtable Backup. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_get_backup(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.GetBackupRequest( + name="name_value", + ) + + # Make the request + response = client.get_backup(request=request) + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.GetBackupRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.GetBackupRequest, dict]): The request object. The request for [GetBackup][google.bigtable.admin.v2.BigtableTableAdmin.GetBackup]. name (str): @@ -3063,7 +3668,7 @@ def get_backup( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Backup: + google.cloud.bigtable.admin_v2.types.Backup: A backup of a Cloud Bigtable table. """ # Create or coerce a protobuf request object. @@ -3124,11 +3729,40 @@ def update_backup( ) -> table.Backup: r"""Updates a pending or completed Cloud Bigtable Backup. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_update_backup(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + backup = admin_v2.Backup() + backup.source_table = "source_table_value" + + request = admin_v2.UpdateBackupRequest( + backup=backup, + ) + + # Make the request + response = client.update_backup(request=request) + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.UpdateBackupRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.UpdateBackupRequest, dict]): The request object. The request for [UpdateBackup][google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup]. - backup (google.cloud.bigtable_admin_v2.types.Backup): + backup (google.cloud.bigtable.admin_v2.types.Backup): Required. The backup to update. ``backup.name``, and the fields to be updated as specified by ``update_mask`` are required. Other fields are ignored. Update is only @@ -3160,7 +3794,7 @@ def update_backup( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.types.Backup: + google.cloud.bigtable.admin_v2.types.Backup: A backup of a Cloud Bigtable table. """ # Create or coerce a protobuf request object. @@ -3224,8 +3858,31 @@ def delete_backup( ) -> None: r"""Deletes a pending or completed Cloud Bigtable backup. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_delete_backup(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.DeleteBackupRequest( + name="name_value", + ) + + # Make the request + client.delete_backup(request=request) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.DeleteBackupRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.DeleteBackupRequest, dict]): The request object. The request for [DeleteBackup][google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup]. name (str): @@ -3299,8 +3956,35 @@ def list_backups( r"""Lists Cloud Bigtable backups. Returns both completed and pending backups. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_list_backups(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.ListBackupsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_backups(request=request) + + # Handle the response + for response in page_result: + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.ListBackupsRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.ListBackupsRequest, dict]): The request object. The request for [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]. parent (str): @@ -3323,7 +4007,7 @@ def list_backups( be of type `bytes`. Returns: - google.cloud.bigtable_admin_v2.services.bigtable_table_admin.pagers.ListBackupsPager: + google.cloud.bigtable.admin_v2.services.bigtable_table_admin.pagers.ListBackupsPager: The response for [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]. @@ -3388,7 +4072,7 @@ def list_backups( # Done; return the response. return response - def restore_table( + def _restore_table( self, request: Optional[Union[bigtable_table_admin.RestoreTableRequest, dict]] = None, *, @@ -3405,8 +4089,40 @@ def restore_table( The [response][google.longrunning.Operation.response] type is [Table][google.bigtable.admin.v2.Table], if successful. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_restore_table(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.RestoreTableRequest( + backup="backup_value", + parent="parent_value", + table_id="table_id_value", + ) + + # Make the request + operation = client._restore_table(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.RestoreTableRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.RestoreTableRequest, dict]): The request object. The request for [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable]. retry (google.api_core.retry.Retry): Designation of what errors, if any, @@ -3421,7 +4137,7 @@ def restore_table( google.api_core.operation.Operation: An object representing a long-running operation. - 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. + 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. Each table is served using the resources of its parent cluster. @@ -3480,8 +4196,40 @@ def copy_backup( destination cluster located in the destination instance and project. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + + def sample_copy_backup(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.CopyBackupRequest( + parent="parent_value", + backup_id="backup_id_value", + source_backup="source_backup_value", + ) + + # Make the request + operation = client.copy_backup(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + Args: - request (Union[google.cloud.bigtable_admin_v2.types.CopyBackupRequest, dict]): + request (Union[google.cloud.bigtable.admin_v2.types.CopyBackupRequest, dict]): The request object. The request for [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup]. parent (str): @@ -3541,7 +4289,7 @@ def copy_backup( An object representing a long-running operation. The result type for the operation will be - :class:`google.cloud.bigtable_admin_v2.types.Backup` A + :class:`google.cloud.bigtable.admin_v2.types.Backup` A backup of a Cloud Bigtable table. """ @@ -3618,6 +4366,33 @@ def get_iam_policy( resource. Returns an empty policy if the resource exists but does not have a policy set. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + from google.iam.v1 import iam_policy_pb2 # type: ignore + + def sample_get_iam_policy(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = iam_policy_pb2.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.GetIamPolicyRequest, dict]): The request object. Request message for ``GetIamPolicy`` method. @@ -3731,6 +4506,33 @@ def set_iam_policy( r"""Sets the access control policy on a Table or Backup resource. Replaces any existing policy. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + from google.iam.v1 import iam_policy_pb2 # type: ignore + + def sample_set_iam_policy(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = iam_policy_pb2.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.SetIamPolicyRequest, dict]): The request object. Request message for ``SetIamPolicy`` method. @@ -3845,6 +4647,34 @@ def test_iam_permissions( r"""Returns permissions that the caller has on the specified Table or Backup resource. + .. code-block:: python + + # This snippet has been automatically generated and should be regarded as a + # code template only. + # It will require modifications to work: + # - It may require correct/in-range values for request initialization. + # - It may require specifying regional endpoints when creating the service + # client as shown in: + # https://googleapis.dev/python/google-api-core/latest/client_options.html + from google.cloud.bigtable import admin_v2 + from google.iam.v1 import iam_policy_pb2 # type: ignore + + def sample_test_iam_permissions(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = iam_policy_pb2.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value1', 'permissions_value2'], + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + Args: request (Union[google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest, dict]): The request object. Request message for ``TestIamPermissions`` method. @@ -3927,7 +4757,7 @@ def test_iam_permissions( # Done; return the response. return response - def __enter__(self) -> "BigtableTableAdminClient": + def __enter__(self) -> "BaseBigtableTableAdminClient": return self def __exit__(self, type, value, traceback): @@ -3945,5 +4775,7 @@ def __exit__(self, type, value, traceback): gapic_version=package_version.__version__ ) +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ -__all__ = ("BigtableTableAdminClient",) +__all__ = ("BaseBigtableTableAdminClient",) diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/pagers.py b/google/cloud/bigtable/admin_v2/services/bigtable_table_admin/pagers.py similarity index 92% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/pagers.py rename to google/cloud/bigtable/admin_v2/services/bigtable_table_admin/pagers.py index 8b1ffba34..ddfa74358 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/pagers.py +++ b/google/cloud/bigtable/admin_v2/services/bigtable_table_admin/pagers.py @@ -37,15 +37,15 @@ OptionalRetry = Union[retries.Retry, object, None] # type: ignore OptionalAsyncRetry = Union[retries_async.AsyncRetry, object, None] # type: ignore -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.types import table +from google.cloud.bigtable.admin_v2.types import bigtable_table_admin +from google.cloud.bigtable.admin_v2.types import table class ListTablesPager: """A pager for iterating through ``list_tables`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListTablesResponse` object, and + :class:`google.cloud.bigtable.admin_v2.types.ListTablesResponse` object, and provides an ``__iter__`` method to iterate through its ``tables`` field. @@ -54,7 +54,7 @@ class ListTablesPager: through the ``tables`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListTablesResponse` + All the usual :class:`google.cloud.bigtable.admin_v2.types.ListTablesResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -74,9 +74,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListTablesRequest): + request (google.cloud.bigtable.admin_v2.types.ListTablesRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListTablesResponse): + response (google.cloud.bigtable.admin_v2.types.ListTablesResponse): The initial response object. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -121,7 +121,7 @@ class ListTablesAsyncPager: """A pager for iterating through ``list_tables`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListTablesResponse` object, and + :class:`google.cloud.bigtable.admin_v2.types.ListTablesResponse` object, and provides an ``__aiter__`` method to iterate through its ``tables`` field. @@ -130,7 +130,7 @@ class ListTablesAsyncPager: through the ``tables`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListTablesResponse` + All the usual :class:`google.cloud.bigtable.admin_v2.types.ListTablesResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -150,9 +150,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListTablesRequest): + request (google.cloud.bigtable.admin_v2.types.ListTablesRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListTablesResponse): + response (google.cloud.bigtable.admin_v2.types.ListTablesResponse): The initial response object. retry (google.api_core.retry.AsyncRetry): Designation of what errors, if any, should be retried. @@ -201,7 +201,7 @@ class ListAuthorizedViewsPager: """A pager for iterating through ``list_authorized_views`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsResponse` object, and + :class:`google.cloud.bigtable.admin_v2.types.ListAuthorizedViewsResponse` object, and provides an ``__iter__`` method to iterate through its ``authorized_views`` field. @@ -210,7 +210,7 @@ class ListAuthorizedViewsPager: through the ``authorized_views`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsResponse` + All the usual :class:`google.cloud.bigtable.admin_v2.types.ListAuthorizedViewsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -230,9 +230,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsRequest): + request (google.cloud.bigtable.admin_v2.types.ListAuthorizedViewsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsResponse): + response (google.cloud.bigtable.admin_v2.types.ListAuthorizedViewsResponse): The initial response object. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -277,7 +277,7 @@ class ListAuthorizedViewsAsyncPager: """A pager for iterating through ``list_authorized_views`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsResponse` object, and + :class:`google.cloud.bigtable.admin_v2.types.ListAuthorizedViewsResponse` object, and provides an ``__aiter__`` method to iterate through its ``authorized_views`` field. @@ -286,7 +286,7 @@ class ListAuthorizedViewsAsyncPager: through the ``authorized_views`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsResponse` + All the usual :class:`google.cloud.bigtable.admin_v2.types.ListAuthorizedViewsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -308,9 +308,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsRequest): + request (google.cloud.bigtable.admin_v2.types.ListAuthorizedViewsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListAuthorizedViewsResponse): + response (google.cloud.bigtable.admin_v2.types.ListAuthorizedViewsResponse): The initial response object. retry (google.api_core.retry.AsyncRetry): Designation of what errors, if any, should be retried. @@ -361,7 +361,7 @@ class ListSnapshotsPager: """A pager for iterating through ``list_snapshots`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListSnapshotsResponse` object, and + :class:`google.cloud.bigtable.admin_v2.types.ListSnapshotsResponse` object, and provides an ``__iter__`` method to iterate through its ``snapshots`` field. @@ -370,7 +370,7 @@ class ListSnapshotsPager: through the ``snapshots`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListSnapshotsResponse` + All the usual :class:`google.cloud.bigtable.admin_v2.types.ListSnapshotsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -390,9 +390,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListSnapshotsRequest): + request (google.cloud.bigtable.admin_v2.types.ListSnapshotsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListSnapshotsResponse): + response (google.cloud.bigtable.admin_v2.types.ListSnapshotsResponse): The initial response object. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -437,7 +437,7 @@ class ListSnapshotsAsyncPager: """A pager for iterating through ``list_snapshots`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListSnapshotsResponse` object, and + :class:`google.cloud.bigtable.admin_v2.types.ListSnapshotsResponse` object, and provides an ``__aiter__`` method to iterate through its ``snapshots`` field. @@ -446,7 +446,7 @@ class ListSnapshotsAsyncPager: through the ``snapshots`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListSnapshotsResponse` + All the usual :class:`google.cloud.bigtable.admin_v2.types.ListSnapshotsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -466,9 +466,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListSnapshotsRequest): + request (google.cloud.bigtable.admin_v2.types.ListSnapshotsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListSnapshotsResponse): + response (google.cloud.bigtable.admin_v2.types.ListSnapshotsResponse): The initial response object. retry (google.api_core.retry.AsyncRetry): Designation of what errors, if any, should be retried. @@ -517,7 +517,7 @@ class ListBackupsPager: """A pager for iterating through ``list_backups`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListBackupsResponse` object, and + :class:`google.cloud.bigtable.admin_v2.types.ListBackupsResponse` object, and provides an ``__iter__`` method to iterate through its ``backups`` field. @@ -526,7 +526,7 @@ class ListBackupsPager: through the ``backups`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListBackupsResponse` + All the usual :class:`google.cloud.bigtable.admin_v2.types.ListBackupsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -546,9 +546,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListBackupsRequest): + request (google.cloud.bigtable.admin_v2.types.ListBackupsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListBackupsResponse): + response (google.cloud.bigtable.admin_v2.types.ListBackupsResponse): The initial response object. retry (google.api_core.retry.Retry): Designation of what errors, if any, should be retried. @@ -593,7 +593,7 @@ class ListBackupsAsyncPager: """A pager for iterating through ``list_backups`` requests. This class thinly wraps an initial - :class:`google.cloud.bigtable_admin_v2.types.ListBackupsResponse` object, and + :class:`google.cloud.bigtable.admin_v2.types.ListBackupsResponse` object, and provides an ``__aiter__`` method to iterate through its ``backups`` field. @@ -602,7 +602,7 @@ class ListBackupsAsyncPager: through the ``backups`` field on the corresponding responses. - All the usual :class:`google.cloud.bigtable_admin_v2.types.ListBackupsResponse` + All the usual :class:`google.cloud.bigtable.admin_v2.types.ListBackupsResponse` attributes are available on the pager. If multiple requests are made, only the most recent response is retained, and thus used for attribute lookup. """ @@ -622,9 +622,9 @@ def __init__( Args: method (Callable): The method that was originally called, and which instantiated this pager. - request (google.cloud.bigtable_admin_v2.types.ListBackupsRequest): + request (google.cloud.bigtable.admin_v2.types.ListBackupsRequest): The initial request object. - response (google.cloud.bigtable_admin_v2.types.ListBackupsResponse): + response (google.cloud.bigtable.admin_v2.types.ListBackupsResponse): The initial response object. retry (google.api_core.retry.AsyncRetry): Designation of what errors, if any, should be retried. diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/README.rst b/google/cloud/bigtable/admin_v2/services/bigtable_table_admin/transports/README.rst similarity index 100% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/README.rst rename to google/cloud/bigtable/admin_v2/services/bigtable_table_admin/transports/README.rst diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/__init__.py b/google/cloud/bigtable/admin_v2/services/bigtable_table_admin/transports/__init__.py similarity index 100% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/__init__.py rename to google/cloud/bigtable/admin_v2/services/bigtable_table_admin/transports/__init__.py diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/base.py b/google/cloud/bigtable/admin_v2/services/bigtable_table_admin/transports/base.py similarity index 98% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/base.py rename to google/cloud/bigtable/admin_v2/services/bigtable_table_admin/transports/base.py index ea6dca7c2..d64b50d40 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/base.py +++ b/google/cloud/bigtable/admin_v2/services/bigtable_table_admin/transports/base.py @@ -16,7 +16,7 @@ import abc from typing import Awaitable, Callable, Dict, Optional, Sequence, Union -from google.cloud.bigtable_admin_v2 import gapic_version as package_version +from google.cloud.bigtable.admin_v2 import gapic_version as package_version import google.auth # type: ignore import google.api_core @@ -26,10 +26,11 @@ from google.api_core import operations_v1 from google.auth import credentials as ga_credentials # type: ignore from google.oauth2 import service_account # type: ignore +import google.protobuf -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.types import table -from google.cloud.bigtable_admin_v2.types import table as gba_table +from google.cloud.bigtable.admin_v2.types import bigtable_table_admin +from google.cloud.bigtable.admin_v2.types import table +from google.cloud.bigtable.admin_v2.types import table as gba_table from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -39,6 +40,9 @@ gapic_version=package_version.__version__ ) +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ + class BigtableTableAdminTransport(abc.ABC): """Abstract transport class for BigtableTableAdmin.""" diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc.py b/google/cloud/bigtable/admin_v2/services/bigtable_table_admin/transports/grpc.py similarity index 99% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc.py rename to google/cloud/bigtable/admin_v2/services/bigtable_table_admin/transports/grpc.py index 9ea3f5465..c340bd2e7 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc.py +++ b/google/cloud/bigtable/admin_v2/services/bigtable_table_admin/transports/grpc.py @@ -31,9 +31,9 @@ import grpc # type: ignore import proto # type: ignore -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.types import table -from google.cloud.bigtable_admin_v2.types import table as gba_table +from google.cloud.bigtable.admin_v2.types import bigtable_table_admin +from google.cloud.bigtable.admin_v2.types import table +from google.cloud.bigtable.admin_v2.types import table as gba_table from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore @@ -77,12 +77,11 @@ def intercept_unary_unary(self, continuation, client_call_details, request): f"Sending request for {client_call_details.method}", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", - "rpcName": client_call_details.method, + "rpcName": str(client_call_details.method), "request": grpc_request, "metadata": grpc_request["metadata"], }, ) - response = continuation(client_call_details, request) if logging_enabled: # pragma: NO COVER response_metadata = response.trailing_metadata() diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc_asyncio.py b/google/cloud/bigtable/admin_v2/services/bigtable_table_admin/transports/grpc_asyncio.py similarity index 99% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc_asyncio.py rename to google/cloud/bigtable/admin_v2/services/bigtable_table_admin/transports/grpc_asyncio.py index 8b08cbe8c..7c4ab8a0c 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/grpc_asyncio.py +++ b/google/cloud/bigtable/admin_v2/services/bigtable_table_admin/transports/grpc_asyncio.py @@ -34,9 +34,9 @@ import proto # type: ignore from grpc.experimental import aio # type: ignore -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.types import table -from google.cloud.bigtable_admin_v2.types import table as gba_table +from google.cloud.bigtable.admin_v2.types import bigtable_table_admin +from google.cloud.bigtable.admin_v2.types import table +from google.cloud.bigtable.admin_v2.types import table as gba_table from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.longrunning import operations_pb2 # type: ignore diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest.py b/google/cloud/bigtable/admin_v2/services/bigtable_table_admin/transports/rest.py similarity index 98% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest.py rename to google/cloud/bigtable/admin_v2/services/bigtable_table_admin/transports/rest.py index f676835b5..8ea058de1 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest.py +++ b/google/cloud/bigtable/admin_v2/services/bigtable_table_admin/transports/rest.py @@ -23,6 +23,7 @@ from google.api_core import rest_helpers from google.api_core import rest_streaming from google.api_core import gapic_v1 +import google.protobuf from google.protobuf import json_format from google.api_core import operations_v1 @@ -33,9 +34,9 @@ import warnings -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.types import table -from google.cloud.bigtable_admin_v2.types import table as gba_table +from google.cloud.bigtable.admin_v2.types import bigtable_table_admin +from google.cloud.bigtable.admin_v2.types import table +from google.cloud.bigtable.admin_v2.types import table as gba_table from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore @@ -65,6 +66,9 @@ rest_version=f"requests@{requests_version}", ) +if hasattr(DEFAULT_CLIENT_INFO, "protobuf_runtime_version"): # pragma: NO COVER + DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__ + class BigtableTableAdminRestInterceptor: """Interceptor for BigtableTableAdmin. @@ -302,7 +306,7 @@ def post_update_table(self, response): return response transport = BigtableTableAdminRestTransport(interceptor=MyCustomBigtableTableAdminInterceptor()) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) """ @@ -1833,7 +1837,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.CheckConsistency", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.CheckConsistency", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CheckConsistency", @@ -1884,7 +1888,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.check_consistency", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.check_consistency", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CheckConsistency", @@ -1989,7 +1993,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.CopyBackup", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.CopyBackup", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CopyBackup", @@ -2036,7 +2040,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.copy_backup", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.copy_backup", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CopyBackup", @@ -2144,7 +2148,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.CreateAuthorizedView", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.CreateAuthorizedView", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CreateAuthorizedView", @@ -2193,7 +2197,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.create_authorized_view", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.create_authorized_view", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CreateAuthorizedView", @@ -2299,7 +2303,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.CreateBackup", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.CreateBackup", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CreateBackup", @@ -2346,7 +2350,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.create_backup", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.create_backup", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CreateBackup", @@ -2453,7 +2457,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.CreateTable", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.CreateTable", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CreateTable", @@ -2502,7 +2506,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.create_table", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.create_table", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CreateTable", @@ -2618,7 +2622,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.CreateTableFromSnapshot", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.CreateTableFromSnapshot", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CreateTableFromSnapshot", @@ -2667,7 +2671,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.create_table_from_snapshot", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.create_table_from_snapshot", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "CreateTableFromSnapshot", @@ -2763,7 +2767,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.DeleteAuthorizedView", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.DeleteAuthorizedView", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "DeleteAuthorizedView", @@ -2873,7 +2877,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.DeleteBackup", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.DeleteBackup", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "DeleteBackup", @@ -2988,7 +2992,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.DeleteSnapshot", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.DeleteSnapshot", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "DeleteSnapshot", @@ -3096,7 +3100,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.DeleteTable", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.DeleteTable", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "DeleteTable", @@ -3209,7 +3213,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.DropRowRange", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.DropRowRange", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "DropRowRange", @@ -3332,7 +3336,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.GenerateConsistencyToken", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.GenerateConsistencyToken", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GenerateConsistencyToken", @@ -3387,7 +3391,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.generate_consistency_token", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.generate_consistency_token", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GenerateConsistencyToken", @@ -3493,7 +3497,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.GetAuthorizedView", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.GetAuthorizedView", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetAuthorizedView", @@ -3541,7 +3545,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.get_authorized_view", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.get_authorized_view", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetAuthorizedView", @@ -3638,7 +3642,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.GetBackup", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.GetBackup", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetBackup", @@ -3686,7 +3690,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.get_backup", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.get_backup", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetBackup", @@ -3863,7 +3867,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.GetIamPolicy", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.GetIamPolicy", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetIamPolicy", @@ -3912,7 +3916,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.get_iam_policy", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.get_iam_policy", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetIamPolicy", @@ -4030,7 +4034,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.GetSnapshot", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.GetSnapshot", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetSnapshot", @@ -4078,7 +4082,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.get_snapshot", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.get_snapshot", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetSnapshot", @@ -4179,7 +4183,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.GetTable", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.GetTable", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetTable", @@ -4227,7 +4231,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.get_table", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.get_table", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "GetTable", @@ -4329,7 +4333,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.ListAuthorizedViews", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.ListAuthorizedViews", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ListAuthorizedViews", @@ -4383,7 +4387,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.list_authorized_views", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.list_authorized_views", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ListAuthorizedViews", @@ -4483,7 +4487,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.ListBackups", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.ListBackups", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ListBackups", @@ -4533,7 +4537,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.list_backups", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.list_backups", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ListBackups", @@ -4647,7 +4651,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.ListSnapshots", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.ListSnapshots", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ListSnapshots", @@ -4697,7 +4701,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.list_snapshots", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.list_snapshots", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ListSnapshots", @@ -4796,7 +4800,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.ListTables", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.ListTables", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ListTables", @@ -4846,7 +4850,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.list_tables", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.list_tables", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ListTables", @@ -4955,7 +4959,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.ModifyColumnFamilies", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.ModifyColumnFamilies", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ModifyColumnFamilies", @@ -5006,7 +5010,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.modify_column_families", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.modify_column_families", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "ModifyColumnFamilies", @@ -5112,7 +5116,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.RestoreTable", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.RestoreTable", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "RestoreTable", @@ -5159,7 +5163,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.restore_table", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.restore_table", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "RestoreTable", @@ -5336,7 +5340,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.SetIamPolicy", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.SetIamPolicy", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "SetIamPolicy", @@ -5385,7 +5389,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.set_iam_policy", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.set_iam_policy", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "SetIamPolicy", @@ -5498,7 +5502,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.SnapshotTable", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.SnapshotTable", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "SnapshotTable", @@ -5545,7 +5549,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.snapshot_table", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.snapshot_table", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "SnapshotTable", @@ -5649,7 +5653,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.TestIamPermissions", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.TestIamPermissions", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "TestIamPermissions", @@ -5700,7 +5704,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.test_iam_permissions", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.test_iam_permissions", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "TestIamPermissions", @@ -5806,7 +5810,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.UndeleteTable", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.UndeleteTable", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "UndeleteTable", @@ -5853,7 +5857,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.undelete_table", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.undelete_table", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "UndeleteTable", @@ -5961,7 +5965,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.UpdateAuthorizedView", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.UpdateAuthorizedView", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "UpdateAuthorizedView", @@ -6010,7 +6014,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.update_authorized_view", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.update_authorized_view", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "UpdateAuthorizedView", @@ -6113,7 +6117,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.UpdateBackup", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.UpdateBackup", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "UpdateBackup", @@ -6162,7 +6166,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.update_backup", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.update_backup", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "UpdateBackup", @@ -6268,7 +6272,7 @@ def __call__( "headers": dict(metadata), } _LOGGER.debug( - f"Sending request for google.bigtable.admin_v2.BigtableTableAdminClient.UpdateTable", + f"Sending request for google.bigtable.admin_v2.BaseBigtableTableAdminClient.UpdateTable", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "UpdateTable", @@ -6315,7 +6319,7 @@ def __call__( "status": response.status_code, } _LOGGER.debug( - "Received response for google.bigtable.admin_v2.BigtableTableAdminClient.update_table", + "Received response for google.bigtable.admin_v2.BaseBigtableTableAdminClient.update_table", extra={ "serviceName": "google.bigtable.admin.v2.BigtableTableAdmin", "rpcName": "UpdateTable", diff --git a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest_base.py b/google/cloud/bigtable/admin_v2/services/bigtable_table_admin/transports/rest_base.py similarity index 99% rename from google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest_base.py rename to google/cloud/bigtable/admin_v2/services/bigtable_table_admin/transports/rest_base.py index add95bcca..b6855c4f9 100644 --- a/google/cloud/bigtable_admin_v2/services/bigtable_table_admin/transports/rest_base.py +++ b/google/cloud/bigtable/admin_v2/services/bigtable_table_admin/transports/rest_base.py @@ -24,9 +24,9 @@ from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.types import table -from google.cloud.bigtable_admin_v2.types import table as gba_table +from google.cloud.bigtable.admin_v2.types import bigtable_table_admin +from google.cloud.bigtable.admin_v2.types import table +from google.cloud.bigtable.admin_v2.types import table as gba_table from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore from google.protobuf import empty_pb2 # type: ignore diff --git a/google/cloud/bigtable_admin_v2/types/__init__.py b/google/cloud/bigtable/admin_v2/types/__init__.py similarity index 100% rename from google/cloud/bigtable_admin_v2/types/__init__.py rename to google/cloud/bigtable/admin_v2/types/__init__.py diff --git a/google/cloud/bigtable_admin_v2/types/bigtable_instance_admin.py b/google/cloud/bigtable/admin_v2/types/bigtable_instance_admin.py similarity index 95% rename from google/cloud/bigtable_admin_v2/types/bigtable_instance_admin.py rename to google/cloud/bigtable/admin_v2/types/bigtable_instance_admin.py index 4197ed0b7..13027550c 100644 --- a/google/cloud/bigtable_admin_v2/types/bigtable_instance_admin.py +++ b/google/cloud/bigtable/admin_v2/types/bigtable_instance_admin.py @@ -19,7 +19,7 @@ import proto # type: ignore -from google.cloud.bigtable_admin_v2.types import instance as gba_instance +from google.cloud.bigtable.admin_v2.types import instance as gba_instance from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore @@ -85,10 +85,10 @@ class CreateInstanceRequest(proto.Message): Required. The ID to be used when referring to the new instance within its project, e.g., just ``myinstance`` rather than ``projects/myproject/instances/myinstance``. - instance (google.cloud.bigtable_admin_v2.types.Instance): + instance (google.cloud.bigtable.admin_v2.types.Instance): Required. The instance to create. Fields marked ``OutputOnly`` must be left blank. - clusters (MutableMapping[str, google.cloud.bigtable_admin_v2.types.Cluster]): + clusters (MutableMapping[str, google.cloud.bigtable.admin_v2.types.Cluster]): Required. The clusters to be created within the instance, mapped by desired cluster ID, e.g., just ``mycluster`` rather than @@ -158,7 +158,7 @@ class ListInstancesResponse(proto.Message): r"""Response message for BigtableInstanceAdmin.ListInstances. Attributes: - instances (MutableSequence[google.cloud.bigtable_admin_v2.types.Instance]): + instances (MutableSequence[google.cloud.bigtable.admin_v2.types.Instance]): The list of requested instances. failed_locations (MutableSequence[str]): Locations from which Instance information could not be @@ -196,7 +196,7 @@ class PartialUpdateInstanceRequest(proto.Message): BigtableInstanceAdmin.PartialUpdateInstance. Attributes: - instance (google.cloud.bigtable_admin_v2.types.Instance): + instance (google.cloud.bigtable.admin_v2.types.Instance): Required. The Instance which will (partially) replace the current value. update_mask (google.protobuf.field_mask_pb2.FieldMask): @@ -245,7 +245,7 @@ class CreateClusterRequest(proto.Message): cluster within its instance, e.g., just ``mycluster`` rather than ``projects/myproject/instances/myinstance/clusters/mycluster``. - cluster (google.cloud.bigtable_admin_v2.types.Cluster): + cluster (google.cloud.bigtable.admin_v2.types.Cluster): Required. The cluster to be created. Fields marked ``OutputOnly`` must be left blank. """ @@ -309,7 +309,7 @@ class ListClustersResponse(proto.Message): r"""Response message for BigtableInstanceAdmin.ListClusters. Attributes: - clusters (MutableSequence[google.cloud.bigtable_admin_v2.types.Cluster]): + clusters (MutableSequence[google.cloud.bigtable.admin_v2.types.Cluster]): The list of requested clusters. failed_locations (MutableSequence[str]): Locations from which Cluster information could not be @@ -361,7 +361,7 @@ class CreateInstanceMetadata(proto.Message): r"""The metadata for the Operation returned by CreateInstance. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.CreateInstanceRequest): + original_request (google.cloud.bigtable.admin_v2.types.CreateInstanceRequest): The request that prompted the initiation of this CreateInstance operation. request_time (google.protobuf.timestamp_pb2.Timestamp): @@ -393,7 +393,7 @@ class UpdateInstanceMetadata(proto.Message): r"""The metadata for the Operation returned by UpdateInstance. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.PartialUpdateInstanceRequest): + original_request (google.cloud.bigtable.admin_v2.types.PartialUpdateInstanceRequest): The request that prompted the initiation of this UpdateInstance operation. request_time (google.protobuf.timestamp_pb2.Timestamp): @@ -425,7 +425,7 @@ class CreateClusterMetadata(proto.Message): r"""The metadata for the Operation returned by CreateCluster. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.CreateClusterRequest): + original_request (google.cloud.bigtable.admin_v2.types.CreateClusterRequest): The request that prompted the initiation of this CreateCluster operation. request_time (google.protobuf.timestamp_pb2.Timestamp): @@ -434,7 +434,7 @@ class CreateClusterMetadata(proto.Message): finish_time (google.protobuf.timestamp_pb2.Timestamp): The time at which the operation failed or was completed successfully. - tables (MutableMapping[str, google.cloud.bigtable_admin_v2.types.CreateClusterMetadata.TableProgress]): + tables (MutableMapping[str, google.cloud.bigtable.admin_v2.types.CreateClusterMetadata.TableProgress]): Keys: the full ``name`` of each table that existed in the instance when CreateCluster was first called, i.e. ``projects//instances//tables/``. @@ -456,7 +456,7 @@ class TableProgress(proto.Message): Estimate of the number of bytes copied so far for this table. This will eventually reach 'estimated_size_bytes' unless the table copy is CANCELLED. - state (google.cloud.bigtable_admin_v2.types.CreateClusterMetadata.TableProgress.State): + state (google.cloud.bigtable.admin_v2.types.CreateClusterMetadata.TableProgress.State): """ @@ -528,7 +528,7 @@ class UpdateClusterMetadata(proto.Message): r"""The metadata for the Operation returned by UpdateCluster. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.Cluster): + original_request (google.cloud.bigtable.admin_v2.types.Cluster): The request that prompted the initiation of this UpdateCluster operation. request_time (google.protobuf.timestamp_pb2.Timestamp): @@ -567,7 +567,7 @@ class PartialUpdateClusterMetadata(proto.Message): finish_time (google.protobuf.timestamp_pb2.Timestamp): The time at which the operation failed or was completed successfully. - original_request (google.cloud.bigtable_admin_v2.types.PartialUpdateClusterRequest): + original_request (google.cloud.bigtable.admin_v2.types.PartialUpdateClusterRequest): The original request for PartialUpdateCluster. """ @@ -594,7 +594,7 @@ class PartialUpdateClusterRequest(proto.Message): BigtableInstanceAdmin.PartialUpdateCluster. Attributes: - cluster (google.cloud.bigtable_admin_v2.types.Cluster): + cluster (google.cloud.bigtable.admin_v2.types.Cluster): Required. The Cluster which contains the partial updates to be applied, subject to the update_mask. update_mask (google.protobuf.field_mask_pb2.FieldMask): @@ -627,7 +627,7 @@ class CreateAppProfileRequest(proto.Message): profile within its instance, e.g., just ``myprofile`` rather than ``projects/myproject/instances/myinstance/appProfiles/myprofile``. - app_profile (google.cloud.bigtable_admin_v2.types.AppProfile): + app_profile (google.cloud.bigtable.admin_v2.types.AppProfile): Required. The app profile to be created. Fields marked ``OutputOnly`` will be ignored. ignore_warnings (bool): @@ -715,7 +715,7 @@ class ListAppProfilesResponse(proto.Message): r"""Response message for BigtableInstanceAdmin.ListAppProfiles. Attributes: - app_profiles (MutableSequence[google.cloud.bigtable_admin_v2.types.AppProfile]): + app_profiles (MutableSequence[google.cloud.bigtable.admin_v2.types.AppProfile]): The list of requested app profiles. next_page_token (str): Set if not all app profiles could be returned in a single @@ -752,7 +752,7 @@ class UpdateAppProfileRequest(proto.Message): r"""Request message for BigtableInstanceAdmin.UpdateAppProfile. Attributes: - app_profile (google.cloud.bigtable_admin_v2.types.AppProfile): + app_profile (google.cloud.bigtable.admin_v2.types.AppProfile): Required. The app profile which will (partially) replace the current value. update_mask (google.protobuf.field_mask_pb2.FieldMask): @@ -873,7 +873,7 @@ class ListHotTabletsResponse(proto.Message): r"""Response message for BigtableInstanceAdmin.ListHotTablets. Attributes: - hot_tablets (MutableSequence[google.cloud.bigtable_admin_v2.types.HotTablet]): + hot_tablets (MutableSequence[google.cloud.bigtable.admin_v2.types.HotTablet]): List of hot tablets in the tables of the requested cluster that fall within the requested time range. Hot tablets are ordered by node cpu @@ -915,7 +915,7 @@ class CreateLogicalViewRequest(proto.Message): Required. The ID to use for the logical view, which will become the final component of the logical view's resource name. - logical_view (google.cloud.bigtable_admin_v2.types.LogicalView): + logical_view (google.cloud.bigtable.admin_v2.types.LogicalView): Required. The logical view to create. """ @@ -938,7 +938,7 @@ class CreateLogicalViewMetadata(proto.Message): r"""The metadata for the Operation returned by CreateLogicalView. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.CreateLogicalViewRequest): + original_request (google.cloud.bigtable.admin_v2.types.CreateLogicalViewRequest): The request that prompted the initiation of this CreateLogicalView operation. start_time (google.protobuf.timestamp_pb2.Timestamp): @@ -1021,7 +1021,7 @@ class ListLogicalViewsResponse(proto.Message): r"""Response message for BigtableInstanceAdmin.ListLogicalViews. Attributes: - logical_views (MutableSequence[google.cloud.bigtable_admin_v2.types.LogicalView]): + logical_views (MutableSequence[google.cloud.bigtable.admin_v2.types.LogicalView]): The list of requested logical views. next_page_token (str): A token, which can be sent as ``page_token`` to retrieve the @@ -1048,7 +1048,7 @@ class UpdateLogicalViewRequest(proto.Message): r"""Request message for BigtableInstanceAdmin.UpdateLogicalView. Attributes: - logical_view (google.cloud.bigtable_admin_v2.types.LogicalView): + logical_view (google.cloud.bigtable.admin_v2.types.LogicalView): Required. The logical view to update. The logical view's ``name`` field is used to identify the @@ -1074,7 +1074,7 @@ class UpdateLogicalViewMetadata(proto.Message): r"""The metadata for the Operation returned by UpdateLogicalView. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.UpdateLogicalViewRequest): + original_request (google.cloud.bigtable.admin_v2.types.UpdateLogicalViewRequest): The request that prompted the initiation of this UpdateLogicalView operation. start_time (google.protobuf.timestamp_pb2.Timestamp): @@ -1140,7 +1140,7 @@ class CreateMaterializedViewRequest(proto.Message): Required. The ID to use for the materialized view, which will become the final component of the materialized view's resource name. - materialized_view (google.cloud.bigtable_admin_v2.types.MaterializedView): + materialized_view (google.cloud.bigtable.admin_v2.types.MaterializedView): Required. The materialized view to create. """ @@ -1164,7 +1164,7 @@ class CreateMaterializedViewMetadata(proto.Message): CreateMaterializedView. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.CreateMaterializedViewRequest): + original_request (google.cloud.bigtable.admin_v2.types.CreateMaterializedViewRequest): The request that prompted the initiation of this CreateMaterializedView operation. start_time (google.protobuf.timestamp_pb2.Timestamp): @@ -1250,7 +1250,7 @@ class ListMaterializedViewsResponse(proto.Message): BigtableInstanceAdmin.ListMaterializedViews. Attributes: - materialized_views (MutableSequence[google.cloud.bigtable_admin_v2.types.MaterializedView]): + materialized_views (MutableSequence[google.cloud.bigtable.admin_v2.types.MaterializedView]): The list of requested materialized views. next_page_token (str): A token, which can be sent as ``page_token`` to retrieve the @@ -1280,7 +1280,7 @@ class UpdateMaterializedViewRequest(proto.Message): BigtableInstanceAdmin.UpdateMaterializedView. Attributes: - materialized_view (google.cloud.bigtable_admin_v2.types.MaterializedView): + materialized_view (google.cloud.bigtable.admin_v2.types.MaterializedView): Required. The materialized view to update. The materialized view's ``name`` field is used to identify @@ -1307,7 +1307,7 @@ class UpdateMaterializedViewMetadata(proto.Message): UpdateMaterializedView. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.UpdateMaterializedViewRequest): + original_request (google.cloud.bigtable.admin_v2.types.UpdateMaterializedViewRequest): The request that prompted the initiation of this UpdateMaterializedView operation. start_time (google.protobuf.timestamp_pb2.Timestamp): diff --git a/google/cloud/bigtable_admin_v2/types/bigtable_table_admin.py b/google/cloud/bigtable/admin_v2/types/bigtable_table_admin.py similarity index 96% rename from google/cloud/bigtable_admin_v2/types/bigtable_table_admin.py rename to google/cloud/bigtable/admin_v2/types/bigtable_table_admin.py index 4cadfb1bf..175b69476 100644 --- a/google/cloud/bigtable_admin_v2/types/bigtable_table_admin.py +++ b/google/cloud/bigtable/admin_v2/types/bigtable_table_admin.py @@ -19,8 +19,8 @@ import proto # type: ignore -from google.cloud.bigtable_admin_v2.types import common -from google.cloud.bigtable_admin_v2.types import table as gba_table +from google.cloud.bigtable.admin_v2.types import common +from google.cloud.bigtable.admin_v2.types import table as gba_table from google.protobuf import duration_pb2 # type: ignore from google.protobuf import field_mask_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore @@ -129,9 +129,9 @@ class RestoreTableMetadata(proto.Message): name (str): Name of the table being created and restored to. - source_type (google.cloud.bigtable_admin_v2.types.RestoreSourceType): + source_type (google.cloud.bigtable.admin_v2.types.RestoreSourceType): The type of the restore source. - backup_info (google.cloud.bigtable_admin_v2.types.BackupInfo): + backup_info (google.cloud.bigtable.admin_v2.types.BackupInfo): This field is a member of `oneof`_ ``source_info``. optimize_table_operation_name (str): @@ -145,7 +145,7 @@ class RestoreTableMetadata(proto.Message): after the RestoreTable long-running operation completes successfully. This operation may not be created if the table is already optimized or the restore was not successful. - progress (google.cloud.bigtable_admin_v2.types.OperationProgress): + progress (google.cloud.bigtable.admin_v2.types.OperationProgress): The progress of the [RestoreTable][google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable] operation. @@ -187,7 +187,7 @@ class OptimizeRestoredTableMetadata(proto.Message): Attributes: name (str): Name of the restored table being optimized. - progress (google.cloud.bigtable_admin_v2.types.OperationProgress): + progress (google.cloud.bigtable.admin_v2.types.OperationProgress): The progress of the post-restore optimizations. """ @@ -216,9 +216,9 @@ class CreateTableRequest(proto.Message): Required. The name by which the new table should be referred to within the parent instance, e.g., ``foobar`` rather than ``{parent}/tables/foobar``. Maximum 50 characters. - table (google.cloud.bigtable_admin_v2.types.Table): + table (google.cloud.bigtable.admin_v2.types.Table): Required. The Table to create. - initial_splits (MutableSequence[google.cloud.bigtable_admin_v2.types.CreateTableRequest.Split]): + initial_splits (MutableSequence[google.cloud.bigtable.admin_v2.types.CreateTableRequest.Split]): The optional list of row keys that will be used to initially split the table into several tablets (tablets are similar to HBase regions). Given two split keys, ``s1`` and ``s2``, @@ -369,7 +369,7 @@ class ListTablesRequest(proto.Message): Required. The unique name of the instance for which tables should be listed. Values are of the form ``projects/{project}/instances/{instance}``. - view (google.cloud.bigtable_admin_v2.types.Table.View): + view (google.cloud.bigtable.admin_v2.types.Table.View): The view to be applied to the returned tables' fields. NAME_ONLY view (default) and REPLICATION_VIEW are supported. page_size (int): @@ -413,7 +413,7 @@ class ListTablesResponse(proto.Message): [google.bigtable.admin.v2.BigtableTableAdmin.ListTables][google.bigtable.admin.v2.BigtableTableAdmin.ListTables] Attributes: - tables (MutableSequence[google.cloud.bigtable_admin_v2.types.Table]): + tables (MutableSequence[google.cloud.bigtable.admin_v2.types.Table]): The tables present in the requested instance. next_page_token (str): Set if not all tables could be returned in a single @@ -445,7 +445,7 @@ class GetTableRequest(proto.Message): Required. The unique name of the requested table. Values are of the form ``projects/{project}/instances/{instance}/tables/{table}``. - view (google.cloud.bigtable_admin_v2.types.Table.View): + view (google.cloud.bigtable.admin_v2.types.Table.View): The view to be applied to the returned table's fields. Defaults to ``SCHEMA_VIEW`` if unspecified. """ @@ -466,7 +466,7 @@ class UpdateTableRequest(proto.Message): [UpdateTable][google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable]. Attributes: - table (google.cloud.bigtable_admin_v2.types.Table): + table (google.cloud.bigtable.admin_v2.types.Table): Required. The table to update. The table's ``name`` field is used to identify the table to update. update_mask (google.protobuf.field_mask_pb2.FieldMask): @@ -608,7 +608,7 @@ class ModifyColumnFamiliesRequest(proto.Message): Required. The unique name of the table whose families should be modified. Values are of the form ``projects/{project}/instances/{instance}/tables/{table}``. - modifications (MutableSequence[google.cloud.bigtable_admin_v2.types.ModifyColumnFamiliesRequest.Modification]): + modifications (MutableSequence[google.cloud.bigtable.admin_v2.types.ModifyColumnFamiliesRequest.Modification]): Required. Modifications to be atomically applied to the specified table's families. Entries are applied in order, meaning that @@ -633,13 +633,13 @@ class Modification(proto.Message): Attributes: id (str): The ID of the column family to be modified. - create (google.cloud.bigtable_admin_v2.types.ColumnFamily): + create (google.cloud.bigtable.admin_v2.types.ColumnFamily): Create a new column family with the specified schema, or fail if one already exists with the given ID. This field is a member of `oneof`_ ``mod``. - update (google.cloud.bigtable_admin_v2.types.ColumnFamily): + update (google.cloud.bigtable.admin_v2.types.ColumnFamily): Update an existing column family to the specified schema, or fail if no column family exists with the given ID. @@ -750,14 +750,14 @@ class CheckConsistencyRequest(proto.Message): consistency_token (str): Required. The token created using GenerateConsistencyToken for the Table. - standard_read_remote_writes (google.cloud.bigtable_admin_v2.types.StandardReadRemoteWrites): + standard_read_remote_writes (google.cloud.bigtable.admin_v2.types.StandardReadRemoteWrites): Checks that reads using an app profile with ``StandardIsolation`` can see all writes committed before the token was created, even if the read and write target different clusters. This field is a member of `oneof`_ ``mode``. - data_boost_read_local_writes (google.cloud.bigtable_admin_v2.types.DataBoostReadLocalWrites): + data_boost_read_local_writes (google.cloud.bigtable.admin_v2.types.DataBoostReadLocalWrites): Checks that reads using an app profile with ``DataBoostIsolationReadOnly`` can see all writes committed before the token was created, but only if the read and write @@ -951,7 +951,7 @@ class ListSnapshotsResponse(proto.Message): any SLA or deprecation policy. Attributes: - snapshots (MutableSequence[google.cloud.bigtable_admin_v2.types.Snapshot]): + snapshots (MutableSequence[google.cloud.bigtable.admin_v2.types.Snapshot]): The snapshots present in the requested cluster. next_page_token (str): @@ -1008,7 +1008,7 @@ class SnapshotTableMetadata(proto.Message): use. It is not subject to any SLA or deprecation policy. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.SnapshotTableRequest): + original_request (google.cloud.bigtable.admin_v2.types.SnapshotTableRequest): The request that prompted the initiation of this SnapshotTable operation. request_time (google.protobuf.timestamp_pb2.Timestamp): @@ -1046,7 +1046,7 @@ class CreateTableFromSnapshotMetadata(proto.Message): use. It is not subject to any SLA or deprecation policy. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.CreateTableFromSnapshotRequest): + original_request (google.cloud.bigtable.admin_v2.types.CreateTableFromSnapshotRequest): The request that prompted the initiation of this CreateTableFromSnapshot operation. request_time (google.protobuf.timestamp_pb2.Timestamp): @@ -1092,7 +1092,7 @@ class CreateBackupRequest(proto.Message): ``projects/{project}/instances/{instance}/clusters/{cluster}/backups/{backup_id}``. This string must be between 1 and 50 characters in length and match the regex [*a-zA-Z0-9][-*.a-zA-Z0-9]*. - backup (google.cloud.bigtable_admin_v2.types.Backup): + backup (google.cloud.bigtable.admin_v2.types.Backup): Required. The backup to create. """ @@ -1153,7 +1153,7 @@ class UpdateBackupRequest(proto.Message): [UpdateBackup][google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup]. Attributes: - backup (google.cloud.bigtable_admin_v2.types.Backup): + backup (google.cloud.bigtable.admin_v2.types.Backup): Required. The backup to update. ``backup.name``, and the fields to be updated as specified by ``update_mask`` are required. Other fields are ignored. Update is only supported @@ -1334,7 +1334,7 @@ class ListBackupsResponse(proto.Message): [ListBackups][google.bigtable.admin.v2.BigtableTableAdmin.ListBackups]. Attributes: - backups (MutableSequence[google.cloud.bigtable_admin_v2.types.Backup]): + backups (MutableSequence[google.cloud.bigtable.admin_v2.types.Backup]): The list of matching backups. next_page_token (str): ``next_page_token`` can be sent in a subsequent @@ -1418,10 +1418,10 @@ class CopyBackupMetadata(proto.Message): The name of the backup being created through the copy operation. Values are of the form ``projects//instances//clusters//backups/``. - source_backup_info (google.cloud.bigtable_admin_v2.types.BackupInfo): + source_backup_info (google.cloud.bigtable.admin_v2.types.BackupInfo): Information about the source backup that is being copied from. - progress (google.cloud.bigtable_admin_v2.types.OperationProgress): + progress (google.cloud.bigtable.admin_v2.types.OperationProgress): The progress of the [CopyBackup][google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup] operation. @@ -1458,7 +1458,7 @@ class CreateAuthorizedViewRequest(proto.Message): ``authorized_view_id`` appended to ``parent`` forms the full AuthorizedView name of the form ``projects/{project}/instances/{instance}/tables/{table}/authorizedView/{authorized_view}``. - authorized_view (google.cloud.bigtable_admin_v2.types.AuthorizedView): + authorized_view (google.cloud.bigtable.admin_v2.types.AuthorizedView): Required. The AuthorizedView to create. """ @@ -1482,7 +1482,7 @@ class CreateAuthorizedViewMetadata(proto.Message): CreateAuthorizedView. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.CreateAuthorizedViewRequest): + original_request (google.cloud.bigtable.admin_v2.types.CreateAuthorizedViewRequest): The request that prompted the initiation of this CreateInstance operation. request_time (google.protobuf.timestamp_pb2.Timestamp): @@ -1534,7 +1534,7 @@ class ListAuthorizedViewsRequest(proto.Message): page_token (str): Optional. The value of ``next_page_token`` returned by a previous call. - view (google.cloud.bigtable_admin_v2.types.AuthorizedView.ResponseView): + view (google.cloud.bigtable.admin_v2.types.AuthorizedView.ResponseView): Optional. The resource_view to be applied to the returned views' fields. Default to NAME_ONLY. """ @@ -1563,7 +1563,7 @@ class ListAuthorizedViewsResponse(proto.Message): [google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews][google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews] Attributes: - authorized_views (MutableSequence[google.cloud.bigtable_admin_v2.types.AuthorizedView]): + authorized_views (MutableSequence[google.cloud.bigtable.admin_v2.types.AuthorizedView]): The AuthorizedViews present in the requested table. next_page_token (str): @@ -1596,7 +1596,7 @@ class GetAuthorizedViewRequest(proto.Message): Required. The unique name of the requested AuthorizedView. Values are of the form ``projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}``. - view (google.cloud.bigtable_admin_v2.types.AuthorizedView.ResponseView): + view (google.cloud.bigtable.admin_v2.types.AuthorizedView.ResponseView): Optional. The resource_view to be applied to the returned AuthorizedView's fields. Default to BASIC. """ @@ -1617,7 +1617,7 @@ class UpdateAuthorizedViewRequest(proto.Message): [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView]. Attributes: - authorized_view (google.cloud.bigtable_admin_v2.types.AuthorizedView): + authorized_view (google.cloud.bigtable.admin_v2.types.AuthorizedView): Required. The AuthorizedView to update. The ``name`` in ``authorized_view`` is used to identify the AuthorizedView. AuthorizedView name must in this format @@ -1657,7 +1657,7 @@ class UpdateAuthorizedViewMetadata(proto.Message): [UpdateAuthorizedView][google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView]. Attributes: - original_request (google.cloud.bigtable_admin_v2.types.UpdateAuthorizedViewRequest): + original_request (google.cloud.bigtable.admin_v2.types.UpdateAuthorizedViewRequest): The request that prompted the initiation of this UpdateAuthorizedView operation. request_time (google.protobuf.timestamp_pb2.Timestamp): diff --git a/google/cloud/bigtable_admin_v2/types/common.py b/google/cloud/bigtable/admin_v2/types/common.py similarity index 100% rename from google/cloud/bigtable_admin_v2/types/common.py rename to google/cloud/bigtable/admin_v2/types/common.py diff --git a/google/cloud/bigtable_admin_v2/types/instance.py b/google/cloud/bigtable/admin_v2/types/instance.py similarity index 95% rename from google/cloud/bigtable_admin_v2/types/instance.py rename to google/cloud/bigtable/admin_v2/types/instance.py index 8b2e01607..0d3b708a9 100644 --- a/google/cloud/bigtable_admin_v2/types/instance.py +++ b/google/cloud/bigtable/admin_v2/types/instance.py @@ -19,7 +19,7 @@ import proto # type: ignore -from google.cloud.bigtable_admin_v2.types import common +from google.cloud.bigtable.admin_v2.types import common from google.protobuf import timestamp_pb2 # type: ignore @@ -56,10 +56,10 @@ class Instance(proto.Message): instance as it appears in UIs. Can be changed at any time, but should be kept globally unique to avoid confusion. - state (google.cloud.bigtable_admin_v2.types.Instance.State): + state (google.cloud.bigtable.admin_v2.types.Instance.State): Output only. The current state of the instance. - type_ (google.cloud.bigtable_admin_v2.types.Instance.Type): + type_ (google.cloud.bigtable.admin_v2.types.Instance.Type): The type of the instance. Defaults to ``PRODUCTION``. labels (MutableMapping[str, str]): Labels are a flexible and lightweight mechanism for @@ -242,7 +242,7 @@ class Cluster(proto.Message): located as close as possible to this cluster. Currently only zones are supported, so values should be of the form ``projects/{project}/locations/{zone}``. - state (google.cloud.bigtable_admin_v2.types.Cluster.State): + state (google.cloud.bigtable.admin_v2.types.Cluster.State): Output only. The current state of the cluster. serve_nodes (int): @@ -250,18 +250,18 @@ class Cluster(proto.Message): value is set, Cloud Bigtable automatically allocates nodes based on your data footprint and optimized for 50% storage utilization. - node_scaling_factor (google.cloud.bigtable_admin_v2.types.Cluster.NodeScalingFactor): + node_scaling_factor (google.cloud.bigtable.admin_v2.types.Cluster.NodeScalingFactor): Immutable. The node scaling factor of this cluster. - cluster_config (google.cloud.bigtable_admin_v2.types.Cluster.ClusterConfig): + cluster_config (google.cloud.bigtable.admin_v2.types.Cluster.ClusterConfig): Configuration for this cluster. This field is a member of `oneof`_ ``config``. - default_storage_type (google.cloud.bigtable_admin_v2.types.StorageType): + default_storage_type (google.cloud.bigtable.admin_v2.types.StorageType): Immutable. The type of storage used by this cluster to serve its parent instance's tables, unless explicitly overridden. - encryption_config (google.cloud.bigtable_admin_v2.types.Cluster.EncryptionConfig): + encryption_config (google.cloud.bigtable.admin_v2.types.Cluster.EncryptionConfig): Immutable. The encryption configuration for CMEK-protected clusters. """ @@ -326,10 +326,10 @@ class ClusterAutoscalingConfig(proto.Message): r"""Autoscaling config for a cluster. Attributes: - autoscaling_limits (google.cloud.bigtable_admin_v2.types.AutoscalingLimits): + autoscaling_limits (google.cloud.bigtable.admin_v2.types.AutoscalingLimits): Required. Autoscaling limits for this cluster. - autoscaling_targets (google.cloud.bigtable_admin_v2.types.AutoscalingTargets): + autoscaling_targets (google.cloud.bigtable.admin_v2.types.AutoscalingTargets): Required. Autoscaling targets for this cluster. """ @@ -349,7 +349,7 @@ class ClusterConfig(proto.Message): r"""Configuration for a cluster. Attributes: - cluster_autoscaling_config (google.cloud.bigtable_admin_v2.types.Cluster.ClusterAutoscalingConfig): + cluster_autoscaling_config (google.cloud.bigtable.admin_v2.types.Cluster.ClusterAutoscalingConfig): Autoscaling configuration for this cluster. """ @@ -453,15 +453,15 @@ class AppProfile(proto.Message): description (str): Long form description of the use case for this AppProfile. - multi_cluster_routing_use_any (google.cloud.bigtable_admin_v2.types.AppProfile.MultiClusterRoutingUseAny): + multi_cluster_routing_use_any (google.cloud.bigtable.admin_v2.types.AppProfile.MultiClusterRoutingUseAny): Use a multi-cluster routing policy. This field is a member of `oneof`_ ``routing_policy``. - single_cluster_routing (google.cloud.bigtable_admin_v2.types.AppProfile.SingleClusterRouting): + single_cluster_routing (google.cloud.bigtable.admin_v2.types.AppProfile.SingleClusterRouting): Use a single-cluster routing policy. This field is a member of `oneof`_ ``routing_policy``. - priority (google.cloud.bigtable_admin_v2.types.AppProfile.Priority): + priority (google.cloud.bigtable.admin_v2.types.AppProfile.Priority): This field has been deprecated in favor of ``standard_isolation.priority``. If you set this field, ``standard_isolation.priority`` will be set instead. @@ -469,12 +469,12 @@ class AppProfile(proto.Message): The priority of requests sent using this app profile. This field is a member of `oneof`_ ``isolation``. - standard_isolation (google.cloud.bigtable_admin_v2.types.AppProfile.StandardIsolation): + standard_isolation (google.cloud.bigtable.admin_v2.types.AppProfile.StandardIsolation): The standard options used for isolating this app profile's traffic from other use cases. This field is a member of `oneof`_ ``isolation``. - data_boost_isolation_read_only (google.cloud.bigtable_admin_v2.types.AppProfile.DataBoostIsolationReadOnly): + data_boost_isolation_read_only (google.cloud.bigtable.admin_v2.types.AppProfile.DataBoostIsolationReadOnly): Specifies that this app profile is intended for read-only usage via the Data Boost feature. @@ -519,7 +519,7 @@ class MultiClusterRoutingUseAny(proto.Message): ignored; clusters will be tried in order of distance. If left empty, all clusters are eligible. - row_affinity (google.cloud.bigtable_admin_v2.types.AppProfile.MultiClusterRoutingUseAny.RowAffinity): + row_affinity (google.cloud.bigtable.admin_v2.types.AppProfile.MultiClusterRoutingUseAny.RowAffinity): Row affinity sticky routing based on the row key of the request. Requests that span multiple rows are routed non-deterministically. @@ -582,7 +582,7 @@ class StandardIsolation(proto.Message): from other use cases. Attributes: - priority (google.cloud.bigtable_admin_v2.types.AppProfile.Priority): + priority (google.cloud.bigtable.admin_v2.types.AppProfile.Priority): The priority of requests sent using this app profile. """ @@ -604,7 +604,7 @@ class DataBoostIsolationReadOnly(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - compute_billing_owner (google.cloud.bigtable_admin_v2.types.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner): + compute_billing_owner (google.cloud.bigtable.admin_v2.types.AppProfile.DataBoostIsolationReadOnly.ComputeBillingOwner): The Compute Billing Owner for this Data Boost App Profile. @@ -759,6 +759,9 @@ class LogicalView(proto.Message): that the client has an up-to-date value before proceeding. The server returns an ABORTED error on a mismatched etag. + deletion_protection (bool): + Optional. Set to true to make the LogicalView + protected against deletion. """ name: str = proto.Field( @@ -773,6 +776,10 @@ class LogicalView(proto.Message): proto.STRING, number=3, ) + deletion_protection: bool = proto.Field( + proto.BOOL, + number=6, + ) class MaterializedView(proto.Message): diff --git a/google/cloud/bigtable_admin_v2/types/table.py b/google/cloud/bigtable/admin_v2/types/table.py similarity index 92% rename from google/cloud/bigtable_admin_v2/types/table.py rename to google/cloud/bigtable/admin_v2/types/table.py index 730b54ce3..8705b731b 100644 --- a/google/cloud/bigtable_admin_v2/types/table.py +++ b/google/cloud/bigtable/admin_v2/types/table.py @@ -19,7 +19,7 @@ import proto # type: ignore -from google.cloud.bigtable_admin_v2.types import types +from google.cloud.bigtable.admin_v2.types import types from google.protobuf import duration_pb2 # type: ignore from google.protobuf import timestamp_pb2 # type: ignore from google.rpc import status_pb2 # type: ignore @@ -63,9 +63,9 @@ class RestoreInfo(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - source_type (google.cloud.bigtable_admin_v2.types.RestoreSourceType): + source_type (google.cloud.bigtable.admin_v2.types.RestoreSourceType): The type of the restore source. - backup_info (google.cloud.bigtable_admin_v2.types.BackupInfo): + backup_info (google.cloud.bigtable.admin_v2.types.BackupInfo): Information about the backup used to restore the table. The backup may no longer exist. @@ -120,29 +120,29 @@ class Table(proto.Message): ``projects/{project}/instances/{instance}/tables/[_a-zA-Z0-9][-_.a-zA-Z0-9]*``. Views: ``NAME_ONLY``, ``SCHEMA_VIEW``, ``REPLICATION_VIEW``, ``FULL`` - cluster_states (MutableMapping[str, google.cloud.bigtable_admin_v2.types.Table.ClusterState]): + cluster_states (MutableMapping[str, google.cloud.bigtable.admin_v2.types.Table.ClusterState]): Output only. Map from cluster ID to per-cluster table state. If it could not be determined whether or not the table has data in a particular cluster (for example, if its zone is unavailable), then there will be an entry for the cluster with UNKNOWN ``replication_status``. Views: ``REPLICATION_VIEW``, ``ENCRYPTION_VIEW``, ``FULL`` - column_families (MutableMapping[str, google.cloud.bigtable_admin_v2.types.ColumnFamily]): + column_families (MutableMapping[str, google.cloud.bigtable.admin_v2.types.ColumnFamily]): The column families configured for this table, mapped by column family ID. Views: ``SCHEMA_VIEW``, ``STATS_VIEW``, ``FULL`` - granularity (google.cloud.bigtable_admin_v2.types.Table.TimestampGranularity): + granularity (google.cloud.bigtable.admin_v2.types.Table.TimestampGranularity): Immutable. The granularity (i.e. ``MILLIS``) at which timestamps are stored in this table. Timestamps not matching the granularity will be rejected. If unspecified at creation time, the value will be set to ``MILLIS``. Views: ``SCHEMA_VIEW``, ``FULL``. - restore_info (google.cloud.bigtable_admin_v2.types.RestoreInfo): + restore_info (google.cloud.bigtable.admin_v2.types.RestoreInfo): Output only. If this table was restored from another data source (e.g. a backup), this field will be populated with information about the restore. - change_stream_config (google.cloud.bigtable_admin_v2.types.ChangeStreamConfig): + change_stream_config (google.cloud.bigtable.admin_v2.types.ChangeStreamConfig): If specified, enable the change stream on this table. Otherwise, the change stream is disabled and the change stream is not retained. @@ -157,13 +157,13 @@ class Table(proto.Message): Note one can still delete the data stored in the table through Data APIs. - automated_backup_policy (google.cloud.bigtable_admin_v2.types.Table.AutomatedBackupPolicy): + automated_backup_policy (google.cloud.bigtable.admin_v2.types.Table.AutomatedBackupPolicy): If specified, automated backups are enabled for this table. Otherwise, automated backups are disabled. This field is a member of `oneof`_ ``automated_backup_config``. - row_key_schema (google.cloud.bigtable_admin_v2.types.Type.Struct): + row_key_schema (google.cloud.bigtable.admin_v2.types.Type.Struct): The row key schema for this table. The schema is used to decode the raw row key bytes into a structured format. The order of field declarations in this schema is important, as @@ -179,21 +179,36 @@ class Table(proto.Message): For example, if \_key = "some_id#2024-04-30#\x00\x13\x00\xf3" with the following - schema: { fields { field_name: "id" type { string { - encoding: utf8_bytes {} } } } fields { field_name: "date" - type { string { encoding: utf8_bytes {} } } } fields { - field_name: "product_code" type { int64 { encoding: - big_endian_bytes {} } } } encoding { delimited_bytes { - delimiter: "#" } } } - - | The decoded key parts would be: id = "some_id", date = - "2024-04-30", product_code = 1245427 The query "SELECT - \_key, product_code FROM table" will return two columns: - /------------------------------------------------------ - | \| \_key \| product_code \| \| - --------------------------------------|--------------\| \| - "some_id#2024-04-30#\x00\x13\x00\xf3" \| 1245427 \| - ------------------------------------------------------/ + schema: + + .. code-block:: + + { + fields { + field_name: "id" + type { string { encoding: utf8_bytes {} } } + } + fields { + field_name: "date" + type { string { encoding: utf8_bytes {} } } + } + fields { + field_name: "product_code" + type { int64 { encoding: big_endian_bytes {} } } + } + encoding { delimited_bytes { delimiter: "#" } } + } + + The decoded key parts would be: + id = "some_id", date = "2024-04-30", product_code = 1245427 + The query "SELECT \_key, product_code FROM table" will return + two columns: + + +========================================+==============+ + | \_key | product_code | + +========================================+==============+ + | "some_id#2024-04-30#\x00\x13\x00\xf3" | 1245427 | + +----------------------------------------+--------------+ The schema has the following invariants: (1) The decoded field values are order-preserved. For read, the field values @@ -266,10 +281,10 @@ class ClusterState(proto.Message): r"""The state of a table's data in a particular cluster. Attributes: - replication_state (google.cloud.bigtable_admin_v2.types.Table.ClusterState.ReplicationState): + replication_state (google.cloud.bigtable.admin_v2.types.Table.ClusterState.ReplicationState): Output only. The state of replication for the table in this cluster. - encryption_info (MutableSequence[google.cloud.bigtable_admin_v2.types.EncryptionInfo]): + encryption_info (MutableSequence[google.cloud.bigtable.admin_v2.types.EncryptionInfo]): Output only. The encryption information for the table in this cluster. If the encryption key protecting this resource is customer managed, @@ -417,7 +432,7 @@ class AuthorizedView(proto.Message): Identifier. The name of this AuthorizedView. Values are of the form ``projects/{project}/instances/{instance}/tables/{table}/authorizedViews/{authorized_view}`` - subset_view (google.cloud.bigtable_admin_v2.types.AuthorizedView.SubsetView): + subset_view (google.cloud.bigtable.admin_v2.types.AuthorizedView.SubsetView): An AuthorizedView permitting access to an explicit subset of a Table. @@ -489,7 +504,7 @@ class SubsetView(proto.Message): Row prefixes to be included in the AuthorizedView. To provide access to all rows, include the empty string as a prefix (""). - family_subsets (MutableMapping[str, google.cloud.bigtable_admin_v2.types.AuthorizedView.FamilySubsets]): + family_subsets (MutableMapping[str, google.cloud.bigtable.admin_v2.types.AuthorizedView.FamilySubsets]): Map from column family name to the columns in this family to be included in the AuthorizedView. @@ -533,7 +548,7 @@ class ColumnFamily(proto.Message): configuration. Attributes: - gc_rule (google.cloud.bigtable_admin_v2.types.GcRule): + gc_rule (google.cloud.bigtable.admin_v2.types.GcRule): Garbage collection rule specified as a protobuf. Must serialize to at most 500 bytes. @@ -541,7 +556,7 @@ class ColumnFamily(proto.Message): opportunistically in the background, and so it's possible for reads to return a cell even if it matches the active GC expression for its family. - value_type (google.cloud.bigtable_admin_v2.types.Type): + value_type (google.cloud.bigtable.admin_v2.types.Type): The type of data stored in each of this family's cell values, including its full encoding. If omitted, the family only serves raw untyped bytes. @@ -593,12 +608,12 @@ class GcRule(proto.Message): granularity. This field is a member of `oneof`_ ``rule``. - intersection (google.cloud.bigtable_admin_v2.types.GcRule.Intersection): + intersection (google.cloud.bigtable.admin_v2.types.GcRule.Intersection): Delete cells that would be deleted by every nested rule. This field is a member of `oneof`_ ``rule``. - union (google.cloud.bigtable_admin_v2.types.GcRule.Union): + union (google.cloud.bigtable.admin_v2.types.GcRule.Union): Delete cells that would be deleted by any nested rule. @@ -609,7 +624,7 @@ class Intersection(proto.Message): r"""A GcRule which deletes cells matching all of the given rules. Attributes: - rules (MutableSequence[google.cloud.bigtable_admin_v2.types.GcRule]): + rules (MutableSequence[google.cloud.bigtable.admin_v2.types.GcRule]): Only delete cells which would be deleted by every element of ``rules``. """ @@ -624,7 +639,7 @@ class Union(proto.Message): r"""A GcRule which deletes cells matching any of the given rules. Attributes: - rules (MutableSequence[google.cloud.bigtable_admin_v2.types.GcRule]): + rules (MutableSequence[google.cloud.bigtable.admin_v2.types.GcRule]): Delete cells which would be deleted by any element of ``rules``. """ @@ -667,7 +682,7 @@ class EncryptionInfo(proto.Message): is specified along with its status. Attributes: - encryption_type (google.cloud.bigtable_admin_v2.types.EncryptionInfo.EncryptionType): + encryption_type (google.cloud.bigtable.admin_v2.types.EncryptionInfo.EncryptionType): Output only. The type of encryption used to protect this resource. encryption_status (google.rpc.status_pb2.Status): @@ -737,7 +752,7 @@ class Snapshot(proto.Message): name (str): The unique name of the snapshot. Values are of the form ``projects/{project}/instances/{instance}/clusters/{cluster}/snapshots/{snapshot}``. - source_table (google.cloud.bigtable_admin_v2.types.Table): + source_table (google.cloud.bigtable.admin_v2.types.Table): Output only. The source table at the time the snapshot was taken. data_size_bytes (int): @@ -754,7 +769,7 @@ class Snapshot(proto.Message): The maximum amount of time a snapshot can stay active is 365 days. If 'ttl' is not specified, the default maximum of 365 days will be used. - state (google.cloud.bigtable_admin_v2.types.Snapshot.State): + state (google.cloud.bigtable.admin_v2.types.Snapshot.State): Output only. The current state of the snapshot. description (str): @@ -863,12 +878,12 @@ class Backup(proto.Message): this timestamp. size_bytes (int): Output only. Size of the backup in bytes. - state (google.cloud.bigtable_admin_v2.types.Backup.State): + state (google.cloud.bigtable.admin_v2.types.Backup.State): Output only. The current state of the backup. - encryption_info (google.cloud.bigtable_admin_v2.types.EncryptionInfo): + encryption_info (google.cloud.bigtable.admin_v2.types.EncryptionInfo): Output only. The encryption information for the backup. - backup_type (google.cloud.bigtable_admin_v2.types.Backup.BackupType): + backup_type (google.cloud.bigtable.admin_v2.types.Backup.BackupType): Indicates the backup type of the backup. hot_to_standard_time (google.protobuf.timestamp_pb2.Timestamp): The time at which the hot backup will be converted to a diff --git a/google/cloud/bigtable_admin_v2/types/types.py b/google/cloud/bigtable/admin_v2/types/types.py similarity index 91% rename from google/cloud/bigtable_admin_v2/types/types.py rename to google/cloud/bigtable/admin_v2/types/types.py index 42935df3c..789f57c01 100644 --- a/google/cloud/bigtable_admin_v2/types/types.py +++ b/google/cloud/bigtable/admin_v2/types/types.py @@ -65,51 +65,51 @@ class Type(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - bytes_type (google.cloud.bigtable_admin_v2.types.Type.Bytes): + bytes_type (google.cloud.bigtable.admin_v2.types.Type.Bytes): Bytes This field is a member of `oneof`_ ``kind``. - string_type (google.cloud.bigtable_admin_v2.types.Type.String): + string_type (google.cloud.bigtable.admin_v2.types.Type.String): String This field is a member of `oneof`_ ``kind``. - int64_type (google.cloud.bigtable_admin_v2.types.Type.Int64): + int64_type (google.cloud.bigtable.admin_v2.types.Type.Int64): Int64 This field is a member of `oneof`_ ``kind``. - float32_type (google.cloud.bigtable_admin_v2.types.Type.Float32): + float32_type (google.cloud.bigtable.admin_v2.types.Type.Float32): Float32 This field is a member of `oneof`_ ``kind``. - float64_type (google.cloud.bigtable_admin_v2.types.Type.Float64): + float64_type (google.cloud.bigtable.admin_v2.types.Type.Float64): Float64 This field is a member of `oneof`_ ``kind``. - bool_type (google.cloud.bigtable_admin_v2.types.Type.Bool): + bool_type (google.cloud.bigtable.admin_v2.types.Type.Bool): Bool This field is a member of `oneof`_ ``kind``. - timestamp_type (google.cloud.bigtable_admin_v2.types.Type.Timestamp): + timestamp_type (google.cloud.bigtable.admin_v2.types.Type.Timestamp): Timestamp This field is a member of `oneof`_ ``kind``. - date_type (google.cloud.bigtable_admin_v2.types.Type.Date): + date_type (google.cloud.bigtable.admin_v2.types.Type.Date): Date This field is a member of `oneof`_ ``kind``. - aggregate_type (google.cloud.bigtable_admin_v2.types.Type.Aggregate): + aggregate_type (google.cloud.bigtable.admin_v2.types.Type.Aggregate): Aggregate This field is a member of `oneof`_ ``kind``. - struct_type (google.cloud.bigtable_admin_v2.types.Type.Struct): + struct_type (google.cloud.bigtable.admin_v2.types.Type.Struct): Struct This field is a member of `oneof`_ ``kind``. - array_type (google.cloud.bigtable_admin_v2.types.Type.Array): + array_type (google.cloud.bigtable.admin_v2.types.Type.Array): Array This field is a member of `oneof`_ ``kind``. - map_type (google.cloud.bigtable_admin_v2.types.Type.Map): + map_type (google.cloud.bigtable.admin_v2.types.Type.Map): Map This field is a member of `oneof`_ ``kind``. @@ -119,7 +119,7 @@ class Bytes(proto.Message): r"""Bytes Values of type ``Bytes`` are stored in ``Value.bytes_value``. Attributes: - encoding (google.cloud.bigtable_admin_v2.types.Type.Bytes.Encoding): + encoding (google.cloud.bigtable.admin_v2.types.Type.Bytes.Encoding): The encoding to use when converting to or from lower level types. """ @@ -130,7 +130,7 @@ class Encoding(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - raw (google.cloud.bigtable_admin_v2.types.Type.Bytes.Encoding.Raw): + raw (google.cloud.bigtable.admin_v2.types.Type.Bytes.Encoding.Raw): Use ``Raw`` encoding. This field is a member of `oneof`_ ``encoding``. @@ -163,7 +163,7 @@ class String(proto.Message): ``Value.string_value``. Attributes: - encoding (google.cloud.bigtable_admin_v2.types.Type.String.Encoding): + encoding (google.cloud.bigtable.admin_v2.types.Type.String.Encoding): The encoding to use when converting to or from lower level types. """ @@ -179,11 +179,11 @@ class Encoding(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - utf8_raw (google.cloud.bigtable_admin_v2.types.Type.String.Encoding.Utf8Raw): + utf8_raw (google.cloud.bigtable.admin_v2.types.Type.String.Encoding.Utf8Raw): Deprecated: if set, converts to an empty ``utf8_bytes``. This field is a member of `oneof`_ ``encoding``. - utf8_bytes (google.cloud.bigtable_admin_v2.types.Type.String.Encoding.Utf8Bytes): + utf8_bytes (google.cloud.bigtable.admin_v2.types.Type.String.Encoding.Utf8Bytes): Use ``Utf8Bytes`` encoding. This field is a member of `oneof`_ ``encoding``. @@ -233,7 +233,7 @@ class Int64(proto.Message): r"""Int64 Values of type ``Int64`` are stored in ``Value.int_value``. Attributes: - encoding (google.cloud.bigtable_admin_v2.types.Type.Int64.Encoding): + encoding (google.cloud.bigtable.admin_v2.types.Type.Int64.Encoding): The encoding to use when converting to or from lower level types. """ @@ -249,11 +249,11 @@ class Encoding(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - big_endian_bytes (google.cloud.bigtable_admin_v2.types.Type.Int64.Encoding.BigEndianBytes): + big_endian_bytes (google.cloud.bigtable.admin_v2.types.Type.Int64.Encoding.BigEndianBytes): Use ``BigEndianBytes`` encoding. This field is a member of `oneof`_ ``encoding``. - ordered_code_bytes (google.cloud.bigtable_admin_v2.types.Type.Int64.Encoding.OrderedCodeBytes): + ordered_code_bytes (google.cloud.bigtable.admin_v2.types.Type.Int64.Encoding.OrderedCodeBytes): Use ``OrderedCodeBytes`` encoding. This field is a member of `oneof`_ ``encoding``. @@ -273,7 +273,7 @@ class BigEndianBytes(proto.Message): - Java ``ByteBuffer.putLong()`` with ``ByteOrder.BIG_ENDIAN`` Attributes: - bytes_type (google.cloud.bigtable_admin_v2.types.Type.Bytes): + bytes_type (google.cloud.bigtable.admin_v2.types.Type.Bytes): Deprecated: ignored if set. """ @@ -332,7 +332,7 @@ class Timestamp(proto.Message): ``Value.timestamp_value``. Attributes: - encoding (google.cloud.bigtable_admin_v2.types.Type.Timestamp.Encoding): + encoding (google.cloud.bigtable.admin_v2.types.Type.Timestamp.Encoding): The encoding to use when converting to or from lower level types. """ @@ -343,7 +343,7 @@ class Encoding(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - unix_micros_int64 (google.cloud.bigtable_admin_v2.types.Type.Int64.Encoding): + unix_micros_int64 (google.cloud.bigtable.admin_v2.types.Type.Int64.Encoding): Encodes the number of microseconds since the Unix epoch using the given ``Int64`` encoding. Values must be microsecond-aligned. @@ -378,10 +378,10 @@ class Struct(proto.Message): as ``field_types``. Attributes: - fields (MutableSequence[google.cloud.bigtable_admin_v2.types.Type.Struct.Field]): + fields (MutableSequence[google.cloud.bigtable.admin_v2.types.Type.Struct.Field]): The names and types of the fields in this struct. - encoding (google.cloud.bigtable_admin_v2.types.Type.Struct.Encoding): + encoding (google.cloud.bigtable.admin_v2.types.Type.Struct.Encoding): The encoding to use when converting to or from lower level types. """ @@ -393,7 +393,7 @@ class Field(proto.Message): field_name (str): The field name (optional). Fields without a ``field_name`` are considered anonymous and cannot be referenced by name. - type_ (google.cloud.bigtable_admin_v2.types.Type): + type_ (google.cloud.bigtable.admin_v2.types.Type): The type of values in this field. """ @@ -418,15 +418,15 @@ class Encoding(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - singleton (google.cloud.bigtable_admin_v2.types.Type.Struct.Encoding.Singleton): + singleton (google.cloud.bigtable.admin_v2.types.Type.Struct.Encoding.Singleton): Use ``Singleton`` encoding. This field is a member of `oneof`_ ``encoding``. - delimited_bytes (google.cloud.bigtable_admin_v2.types.Type.Struct.Encoding.DelimitedBytes): + delimited_bytes (google.cloud.bigtable.admin_v2.types.Type.Struct.Encoding.DelimitedBytes): Use ``DelimitedBytes`` encoding. This field is a member of `oneof`_ ``encoding``. - ordered_code_bytes (google.cloud.bigtable_admin_v2.types.Type.Struct.Encoding.OrderedCodeBytes): + ordered_code_bytes (google.cloud.bigtable.admin_v2.types.Type.Struct.Encoding.OrderedCodeBytes): User ``OrderedCodeBytes`` encoding. This field is a member of `oneof`_ ``encoding``. @@ -553,7 +553,7 @@ class Array(proto.Message): ``Array`` are stored in ``Value.array_value``. Attributes: - element_type (google.cloud.bigtable_admin_v2.types.Type): + element_type (google.cloud.bigtable.admin_v2.types.Type): The type of the elements in the array. This must not be ``Array``. """ @@ -574,10 +574,10 @@ class Map(proto.Message): precedence. Attributes: - key_type (google.cloud.bigtable_admin_v2.types.Type): + key_type (google.cloud.bigtable.admin_v2.types.Type): The type of a map key. Only ``Bytes``, ``String``, and ``Int64`` are allowed as key types. - value_type (google.cloud.bigtable_admin_v2.types.Type): + value_type (google.cloud.bigtable.admin_v2.types.Type): The type of the values in a map. """ @@ -607,28 +607,28 @@ class Aggregate(proto.Message): .. _oneof: https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields Attributes: - input_type (google.cloud.bigtable_admin_v2.types.Type): + input_type (google.cloud.bigtable.admin_v2.types.Type): Type of the inputs that are accumulated by this ``Aggregate``, which must specify a full encoding. Use ``AddInput`` mutations to accumulate new inputs. - state_type (google.cloud.bigtable_admin_v2.types.Type): + state_type (google.cloud.bigtable.admin_v2.types.Type): Output only. Type that holds the internal accumulator state for the ``Aggregate``. This is a function of the ``input_type`` and ``aggregator`` chosen, and will always specify a full encoding. - sum (google.cloud.bigtable_admin_v2.types.Type.Aggregate.Sum): + sum (google.cloud.bigtable.admin_v2.types.Type.Aggregate.Sum): Sum aggregator. This field is a member of `oneof`_ ``aggregator``. - hllpp_unique_count (google.cloud.bigtable_admin_v2.types.Type.Aggregate.HyperLogLogPlusPlusUniqueCount): + hllpp_unique_count (google.cloud.bigtable.admin_v2.types.Type.Aggregate.HyperLogLogPlusPlusUniqueCount): HyperLogLogPlusPlusUniqueCount aggregator. This field is a member of `oneof`_ ``aggregator``. - max_ (google.cloud.bigtable_admin_v2.types.Type.Aggregate.Max): + max_ (google.cloud.bigtable.admin_v2.types.Type.Aggregate.Max): Max aggregator. This field is a member of `oneof`_ ``aggregator``. - min_ (google.cloud.bigtable_admin_v2.types.Type.Aggregate.Min): + min_ (google.cloud.bigtable.admin_v2.types.Type.Aggregate.Min): Min aggregator. This field is a member of `oneof`_ ``aggregator``. diff --git a/google/cloud/bigtable/app_profile.py b/google/cloud/bigtable/app_profile.py index 8cde66146..20cf37267 100644 --- a/google/cloud/bigtable/app_profile.py +++ b/google/cloud/bigtable/app_profile.py @@ -18,7 +18,7 @@ import re from google.cloud.bigtable.enums import RoutingPolicyType -from google.cloud.bigtable_admin_v2.types import instance +from google.cloud.bigtable.admin_v2.types import instance from google.protobuf import field_mask_pb2 from google.api_core.exceptions import NotFound diff --git a/google/cloud/bigtable/backup.py b/google/cloud/bigtable/backup.py index 5b2cafc54..7c4ee6f97 100644 --- a/google/cloud/bigtable/backup.py +++ b/google/cloud/bigtable/backup.py @@ -17,8 +17,8 @@ import re from google.cloud._helpers import _datetime_to_pb_timestamp # type: ignore -from google.cloud.bigtable_admin_v2 import BigtableTableAdminClient -from google.cloud.bigtable_admin_v2.types import table +from google.cloud.bigtable.admin_v2 import BaseBigtableTableAdminClient +from google.cloud.bigtable.admin_v2.types import table from google.cloud.bigtable.encryption_info import EncryptionInfo from google.cloud.bigtable.policy import Policy from google.cloud.exceptions import NotFound # type: ignore @@ -106,7 +106,7 @@ def name(self): if not self._cluster: raise ValueError('"cluster" parameter must be set') - return BigtableTableAdminClient.backup_path( + return BaseBigtableTableAdminClient.backup_path( project=self._instance._client.project, instance=self._instance.instance_id, cluster=self._cluster, @@ -141,7 +141,7 @@ def parent(self): :returns: A full path to the parent cluster. """ if not self._parent and self._cluster: - self._parent = BigtableTableAdminClient.cluster_path( + self._parent = BaseBigtableTableAdminClient.cluster_path( project=self._instance._client.project, instance=self._instance.instance_id, cluster=self._cluster, @@ -163,7 +163,7 @@ def source_table(self): :returns: The Table name. """ if not self._source_table and self.table_id: - self._source_table = BigtableTableAdminClient.table_path( + self._source_table = BaseBigtableTableAdminClient.table_path( project=self._instance._client.project, instance=self._instance.instance_id, table=self.table_id, @@ -226,7 +226,7 @@ def size_bytes(self): def state(self): """The current state of this Backup. - :rtype: :class:`~google.cloud.bigtable_admin_v2.gapic.enums.Backup.State` + :rtype: :class:`~google.cloud.bigtable.admin_v2.types.table.Backup.State` :returns: The current state of this Backup. """ return self._state @@ -305,8 +305,7 @@ def create(self, cluster_id=None): created Backup. :rtype: :class:`~google.api_core.operation.Operation` - :returns: :class:`~google.cloud.bigtable_admin_v2.types._OperationFuture` - instance, to be used to poll the status of the 'create' request + :returns: A future to be used to poll the status of the 'create' request :raises Conflict: if the Backup already exists :raises NotFound: if the Instance owning the Backup does not exist :raises BadRequest: if the `table` or `expire_time` values are invalid, @@ -343,7 +342,7 @@ def get(self): """Retrieves metadata of a pending or completed Backup. :returns: An instance of - :class:`~google.cloud.bigtable_admin_v2.types.Backup` + :class:`~google.cloud.bigtable.admin_v2.types.Backup` :raises google.api_core.exceptions.GoogleAPICallError: If the request failed for any reason. @@ -412,7 +411,7 @@ def restore(self, table_id, instance_id=None): :param instance_id: (Optional) The ID of the Instance to restore the backup into, if different from the current one. - :rtype: :class:`~google.cloud.bigtable_admin_v2.types._OperationFuture` + :rtype: :class:`~google.api_core.operation.Operation` :returns: A future to be used to poll the status of the 'restore' request. @@ -426,14 +425,14 @@ def restore(self, table_id, instance_id=None): """ api = self._instance._client.table_admin_client if instance_id: - parent = BigtableTableAdminClient.instance_path( + parent = BaseBigtableTableAdminClient.instance_path( project=self._instance._client.project, instance=instance_id, ) else: parent = self._instance.name - return api.restore_table( + return api._restore_table( request={"parent": parent, "table_id": table_id, "backup": self.name} ) diff --git a/google/cloud/bigtable/client.py b/google/cloud/bigtable/client.py index 0c89ea562..7172ce3e9 100644 --- a/google/cloud/bigtable/client.py +++ b/google/cloud/bigtable/client.py @@ -35,12 +35,12 @@ from google.auth.credentials import AnonymousCredentials # type: ignore from google.cloud import bigtable_v2 -from google.cloud import bigtable_admin_v2 +from google.cloud.bigtable import admin_v2 from google.cloud.bigtable_v2.services.bigtable.transports import BigtableGrpcTransport -from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.transports import ( +from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.transports import ( BigtableInstanceAdminGrpcTransport, ) -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin.transports import ( +from google.cloud.bigtable.admin_v2.services.bigtable_table_admin.transports import ( BigtableTableAdminGrpcTransport, ) @@ -50,7 +50,7 @@ from google.cloud.client import ClientWithProject # type: ignore -from google.cloud.bigtable_admin_v2.types import instance +from google.cloud.bigtable.admin_v2.types import instance from google.cloud.bigtable.cluster import _CLUSTER_NAME_RE from google.cloud.environment_vars import BIGTABLE_EMULATOR # type: ignore @@ -325,11 +325,11 @@ def table_admin_client(self): raise ValueError("Client is not an admin client.") transport = self._create_gapic_client_channel( - bigtable_admin_v2.BigtableTableAdminClient, + admin_v2.BaseBigtableTableAdminClient, BigtableTableAdminGrpcTransport, ) klass = _create_gapic_client( - bigtable_admin_v2.BigtableTableAdminClient, + admin_v2.BaseBigtableTableAdminClient, client_options=self._admin_client_options, transport=transport, ) @@ -358,11 +358,11 @@ def instance_admin_client(self): raise ValueError("Client is not an admin client.") transport = self._create_gapic_client_channel( - bigtable_admin_v2.BigtableInstanceAdminClient, + admin_v2.BigtableInstanceAdminClient, BigtableInstanceAdminGrpcTransport, ) klass = _create_gapic_client( - bigtable_admin_v2.BigtableInstanceAdminClient, + admin_v2.BigtableInstanceAdminClient, client_options=self._admin_client_options, transport=transport, ) diff --git a/google/cloud/bigtable/cluster.py b/google/cloud/bigtable/cluster.py index 11fb5492d..99f23b3a8 100644 --- a/google/cloud/bigtable/cluster.py +++ b/google/cloud/bigtable/cluster.py @@ -16,7 +16,7 @@ import re -from google.cloud.bigtable_admin_v2.types import instance +from google.cloud.bigtable.admin_v2.types import instance from google.api_core.exceptions import NotFound from google.protobuf import field_mask_pb2 diff --git a/google/cloud/bigtable/column_family.py b/google/cloud/bigtable/column_family.py index 80232958d..0013ab5d9 100644 --- a/google/cloud/bigtable/column_family.py +++ b/google/cloud/bigtable/column_family.py @@ -16,8 +16,8 @@ from google.cloud import _helpers -from google.cloud.bigtable_admin_v2.types import table as table_v2_pb2 -from google.cloud.bigtable_admin_v2.types import ( +from google.cloud.bigtable.admin_v2.types import table as table_v2_pb2 +from google.cloud.bigtable.admin_v2.types import ( bigtable_table_admin as table_admin_v2_pb2, ) from google.api_core.gapic_v1.method import DEFAULT @@ -275,7 +275,7 @@ def create(self): client = self._table._instance._client # data it contains are the GC rule and the column family ID already # stored on this instance. - client.table_admin_client.modify_column_families( + client.table_admin_client._modify_column_families( request={"name": self._table.name, "modifications": [modification]}, timeout=DEFAULT, ) @@ -303,7 +303,7 @@ def update(self): client = self._table._instance._client # data it contains are the GC rule and the column family ID already # stored on this instance. - client.table_admin_client.modify_column_families( + client.table_admin_client._modify_column_families( request={"name": self._table.name, "modifications": [modification]}, timeout=DEFAULT, ) @@ -326,7 +326,7 @@ def delete(self): client = self._table._instance._client # data it contains are the GC rule and the column family ID already # stored on this instance. - client.table_admin_client.modify_column_families( + client.table_admin_client._modify_column_families( request={"name": self._table.name, "modifications": [modification]}, timeout=DEFAULT, ) diff --git a/google/cloud/bigtable/enums.py b/google/cloud/bigtable/enums.py index 327b2f828..b27e4fac6 100644 --- a/google/cloud/bigtable/enums.py +++ b/google/cloud/bigtable/enums.py @@ -13,9 +13,9 @@ # limitations under the License. """Wrappers for gapic enum types.""" -from google.cloud.bigtable_admin_v2.types import common -from google.cloud.bigtable_admin_v2.types import instance -from google.cloud.bigtable_admin_v2.types import table +from google.cloud.bigtable.admin_v2.types import common +from google.cloud.bigtable.admin_v2.types import instance +from google.cloud.bigtable.admin_v2.types import table class StorageType(object): diff --git a/google/cloud/bigtable/instance.py b/google/cloud/bigtable/instance.py index 23fb1c95d..c43904351 100644 --- a/google/cloud/bigtable/instance.py +++ b/google/cloud/bigtable/instance.py @@ -22,7 +22,7 @@ from google.protobuf import field_mask_pb2 -from google.cloud.bigtable_admin_v2.types import instance +from google.cloud.bigtable.admin_v2.types import instance from google.iam.v1 import options_pb2 # type: ignore diff --git a/google/cloud/bigtable/table.py b/google/cloud/bigtable/table.py index 7429bd36f..346b3b673 100644 --- a/google/cloud/bigtable/table.py +++ b/google/cloud/bigtable/table.py @@ -47,9 +47,9 @@ from google.cloud.bigtable.row_set import RowRange from google.cloud.bigtable import enums from google.cloud.bigtable_v2.types import bigtable as data_messages_v2_pb2 -from google.cloud.bigtable_admin_v2 import BigtableTableAdminClient -from google.cloud.bigtable_admin_v2.types import table as admin_messages_v2_pb2 -from google.cloud.bigtable_admin_v2.types import ( +from google.cloud.bigtable.admin_v2 import BaseBigtableTableAdminClient +from google.cloud.bigtable.admin_v2.types import table as admin_messages_v2_pb2 +from google.cloud.bigtable.admin_v2.types import ( bigtable_table_admin as table_admin_messages_v2_pb2, ) @@ -990,7 +990,7 @@ def list_backups(self, cluster_id=None, filter_=None, order_by=None, page_size=0 if filter_: backups_filter = "({}) AND ({})".format(backups_filter, filter_) - parent = BigtableTableAdminClient.cluster_path( + parent = BaseBigtableTableAdminClient.cluster_path( project=self._instance._client.project, instance=self._instance.instance_id, cluster=cluster_id, @@ -1037,7 +1037,7 @@ def restore(self, new_table_id, cluster_id=None, backup_id=None, backup_name=Non and `backup_id` parameters even of such specified. :return: An instance of - :class:`~google.cloud.bigtable_admin_v2.types._OperationFuture`. + :class:`~google.api_core.operation.Operation`. :raises: google.api_core.exceptions.AlreadyExists: If the table already exists. @@ -1049,13 +1049,13 @@ def restore(self, new_table_id, cluster_id=None, backup_id=None, backup_name=Non """ api = self._instance._client.table_admin_client if not backup_name: - backup_name = BigtableTableAdminClient.backup_path( + backup_name = BaseBigtableTableAdminClient.backup_path( project=self._instance._client.project, instance=self._instance.instance_id, cluster=cluster_id, backup=backup_id, ) - return api.restore_table( + return api._restore_table( request={ "parent": self._instance.name, "table_id": new_table_id, diff --git a/google/cloud/bigtable_admin/__init__.py b/google/cloud/bigtable_admin/__init__.py deleted file mode 100644 index c8f2a4482..000000000 --- a/google/cloud/bigtable_admin/__init__.py +++ /dev/null @@ -1,410 +0,0 @@ -# -*- coding: utf-8 -*- -# Copyright 2025 Google LLC -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -from google.cloud.bigtable_admin import gapic_version as package_version - -__version__ = package_version.__version__ - - -from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.client import ( - BigtableInstanceAdminClient, -) -from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.async_client import ( - BigtableInstanceAdminAsyncClient, -) -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin.client import ( - BigtableTableAdminClient, -) -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin.async_client import ( - BigtableTableAdminAsyncClient, -) - -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - CreateAppProfileRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - CreateClusterMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - CreateClusterRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - CreateInstanceMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - CreateInstanceRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - CreateLogicalViewMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - CreateLogicalViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - CreateMaterializedViewMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - CreateMaterializedViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - DeleteAppProfileRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - DeleteClusterRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - DeleteInstanceRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - DeleteLogicalViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - DeleteMaterializedViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - GetAppProfileRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - GetClusterRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - GetInstanceRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - GetLogicalViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - GetMaterializedViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListAppProfilesRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListAppProfilesResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListClustersRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListClustersResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListHotTabletsRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListHotTabletsResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListInstancesRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListInstancesResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListLogicalViewsRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListLogicalViewsResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListMaterializedViewsRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - ListMaterializedViewsResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - PartialUpdateClusterMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - PartialUpdateClusterRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - PartialUpdateInstanceRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - UpdateAppProfileMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - UpdateAppProfileRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - UpdateClusterMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - UpdateInstanceMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - UpdateLogicalViewMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - UpdateLogicalViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - UpdateMaterializedViewMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_instance_admin import ( - UpdateMaterializedViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - CheckConsistencyRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - CheckConsistencyResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import CopyBackupMetadata -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import CopyBackupRequest -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - CreateAuthorizedViewMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - CreateAuthorizedViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - CreateBackupMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - CreateBackupRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - CreateTableFromSnapshotMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - CreateTableFromSnapshotRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import CreateTableRequest -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - DataBoostReadLocalWrites, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - DeleteAuthorizedViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - DeleteBackupRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - DeleteSnapshotRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import DeleteTableRequest -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - DropRowRangeRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - GenerateConsistencyTokenRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - GenerateConsistencyTokenResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - GetAuthorizedViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import GetBackupRequest -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import GetSnapshotRequest -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import GetTableRequest -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - ListAuthorizedViewsRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - ListAuthorizedViewsResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ListBackupsRequest -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - ListBackupsResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - ListSnapshotsRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - ListSnapshotsResponse, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ListTablesRequest -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ListTablesResponse -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - ModifyColumnFamiliesRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - OptimizeRestoredTableMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - RestoreTableMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - RestoreTableRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - SnapshotTableMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - SnapshotTableRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - StandardReadRemoteWrites, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - UndeleteTableMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - UndeleteTableRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - UpdateAuthorizedViewMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - UpdateAuthorizedViewRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - UpdateBackupRequest, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import ( - UpdateTableMetadata, -) -from google.cloud.bigtable_admin_v2.types.bigtable_table_admin import UpdateTableRequest -from google.cloud.bigtable_admin_v2.types.common import OperationProgress -from google.cloud.bigtable_admin_v2.types.common import StorageType -from google.cloud.bigtable_admin_v2.types.instance import AppProfile -from google.cloud.bigtable_admin_v2.types.instance import AutoscalingLimits -from google.cloud.bigtable_admin_v2.types.instance import AutoscalingTargets -from google.cloud.bigtable_admin_v2.types.instance import Cluster -from google.cloud.bigtable_admin_v2.types.instance import HotTablet -from google.cloud.bigtable_admin_v2.types.instance import Instance -from google.cloud.bigtable_admin_v2.types.instance import LogicalView -from google.cloud.bigtable_admin_v2.types.instance import MaterializedView -from google.cloud.bigtable_admin_v2.types.table import AuthorizedView -from google.cloud.bigtable_admin_v2.types.table import Backup -from google.cloud.bigtable_admin_v2.types.table import BackupInfo -from google.cloud.bigtable_admin_v2.types.table import ChangeStreamConfig -from google.cloud.bigtable_admin_v2.types.table import ColumnFamily -from google.cloud.bigtable_admin_v2.types.table import EncryptionInfo -from google.cloud.bigtable_admin_v2.types.table import GcRule -from google.cloud.bigtable_admin_v2.types.table import RestoreInfo -from google.cloud.bigtable_admin_v2.types.table import Snapshot -from google.cloud.bigtable_admin_v2.types.table import Table -from google.cloud.bigtable_admin_v2.types.table import RestoreSourceType -from google.cloud.bigtable_admin_v2.types.types import Type - -__all__ = ( - "BigtableInstanceAdminClient", - "BigtableInstanceAdminAsyncClient", - "BigtableTableAdminClient", - "BigtableTableAdminAsyncClient", - "CreateAppProfileRequest", - "CreateClusterMetadata", - "CreateClusterRequest", - "CreateInstanceMetadata", - "CreateInstanceRequest", - "CreateLogicalViewMetadata", - "CreateLogicalViewRequest", - "CreateMaterializedViewMetadata", - "CreateMaterializedViewRequest", - "DeleteAppProfileRequest", - "DeleteClusterRequest", - "DeleteInstanceRequest", - "DeleteLogicalViewRequest", - "DeleteMaterializedViewRequest", - "GetAppProfileRequest", - "GetClusterRequest", - "GetInstanceRequest", - "GetLogicalViewRequest", - "GetMaterializedViewRequest", - "ListAppProfilesRequest", - "ListAppProfilesResponse", - "ListClustersRequest", - "ListClustersResponse", - "ListHotTabletsRequest", - "ListHotTabletsResponse", - "ListInstancesRequest", - "ListInstancesResponse", - "ListLogicalViewsRequest", - "ListLogicalViewsResponse", - "ListMaterializedViewsRequest", - "ListMaterializedViewsResponse", - "PartialUpdateClusterMetadata", - "PartialUpdateClusterRequest", - "PartialUpdateInstanceRequest", - "UpdateAppProfileMetadata", - "UpdateAppProfileRequest", - "UpdateClusterMetadata", - "UpdateInstanceMetadata", - "UpdateLogicalViewMetadata", - "UpdateLogicalViewRequest", - "UpdateMaterializedViewMetadata", - "UpdateMaterializedViewRequest", - "CheckConsistencyRequest", - "CheckConsistencyResponse", - "CopyBackupMetadata", - "CopyBackupRequest", - "CreateAuthorizedViewMetadata", - "CreateAuthorizedViewRequest", - "CreateBackupMetadata", - "CreateBackupRequest", - "CreateTableFromSnapshotMetadata", - "CreateTableFromSnapshotRequest", - "CreateTableRequest", - "DataBoostReadLocalWrites", - "DeleteAuthorizedViewRequest", - "DeleteBackupRequest", - "DeleteSnapshotRequest", - "DeleteTableRequest", - "DropRowRangeRequest", - "GenerateConsistencyTokenRequest", - "GenerateConsistencyTokenResponse", - "GetAuthorizedViewRequest", - "GetBackupRequest", - "GetSnapshotRequest", - "GetTableRequest", - "ListAuthorizedViewsRequest", - "ListAuthorizedViewsResponse", - "ListBackupsRequest", - "ListBackupsResponse", - "ListSnapshotsRequest", - "ListSnapshotsResponse", - "ListTablesRequest", - "ListTablesResponse", - "ModifyColumnFamiliesRequest", - "OptimizeRestoredTableMetadata", - "RestoreTableMetadata", - "RestoreTableRequest", - "SnapshotTableMetadata", - "SnapshotTableRequest", - "StandardReadRemoteWrites", - "UndeleteTableMetadata", - "UndeleteTableRequest", - "UpdateAuthorizedViewMetadata", - "UpdateAuthorizedViewRequest", - "UpdateBackupRequest", - "UpdateTableMetadata", - "UpdateTableRequest", - "OperationProgress", - "StorageType", - "AppProfile", - "AutoscalingLimits", - "AutoscalingTargets", - "Cluster", - "HotTablet", - "Instance", - "LogicalView", - "MaterializedView", - "AuthorizedView", - "Backup", - "BackupInfo", - "ChangeStreamConfig", - "ColumnFamily", - "EncryptionInfo", - "GcRule", - "RestoreInfo", - "Snapshot", - "Table", - "RestoreSourceType", - "Type", -) diff --git a/owlbot.py b/owlbot.py index 16ce11b4f..8f8de3024 100644 --- a/owlbot.py +++ b/owlbot.py @@ -16,6 +16,7 @@ from pathlib import Path import re +import textwrap from typing import List, Optional import synthtool as s @@ -75,10 +76,12 @@ def get_staging_dirs( s.move(library / "scripts") for library in get_staging_dirs(bigtable_admin_default_version, "bigtable_admin"): - s.move(library / "google/cloud/bigtable_admin", excludes=["**/gapic_version.py"]) - s.move(library / "google/cloud/bigtable_admin_v2", excludes=["**/gapic_version.py"]) + s.move(library / "google/cloud/bigtable/admin", excludes=["**/gapic_version.py"]) + s.move(library / "google/cloud/bigtable/admin_v2", excludes=["**/gapic_version.py"]) s.move(library / "tests") + s.move(library / "samples") s.move(library / "scripts") + s.move(library / "docs/admin_v2", destination="docs/admin_client") s.remove_staging_dirs() @@ -112,4 +115,127 @@ def get_staging_dirs( """# todo(kolea2): temporary workaround to install pinned dep version INSTALL_LIBRARY_FROM_SOURCE = False""") +# -------------------------------------------------------------------------- +# Admin Overlay work +# -------------------------------------------------------------------------- + +# Add overlay imports to top level __init__.py files in admin_v2 and admin at the end +# of each file, after the __all__ definition. +def add_overlay_to_init_py(init_py_location, import_statements): + s.replace( + init_py_location, + r"(?s)(^__all__ = \(.*\)$)", + r"\1\n\n" + import_statements + ) + +add_overlay_to_init_py( + "google/cloud/bigtable/admin_v2/__init__.py", + """from .overlay import * # noqa: F403 +__all__ += overlay.__all__ # noqa: F405 +""" +) + +add_overlay_to_init_py( + "google/cloud/bigtable/admin/__init__.py", + """import google.cloud.bigtable.admin_v2.overlay # noqa: F401 +from google.cloud.bigtable.admin_v2.overlay import * # noqa: F401, F403 + +__all__ += google.cloud.bigtable.admin_v2.overlay.__all__ +""" +) + +# Replace all instances of BaseBigtableTableAdminClient/BaseBigtableAdminAsyncClient +# in samples and docstrings with BigtableTableAdminClient/BigtableTableAdminAsyncClient +s.replace( + [ + "google/cloud/bigtable/admin_v2/services/*/client.py", + "google/cloud/bigtable/admin_v2/services/*/async_client.py", + "samples/generated_samples/bigtableadmin_v2_*.py" + ], + r"client = admin_v2\.Base(BigtableTableAdmin(Async)?Client\(\))", + r"client = admin_v2.\1" +) + +# Fix an improperly formatted table that breaks nox -s docs. +s.replace( + "google/cloud/bigtable/admin_v2/types/table.py", + """ For example, if \\\\_key = + "some_id#2024-04-30#\\\\x00\\\\x13\\\\x00\\\\xf3" with the following + schema: \\{ fields \\{ field_name: "id" type \\{ string \\{ + encoding: utf8_bytes \\{\\} \\} \\} \\} fields \\{ field_name: "date" + type \\{ string \\{ encoding: utf8_bytes \\{\\} \\} \\} \\} fields \\{ + field_name: "product_code" type \\{ int64 \\{ encoding: + big_endian_bytes \\{\\} \\} \\} \\} encoding \\{ delimited_bytes \\{ + delimiter: "#" \\} \\} \\} + + \\| The decoded key parts would be: id = "some_id", date = + "2024-04-30", product_code = 1245427 The query "SELECT + \\\\_key, product_code FROM table" will return two columns: + /------------------------------------------------------ + \\| \\\\\\| \\\\_key \\\\\\| product_code \\\\\\| \\\\\\| + --------------------------------------\\|--------------\\\\\\| \\\\\\| + "some_id#2024-04-30#\\\\x00\\\\x13\\\\x00\\\\xf3" \\\\\\| 1245427 \\\\\\| + ------------------------------------------------------/ +""", + textwrap.indent( + """For example, if \\\\_key = +"some_id#2024-04-30#\\\\x00\\\\x13\\\\x00\\\\xf3" with the following +schema: + +.. code-block:: + + { + fields { + field_name: "id" + type { string { encoding: utf8_bytes {} } } + } + fields { + field_name: "date" + type { string { encoding: utf8_bytes {} } } + } + fields { + field_name: "product_code" + type { int64 { encoding: big_endian_bytes {} } } + } + encoding { delimited_bytes { delimiter: "#" } } + } + +The decoded key parts would be: +id = "some_id", date = "2024-04-30", product_code = 1245427 +The query "SELECT \\\\_key, product_code FROM table" will return +two columns: + ++========================================+==============+ +| \\\\_key | product_code | ++========================================+==============+ +| "some_id#2024-04-30#\\\\x00\\\\x13\\\\x00\\\\xf3" | 1245427 | ++----------------------------------------+--------------+ +""", + " " * 12, + ), +) + +# Change the subpackage for clients with overridden internal methods in them +# from service to overlay.service. +s.replace( + "docs/admin_client/bigtable_table_admin.rst", + r"^\.\. automodule:: google\.cloud\.bigtable\.admin_v2\.services\.bigtable_table_admin$", + ".. automodule:: google.cloud.bigtable.admin_v2.overlay.services.bigtable_table_admin" +) + +# Add overlay types to types documentation +s.replace( + "docs/admin_client/types_.rst", + r"""(\.\. automodule:: google\.cloud\.bigtable\.admin_v2\.types + :members: + :show-inheritance:) +""", + r"""\1 + +.. automodule:: google.cloud.bigtable.admin_v2.overlay.types + :members: + :show-inheritance: +""" +) + s.shell.run(["nox", "-s", "blacken"], hide_output=False) diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_app_profile_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_app_profile_async.py new file mode 100644 index 000000000..3f907c89a --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_app_profile_async.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateAppProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateAppProfile_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_create_app_profile(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + app_profile = admin_v2.AppProfile() + app_profile.priority = "PRIORITY_HIGH" + + request = admin_v2.CreateAppProfileRequest( + parent="parent_value", + app_profile_id="app_profile_id_value", + app_profile=app_profile, + ) + + # Make the request + response = await client.create_app_profile(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateAppProfile_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_app_profile_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_app_profile_sync.py new file mode 100644 index 000000000..608dd6d63 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_app_profile_sync.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateAppProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateAppProfile_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_create_app_profile(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + app_profile = admin_v2.AppProfile() + app_profile.priority = "PRIORITY_HIGH" + + request = admin_v2.CreateAppProfileRequest( + parent="parent_value", + app_profile_id="app_profile_id_value", + app_profile=app_profile, + ) + + # Make the request + response = client.create_app_profile(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateAppProfile_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_cluster_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_cluster_async.py new file mode 100644 index 000000000..7169b4101 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_cluster_async.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateCluster +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateCluster_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_create_cluster(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.CreateClusterRequest( + parent="parent_value", + cluster_id="cluster_id_value", + ) + + # Make the request + operation = client.create_cluster(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateCluster_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_cluster_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_cluster_sync.py new file mode 100644 index 000000000..fc8c891fd --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_cluster_sync.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateCluster +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateCluster_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_create_cluster(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.CreateClusterRequest( + parent="parent_value", + cluster_id="cluster_id_value", + ) + + # Make the request + operation = client.create_cluster(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateCluster_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_instance_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_instance_async.py new file mode 100644 index 000000000..0167838ed --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_instance_async.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateInstance +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateInstance_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_create_instance(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + instance = admin_v2.Instance() + instance.display_name = "display_name_value" + + request = admin_v2.CreateInstanceRequest( + parent="parent_value", + instance_id="instance_id_value", + instance=instance, + ) + + # Make the request + operation = client.create_instance(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateInstance_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_instance_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_instance_sync.py new file mode 100644 index 000000000..b728472fb --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_instance_sync.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateInstance +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateInstance_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_create_instance(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + instance = admin_v2.Instance() + instance.display_name = "display_name_value" + + request = admin_v2.CreateInstanceRequest( + parent="parent_value", + instance_id="instance_id_value", + instance=instance, + ) + + # Make the request + operation = client.create_instance(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateInstance_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_logical_view_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_logical_view_async.py new file mode 100644 index 000000000..3cfdd0936 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_logical_view_async.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateLogicalView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateLogicalView_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_create_logical_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + logical_view = admin_v2.LogicalView() + logical_view.query = "query_value" + + request = admin_v2.CreateLogicalViewRequest( + parent="parent_value", + logical_view_id="logical_view_id_value", + logical_view=logical_view, + ) + + # Make the request + operation = client.create_logical_view(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateLogicalView_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_logical_view_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_logical_view_sync.py new file mode 100644 index 000000000..eb48ea795 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_logical_view_sync.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateLogicalView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateLogicalView_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_create_logical_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + logical_view = admin_v2.LogicalView() + logical_view.query = "query_value" + + request = admin_v2.CreateLogicalViewRequest( + parent="parent_value", + logical_view_id="logical_view_id_value", + logical_view=logical_view, + ) + + # Make the request + operation = client.create_logical_view(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateLogicalView_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_materialized_view_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_materialized_view_async.py new file mode 100644 index 000000000..e3064acce --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_materialized_view_async.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateMaterializedView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateMaterializedView_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_create_materialized_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + materialized_view = admin_v2.MaterializedView() + materialized_view.query = "query_value" + + request = admin_v2.CreateMaterializedViewRequest( + parent="parent_value", + materialized_view_id="materialized_view_id_value", + materialized_view=materialized_view, + ) + + # Make the request + operation = client.create_materialized_view(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateMaterializedView_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_materialized_view_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_materialized_view_sync.py new file mode 100644 index 000000000..63ea9c7df --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_create_materialized_view_sync.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateMaterializedView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateMaterializedView_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_create_materialized_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + materialized_view = admin_v2.MaterializedView() + materialized_view.query = "query_value" + + request = admin_v2.CreateMaterializedViewRequest( + parent="parent_value", + materialized_view_id="materialized_view_id_value", + materialized_view=materialized_view, + ) + + # Make the request + operation = client.create_materialized_view(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateMaterializedView_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_app_profile_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_app_profile_async.py new file mode 100644 index 000000000..610faf6f5 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_app_profile_async.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteAppProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteAppProfile_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_delete_app_profile(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.DeleteAppProfileRequest( + name="name_value", + ignore_warnings=True, + ) + + # Make the request + await client.delete_app_profile(request=request) + + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteAppProfile_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_app_profile_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_app_profile_sync.py new file mode 100644 index 000000000..aedfdeacd --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_app_profile_sync.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteAppProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteAppProfile_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_delete_app_profile(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.DeleteAppProfileRequest( + name="name_value", + ignore_warnings=True, + ) + + # Make the request + client.delete_app_profile(request=request) + + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteAppProfile_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_cluster_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_cluster_async.py new file mode 100644 index 000000000..906509671 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_cluster_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteCluster +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteCluster_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_delete_cluster(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.DeleteClusterRequest( + name="name_value", + ) + + # Make the request + await client.delete_cluster(request=request) + + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteCluster_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_cluster_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_cluster_sync.py new file mode 100644 index 000000000..4e2d3047d --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_cluster_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteCluster +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteCluster_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_delete_cluster(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.DeleteClusterRequest( + name="name_value", + ) + + # Make the request + client.delete_cluster(request=request) + + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteCluster_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_instance_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_instance_async.py new file mode 100644 index 000000000..6a67de539 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_instance_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteInstance +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteInstance_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_delete_instance(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.DeleteInstanceRequest( + name="name_value", + ) + + # Make the request + await client.delete_instance(request=request) + + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteInstance_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_instance_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_instance_sync.py new file mode 100644 index 000000000..05487daba --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_instance_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteInstance +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteInstance_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_delete_instance(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.DeleteInstanceRequest( + name="name_value", + ) + + # Make the request + client.delete_instance(request=request) + + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteInstance_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_logical_view_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_logical_view_async.py new file mode 100644 index 000000000..03ef932ce --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_logical_view_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteLogicalView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteLogicalView_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_delete_logical_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.DeleteLogicalViewRequest( + name="name_value", + ) + + # Make the request + await client.delete_logical_view(request=request) + + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteLogicalView_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_logical_view_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_logical_view_sync.py new file mode 100644 index 000000000..375f15afc --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_logical_view_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteLogicalView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteLogicalView_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_delete_logical_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.DeleteLogicalViewRequest( + name="name_value", + ) + + # Make the request + client.delete_logical_view(request=request) + + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteLogicalView_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_materialized_view_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_materialized_view_async.py new file mode 100644 index 000000000..28ef3552e --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_materialized_view_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteMaterializedView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteMaterializedView_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_delete_materialized_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.DeleteMaterializedViewRequest( + name="name_value", + ) + + # Make the request + await client.delete_materialized_view(request=request) + + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteMaterializedView_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_materialized_view_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_materialized_view_sync.py new file mode 100644 index 000000000..422d17e39 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_delete_materialized_view_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteMaterializedView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteMaterializedView_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_delete_materialized_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.DeleteMaterializedViewRequest( + name="name_value", + ) + + # Make the request + client.delete_materialized_view(request=request) + + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteMaterializedView_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_app_profile_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_app_profile_async.py new file mode 100644 index 000000000..54a0f10e6 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_app_profile_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetAppProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetAppProfile_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_get_app_profile(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.GetAppProfileRequest( + name="name_value", + ) + + # Make the request + response = await client.get_app_profile(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetAppProfile_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_app_profile_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_app_profile_sync.py new file mode 100644 index 000000000..b7944037a --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_app_profile_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetAppProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetAppProfile_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_get_app_profile(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.GetAppProfileRequest( + name="name_value", + ) + + # Make the request + response = client.get_app_profile(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetAppProfile_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_cluster_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_cluster_async.py new file mode 100644 index 000000000..de73b8847 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_cluster_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetCluster +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetCluster_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_get_cluster(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.GetClusterRequest( + name="name_value", + ) + + # Make the request + response = await client.get_cluster(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetCluster_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_cluster_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_cluster_sync.py new file mode 100644 index 000000000..839cfcc19 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_cluster_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetCluster +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetCluster_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_get_cluster(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.GetClusterRequest( + name="name_value", + ) + + # Make the request + response = client.get_cluster(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetCluster_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_iam_policy_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_iam_policy_async.py new file mode 100644 index 000000000..d420d3ade --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_iam_policy_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetIamPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetIamPolicy_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 +from google.iam.v1 import iam_policy_pb2 # type: ignore + + +async def sample_get_iam_policy(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = iam_policy_pb2.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = await client.get_iam_policy(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetIamPolicy_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_iam_policy_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_iam_policy_sync.py new file mode 100644 index 000000000..20efa1c89 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_iam_policy_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetIamPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetIamPolicy_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 +from google.iam.v1 import iam_policy_pb2 # type: ignore + + +def sample_get_iam_policy(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = iam_policy_pb2.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetIamPolicy_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_instance_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_instance_async.py new file mode 100644 index 000000000..446650437 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_instance_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetInstance +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetInstance_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_get_instance(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.GetInstanceRequest( + name="name_value", + ) + + # Make the request + response = await client.get_instance(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetInstance_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_instance_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_instance_sync.py new file mode 100644 index 000000000..58ce6c962 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_instance_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetInstance +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetInstance_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_get_instance(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.GetInstanceRequest( + name="name_value", + ) + + # Make the request + response = client.get_instance(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetInstance_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_logical_view_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_logical_view_async.py new file mode 100644 index 000000000..2499eda9e --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_logical_view_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetLogicalView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetLogicalView_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_get_logical_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.GetLogicalViewRequest( + name="name_value", + ) + + # Make the request + response = await client.get_logical_view(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetLogicalView_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_logical_view_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_logical_view_sync.py new file mode 100644 index 000000000..c74afc51e --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_logical_view_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetLogicalView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetLogicalView_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_get_logical_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.GetLogicalViewRequest( + name="name_value", + ) + + # Make the request + response = client.get_logical_view(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetLogicalView_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_materialized_view_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_materialized_view_async.py new file mode 100644 index 000000000..bb952417e --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_materialized_view_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetMaterializedView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetMaterializedView_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_get_materialized_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.GetMaterializedViewRequest( + name="name_value", + ) + + # Make the request + response = await client.get_materialized_view(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetMaterializedView_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_materialized_view_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_materialized_view_sync.py new file mode 100644 index 000000000..62a28c4b8 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_get_materialized_view_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetMaterializedView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_GetMaterializedView_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_get_materialized_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.GetMaterializedViewRequest( + name="name_value", + ) + + # Make the request + response = client.get_materialized_view(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_GetMaterializedView_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_app_profiles_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_app_profiles_async.py new file mode 100644 index 000000000..9e6f5a2b4 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_app_profiles_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListAppProfiles +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListAppProfiles_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_list_app_profiles(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ListAppProfilesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_app_profiles(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListAppProfiles_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_app_profiles_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_app_profiles_sync.py new file mode 100644 index 000000000..f740f67dc --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_app_profiles_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListAppProfiles +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListAppProfiles_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_list_app_profiles(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.ListAppProfilesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_app_profiles(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListAppProfiles_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_clusters_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_clusters_async.py new file mode 100644 index 000000000..2d2bf03db --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_clusters_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListClusters +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListClusters_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_list_clusters(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ListClustersRequest( + parent="parent_value", + ) + + # Make the request + response = await client.list_clusters(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListClusters_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_clusters_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_clusters_sync.py new file mode 100644 index 000000000..c0210c888 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_clusters_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListClusters +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListClusters_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_list_clusters(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.ListClustersRequest( + parent="parent_value", + ) + + # Make the request + response = client.list_clusters(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListClusters_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_hot_tablets_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_hot_tablets_async.py new file mode 100644 index 000000000..429d723d1 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_hot_tablets_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListHotTablets +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListHotTablets_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_list_hot_tablets(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ListHotTabletsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_hot_tablets(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListHotTablets_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_hot_tablets_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_hot_tablets_sync.py new file mode 100644 index 000000000..c91acac7e --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_hot_tablets_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListHotTablets +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListHotTablets_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_list_hot_tablets(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.ListHotTabletsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_hot_tablets(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListHotTablets_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_instances_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_instances_async.py new file mode 100644 index 000000000..ed2cedfbc --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_instances_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListInstances +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListInstances_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_list_instances(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ListInstancesRequest( + parent="parent_value", + ) + + # Make the request + response = await client.list_instances(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListInstances_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_instances_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_instances_sync.py new file mode 100644 index 000000000..b8831129b --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_instances_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListInstances +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListInstances_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_list_instances(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.ListInstancesRequest( + parent="parent_value", + ) + + # Make the request + response = client.list_instances(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListInstances_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_logical_views_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_logical_views_async.py new file mode 100644 index 000000000..8c28f0804 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_logical_views_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListLogicalViews +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListLogicalViews_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_list_logical_views(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ListLogicalViewsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_logical_views(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListLogicalViews_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_logical_views_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_logical_views_sync.py new file mode 100644 index 000000000..ac3169663 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_logical_views_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListLogicalViews +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListLogicalViews_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_list_logical_views(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.ListLogicalViewsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_logical_views(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListLogicalViews_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_materialized_views_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_materialized_views_async.py new file mode 100644 index 000000000..808c3df97 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_materialized_views_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListMaterializedViews +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListMaterializedViews_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_list_materialized_views(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ListMaterializedViewsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_materialized_views(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListMaterializedViews_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_materialized_views_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_materialized_views_sync.py new file mode 100644 index 000000000..336487731 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_list_materialized_views_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListMaterializedViews +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_ListMaterializedViews_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_list_materialized_views(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.ListMaterializedViewsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_materialized_views(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_ListMaterializedViews_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_partial_update_cluster_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_partial_update_cluster_async.py new file mode 100644 index 000000000..4c08a7e53 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_partial_update_cluster_async.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PartialUpdateCluster +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateCluster_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_partial_update_cluster(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.PartialUpdateClusterRequest( + ) + + # Make the request + operation = client.partial_update_cluster(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateCluster_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_partial_update_cluster_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_partial_update_cluster_sync.py new file mode 100644 index 000000000..d34f3efb8 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_partial_update_cluster_sync.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PartialUpdateCluster +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateCluster_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_partial_update_cluster(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.PartialUpdateClusterRequest( + ) + + # Make the request + operation = client.partial_update_cluster(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateCluster_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_partial_update_instance_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_partial_update_instance_async.py new file mode 100644 index 000000000..c37dd603d --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_partial_update_instance_async.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PartialUpdateInstance +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateInstance_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_partial_update_instance(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + instance = admin_v2.Instance() + instance.display_name = "display_name_value" + + request = admin_v2.PartialUpdateInstanceRequest( + instance=instance, + ) + + # Make the request + operation = client.partial_update_instance(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateInstance_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_partial_update_instance_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_partial_update_instance_sync.py new file mode 100644 index 000000000..433f57ae2 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_partial_update_instance_sync.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for PartialUpdateInstance +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateInstance_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_partial_update_instance(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + instance = admin_v2.Instance() + instance.display_name = "display_name_value" + + request = admin_v2.PartialUpdateInstanceRequest( + instance=instance, + ) + + # Make the request + operation = client.partial_update_instance(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateInstance_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_set_iam_policy_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_set_iam_policy_async.py new file mode 100644 index 000000000..ba0f07c96 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_set_iam_policy_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SetIamPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_SetIamPolicy_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 +from google.iam.v1 import iam_policy_pb2 # type: ignore + + +async def sample_set_iam_policy(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = iam_policy_pb2.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = await client.set_iam_policy(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_SetIamPolicy_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_set_iam_policy_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_set_iam_policy_sync.py new file mode 100644 index 000000000..014fcc9d6 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_set_iam_policy_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SetIamPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_SetIamPolicy_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 +from google.iam.v1 import iam_policy_pb2 # type: ignore + + +def sample_set_iam_policy(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = iam_policy_pb2.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_SetIamPolicy_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_test_iam_permissions_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_test_iam_permissions_async.py new file mode 100644 index 000000000..32773eef1 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_test_iam_permissions_async.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TestIamPermissions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_TestIamPermissions_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 +from google.iam.v1 import iam_policy_pb2 # type: ignore + + +async def sample_test_iam_permissions(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = iam_policy_pb2.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value1', 'permissions_value2'], + ) + + # Make the request + response = await client.test_iam_permissions(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_TestIamPermissions_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_test_iam_permissions_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_test_iam_permissions_sync.py new file mode 100644 index 000000000..27d4c1b35 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_test_iam_permissions_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TestIamPermissions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_TestIamPermissions_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 +from google.iam.v1 import iam_policy_pb2 # type: ignore + + +def sample_test_iam_permissions(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = iam_policy_pb2.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value1', 'permissions_value2'], + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_TestIamPermissions_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_app_profile_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_app_profile_async.py new file mode 100644 index 000000000..ab8c63e7f --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_app_profile_async.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateAppProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateAppProfile_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_update_app_profile(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + app_profile = admin_v2.AppProfile() + app_profile.priority = "PRIORITY_HIGH" + + request = admin_v2.UpdateAppProfileRequest( + app_profile=app_profile, + ) + + # Make the request + operation = client.update_app_profile(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateAppProfile_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_app_profile_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_app_profile_sync.py new file mode 100644 index 000000000..2d8da36e3 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_app_profile_sync.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateAppProfile +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateAppProfile_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_update_app_profile(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + app_profile = admin_v2.AppProfile() + app_profile.priority = "PRIORITY_HIGH" + + request = admin_v2.UpdateAppProfileRequest( + app_profile=app_profile, + ) + + # Make the request + operation = client.update_app_profile(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateAppProfile_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_cluster_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_cluster_async.py new file mode 100644 index 000000000..06d220b70 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_cluster_async.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateCluster +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_update_cluster(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.Cluster( + ) + + # Make the request + operation = client.update_cluster(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_cluster_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_cluster_sync.py new file mode 100644 index 000000000..f136dde9b --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_cluster_sync.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateCluster +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_update_cluster(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.Cluster( + ) + + # Make the request + operation = client.update_cluster(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_instance_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_instance_async.py new file mode 100644 index 000000000..bc4f564c9 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_instance_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateInstance +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateInstance_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_update_instance(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.Instance( + display_name="display_name_value", + ) + + # Make the request + response = await client.update_instance(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateInstance_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_instance_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_instance_sync.py new file mode 100644 index 000000000..1a014bb82 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_instance_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateInstance +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateInstance_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_update_instance(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + request = admin_v2.Instance( + display_name="display_name_value", + ) + + # Make the request + response = client.update_instance(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateInstance_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_logical_view_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_logical_view_async.py new file mode 100644 index 000000000..05beabb9b --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_logical_view_async.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateLogicalView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateLogicalView_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_update_logical_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + logical_view = admin_v2.LogicalView() + logical_view.query = "query_value" + + request = admin_v2.UpdateLogicalViewRequest( + logical_view=logical_view, + ) + + # Make the request + operation = client.update_logical_view(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateLogicalView_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_logical_view_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_logical_view_sync.py new file mode 100644 index 000000000..e6e83eabb --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_logical_view_sync.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateLogicalView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateLogicalView_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_update_logical_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + logical_view = admin_v2.LogicalView() + logical_view.query = "query_value" + + request = admin_v2.UpdateLogicalViewRequest( + logical_view=logical_view, + ) + + # Make the request + operation = client.update_logical_view(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateLogicalView_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_materialized_view_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_materialized_view_async.py new file mode 100644 index 000000000..5d1b36b7b --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_materialized_view_async.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateMaterializedView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateMaterializedView_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_update_materialized_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminAsyncClient() + + # Initialize request argument(s) + materialized_view = admin_v2.MaterializedView() + materialized_view.query = "query_value" + + request = admin_v2.UpdateMaterializedViewRequest( + materialized_view=materialized_view, + ) + + # Make the request + operation = client.update_materialized_view(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateMaterializedView_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_materialized_view_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_materialized_view_sync.py new file mode 100644 index 000000000..63c4bb64f --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_instance_admin_update_materialized_view_sync.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateMaterializedView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateMaterializedView_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_update_materialized_view(): + # Create a client + client = admin_v2.BigtableInstanceAdminClient() + + # Initialize request argument(s) + materialized_view = admin_v2.MaterializedView() + materialized_view.query = "query_value" + + request = admin_v2.UpdateMaterializedViewRequest( + materialized_view=materialized_view, + ) + + # Make the request + operation = client.update_materialized_view(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateMaterializedView_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_check_consistency_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_check_consistency_async.py new file mode 100644 index 000000000..8a5d6a984 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_check_consistency_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CheckConsistency +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_check_consistency(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.CheckConsistencyRequest( + name="name_value", + consistency_token="consistency_token_value", + ) + + # Make the request + response = await client.check_consistency(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_check_consistency_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_check_consistency_sync.py new file mode 100644 index 000000000..887eb0705 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_check_consistency_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CheckConsistency +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_check_consistency(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.CheckConsistencyRequest( + name="name_value", + consistency_token="consistency_token_value", + ) + + # Make the request + response = client.check_consistency(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_copy_backup_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_copy_backup_async.py new file mode 100644 index 000000000..d8dbbef74 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_copy_backup_async.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CopyBackup +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_CopyBackup_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_copy_backup(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.CopyBackupRequest( + parent="parent_value", + backup_id="backup_id_value", + source_backup="source_backup_value", + ) + + # Make the request + operation = client.copy_backup(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_CopyBackup_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_copy_backup_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_copy_backup_sync.py new file mode 100644 index 000000000..39e4701d8 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_copy_backup_sync.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CopyBackup +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_CopyBackup_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_copy_backup(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.CopyBackupRequest( + parent="parent_value", + backup_id="backup_id_value", + source_backup="source_backup_value", + ) + + # Make the request + operation = client.copy_backup(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_CopyBackup_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_authorized_view_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_authorized_view_async.py new file mode 100644 index 000000000..8b632a1ca --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_authorized_view_async.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateAuthorizedView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_CreateAuthorizedView_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_create_authorized_view(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.CreateAuthorizedViewRequest( + parent="parent_value", + authorized_view_id="authorized_view_id_value", + ) + + # Make the request + operation = client.create_authorized_view(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateAuthorizedView_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_authorized_view_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_authorized_view_sync.py new file mode 100644 index 000000000..301a0232a --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_authorized_view_sync.py @@ -0,0 +1,57 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateAuthorizedView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_CreateAuthorizedView_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_create_authorized_view(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.CreateAuthorizedViewRequest( + parent="parent_value", + authorized_view_id="authorized_view_id_value", + ) + + # Make the request + operation = client.create_authorized_view(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateAuthorizedView_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_backup_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_backup_async.py new file mode 100644 index 000000000..84d7ebcf6 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_backup_async.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateBackup +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_CreateBackup_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_create_backup(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + backup = admin_v2.Backup() + backup.source_table = "source_table_value" + + request = admin_v2.CreateBackupRequest( + parent="parent_value", + backup_id="backup_id_value", + backup=backup, + ) + + # Make the request + operation = client.create_backup(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateBackup_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_backup_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_backup_sync.py new file mode 100644 index 000000000..ed83c6248 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_backup_sync.py @@ -0,0 +1,61 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateBackup +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_CreateBackup_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_create_backup(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + backup = admin_v2.Backup() + backup.source_table = "source_table_value" + + request = admin_v2.CreateBackupRequest( + parent="parent_value", + backup_id="backup_id_value", + backup=backup, + ) + + # Make the request + operation = client.create_backup(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateBackup_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_table_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_table_async.py new file mode 100644 index 000000000..01fdbd7e7 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_table_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateTable +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_CreateTable_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_create_table(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.CreateTableRequest( + parent="parent_value", + table_id="table_id_value", + ) + + # Make the request + response = await client.create_table(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateTable_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_table_from_snapshot_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_table_from_snapshot_async.py new file mode 100644 index 000000000..2d961b900 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_table_from_snapshot_async.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateTableFromSnapshot +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_CreateTableFromSnapshot_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_create_table_from_snapshot(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.CreateTableFromSnapshotRequest( + parent="parent_value", + table_id="table_id_value", + source_snapshot="source_snapshot_value", + ) + + # Make the request + operation = client.create_table_from_snapshot(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateTableFromSnapshot_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_table_from_snapshot_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_table_from_snapshot_sync.py new file mode 100644 index 000000000..d19c11811 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_table_from_snapshot_sync.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateTableFromSnapshot +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_CreateTableFromSnapshot_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_create_table_from_snapshot(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.CreateTableFromSnapshotRequest( + parent="parent_value", + table_id="table_id_value", + source_snapshot="source_snapshot_value", + ) + + # Make the request + operation = client.create_table_from_snapshot(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateTableFromSnapshot_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_table_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_table_sync.py new file mode 100644 index 000000000..97aaf4179 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_create_table_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for CreateTable +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_CreateTable_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_create_table(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.CreateTableRequest( + parent="parent_value", + table_id="table_id_value", + ) + + # Make the request + response = client.create_table(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_CreateTable_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_authorized_view_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_authorized_view_async.py new file mode 100644 index 000000000..e6d0cb2ae --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_authorized_view_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteAuthorizedView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_DeleteAuthorizedView_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_delete_authorized_view(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.DeleteAuthorizedViewRequest( + name="name_value", + ) + + # Make the request + await client.delete_authorized_view(request=request) + + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteAuthorizedView_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_authorized_view_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_authorized_view_sync.py new file mode 100644 index 000000000..d4ad2f571 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_authorized_view_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteAuthorizedView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_DeleteAuthorizedView_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_delete_authorized_view(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.DeleteAuthorizedViewRequest( + name="name_value", + ) + + # Make the request + client.delete_authorized_view(request=request) + + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteAuthorizedView_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_backup_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_backup_async.py new file mode 100644 index 000000000..5e1952fdf --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_backup_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteBackup +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_DeleteBackup_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_delete_backup(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.DeleteBackupRequest( + name="name_value", + ) + + # Make the request + await client.delete_backup(request=request) + + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteBackup_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_backup_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_backup_sync.py new file mode 100644 index 000000000..6426c9248 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_backup_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteBackup +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_DeleteBackup_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_delete_backup(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.DeleteBackupRequest( + name="name_value", + ) + + # Make the request + client.delete_backup(request=request) + + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteBackup_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_snapshot_async_internal.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_snapshot_async_internal.py new file mode 100644 index 000000000..2a9effc87 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_snapshot_async_internal.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteSnapshot +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSnapshot_async_internal] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_delete_snapshot(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.DeleteSnapshotRequest( + name="name_value", + ) + + # Make the request + await client._delete_snapshot(request=request) + + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSnapshot_async_internal] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_snapshot_sync_internal.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_snapshot_sync_internal.py new file mode 100644 index 000000000..bb9182e43 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_snapshot_sync_internal.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteSnapshot +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSnapshot_sync_internal] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_delete_snapshot(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.DeleteSnapshotRequest( + name="name_value", + ) + + # Make the request + client._delete_snapshot(request=request) + + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSnapshot_sync_internal] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_table_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_table_async.py new file mode 100644 index 000000000..ba4f00c75 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_table_async.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteTable +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_DeleteTable_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_delete_table(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.DeleteTableRequest( + name="name_value", + ) + + # Make the request + await client.delete_table(request=request) + + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteTable_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_table_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_table_sync.py new file mode 100644 index 000000000..fd644a496 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_delete_table_sync.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DeleteTable +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_DeleteTable_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_delete_table(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.DeleteTableRequest( + name="name_value", + ) + + # Make the request + client.delete_table(request=request) + + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_DeleteTable_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_drop_row_range_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_drop_row_range_async.py new file mode 100644 index 000000000..c1c4b1288 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_drop_row_range_async.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DropRowRange +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_DropRowRange_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_drop_row_range(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.DropRowRangeRequest( + row_key_prefix=b'row_key_prefix_blob', + name="name_value", + ) + + # Make the request + await client.drop_row_range(request=request) + + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_DropRowRange_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_drop_row_range_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_drop_row_range_sync.py new file mode 100644 index 000000000..47aa42590 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_drop_row_range_sync.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for DropRowRange +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_DropRowRange_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_drop_row_range(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.DropRowRangeRequest( + row_key_prefix=b'row_key_prefix_blob', + name="name_value", + ) + + # Make the request + client.drop_row_range(request=request) + + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_DropRowRange_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_generate_consistency_token_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_generate_consistency_token_async.py new file mode 100644 index 000000000..30551723b --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_generate_consistency_token_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GenerateConsistencyToken +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_GenerateConsistencyToken_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_generate_consistency_token(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.GenerateConsistencyTokenRequest( + name="name_value", + ) + + # Make the request + response = await client.generate_consistency_token(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_GenerateConsistencyToken_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_generate_consistency_token_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_generate_consistency_token_sync.py new file mode 100644 index 000000000..87029cbf8 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_generate_consistency_token_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GenerateConsistencyToken +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_GenerateConsistencyToken_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_generate_consistency_token(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.GenerateConsistencyTokenRequest( + name="name_value", + ) + + # Make the request + response = client.generate_consistency_token(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_GenerateConsistencyToken_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_authorized_view_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_authorized_view_async.py new file mode 100644 index 000000000..a1adeb95c --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_authorized_view_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetAuthorizedView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_GetAuthorizedView_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_get_authorized_view(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.GetAuthorizedViewRequest( + name="name_value", + ) + + # Make the request + response = await client.get_authorized_view(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_GetAuthorizedView_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_authorized_view_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_authorized_view_sync.py new file mode 100644 index 000000000..bcc602987 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_authorized_view_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetAuthorizedView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_GetAuthorizedView_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_get_authorized_view(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.GetAuthorizedViewRequest( + name="name_value", + ) + + # Make the request + response = client.get_authorized_view(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_GetAuthorizedView_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_backup_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_backup_async.py new file mode 100644 index 000000000..25edad609 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_backup_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetBackup +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_GetBackup_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_get_backup(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.GetBackupRequest( + name="name_value", + ) + + # Make the request + response = await client.get_backup(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_GetBackup_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_backup_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_backup_sync.py new file mode 100644 index 000000000..ab404f469 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_backup_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetBackup +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_GetBackup_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_get_backup(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.GetBackupRequest( + name="name_value", + ) + + # Make the request + response = client.get_backup(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_GetBackup_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_iam_policy_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_iam_policy_async.py new file mode 100644 index 000000000..e947fec4e --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_iam_policy_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetIamPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_GetIamPolicy_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 +from google.iam.v1 import iam_policy_pb2 # type: ignore + + +async def sample_get_iam_policy(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = iam_policy_pb2.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = await client.get_iam_policy(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_GetIamPolicy_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_iam_policy_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_iam_policy_sync.py new file mode 100644 index 000000000..600df5cf3 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_iam_policy_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetIamPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_GetIamPolicy_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 +from google.iam.v1 import iam_policy_pb2 # type: ignore + + +def sample_get_iam_policy(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = iam_policy_pb2.GetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.get_iam_policy(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_GetIamPolicy_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_snapshot_async_internal.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_snapshot_async_internal.py new file mode 100644 index 000000000..73e60f2ca --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_snapshot_async_internal.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetSnapshot +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_GetSnapshot_async_internal] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_get_snapshot(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.GetSnapshotRequest( + name="name_value", + ) + + # Make the request + response = await client._get_snapshot(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_GetSnapshot_async_internal] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_snapshot_sync_internal.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_snapshot_sync_internal.py new file mode 100644 index 000000000..71dc8082d --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_snapshot_sync_internal.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetSnapshot +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_GetSnapshot_sync_internal] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_get_snapshot(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.GetSnapshotRequest( + name="name_value", + ) + + # Make the request + response = client._get_snapshot(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_GetSnapshot_sync_internal] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_table_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_table_async.py new file mode 100644 index 000000000..ca8e8dcf2 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_table_async.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetTable +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_GetTable_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_get_table(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.GetTableRequest( + name="name_value", + ) + + # Make the request + response = await client.get_table(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_GetTable_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_table_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_table_sync.py new file mode 100644 index 000000000..4290ace56 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_get_table_sync.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for GetTable +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_GetTable_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_get_table(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.GetTableRequest( + name="name_value", + ) + + # Make the request + response = client.get_table(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_GetTable_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_authorized_views_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_authorized_views_async.py new file mode 100644 index 000000000..cf00011cd --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_authorized_views_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListAuthorizedViews +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_ListAuthorizedViews_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_list_authorized_views(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ListAuthorizedViewsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_authorized_views(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_ListAuthorizedViews_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_authorized_views_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_authorized_views_sync.py new file mode 100644 index 000000000..84155ebc7 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_authorized_views_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListAuthorizedViews +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_ListAuthorizedViews_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_list_authorized_views(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.ListAuthorizedViewsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_authorized_views(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_ListAuthorizedViews_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_backups_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_backups_async.py new file mode 100644 index 000000000..277090e32 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_backups_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListBackups +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_ListBackups_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_list_backups(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ListBackupsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_backups(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_ListBackups_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_backups_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_backups_sync.py new file mode 100644 index 000000000..748a30bde --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_backups_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListBackups +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_ListBackups_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_list_backups(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.ListBackupsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_backups(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_ListBackups_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_snapshots_async_internal.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_snapshots_async_internal.py new file mode 100644 index 000000000..185015327 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_snapshots_async_internal.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListSnapshots +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_ListSnapshots_async_internal] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_list_snapshots(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ListSnapshotsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client._list_snapshots(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_ListSnapshots_async_internal] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_snapshots_sync_internal.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_snapshots_sync_internal.py new file mode 100644 index 000000000..751112a88 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_snapshots_sync_internal.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListSnapshots +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_ListSnapshots_sync_internal] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_list_snapshots(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.ListSnapshotsRequest( + parent="parent_value", + ) + + # Make the request + page_result = client._list_snapshots(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_ListSnapshots_sync_internal] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_tables_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_tables_async.py new file mode 100644 index 000000000..66279c620 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_tables_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTables +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_ListTables_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_list_tables(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ListTablesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tables(request=request) + + # Handle the response + async for response in page_result: + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_ListTables_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_tables_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_tables_sync.py new file mode 100644 index 000000000..ede2435e6 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_list_tables_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ListTables +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_ListTables_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_list_tables(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.ListTablesRequest( + parent="parent_value", + ) + + # Make the request + page_result = client.list_tables(request=request) + + # Handle the response + for response in page_result: + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_ListTables_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_modify_column_families_async_internal.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_modify_column_families_async_internal.py new file mode 100644 index 000000000..9baf95ae3 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_modify_column_families_async_internal.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ModifyColumnFamilies +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_ModifyColumnFamilies_async_internal] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_modify_column_families(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.ModifyColumnFamiliesRequest( + name="name_value", + ) + + # Make the request + response = await client._modify_column_families(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_ModifyColumnFamilies_async_internal] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_modify_column_families_sync_internal.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_modify_column_families_sync_internal.py new file mode 100644 index 000000000..72e81dff0 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_modify_column_families_sync_internal.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for ModifyColumnFamilies +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_ModifyColumnFamilies_sync_internal] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_modify_column_families(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.ModifyColumnFamiliesRequest( + name="name_value", + ) + + # Make the request + response = client._modify_column_families(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_ModifyColumnFamilies_sync_internal] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_restore_table_async_internal.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_restore_table_async_internal.py new file mode 100644 index 000000000..94424547d --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_restore_table_async_internal.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RestoreTable +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_async_internal] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_restore_table(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.RestoreTableRequest( + backup="backup_value", + parent="parent_value", + table_id="table_id_value", + ) + + # Make the request + operation = client._restore_table(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_async_internal] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_restore_table_sync_internal.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_restore_table_sync_internal.py new file mode 100644 index 000000000..3df90ebd0 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_restore_table_sync_internal.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for RestoreTable +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_sync_internal] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_restore_table(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.RestoreTableRequest( + backup="backup_value", + parent="parent_value", + table_id="table_id_value", + ) + + # Make the request + operation = client._restore_table(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_sync_internal] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_set_iam_policy_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_set_iam_policy_async.py new file mode 100644 index 000000000..2920dfb45 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_set_iam_policy_async.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SetIamPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_SetIamPolicy_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 +from google.iam.v1 import iam_policy_pb2 # type: ignore + + +async def sample_set_iam_policy(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = iam_policy_pb2.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = await client.set_iam_policy(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_SetIamPolicy_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_set_iam_policy_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_set_iam_policy_sync.py new file mode 100644 index 000000000..97d38d723 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_set_iam_policy_sync.py @@ -0,0 +1,53 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SetIamPolicy +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_SetIamPolicy_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 +from google.iam.v1 import iam_policy_pb2 # type: ignore + + +def sample_set_iam_policy(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = iam_policy_pb2.SetIamPolicyRequest( + resource="resource_value", + ) + + # Make the request + response = client.set_iam_policy(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_SetIamPolicy_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_snapshot_table_async_internal.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_snapshot_table_async_internal.py new file mode 100644 index 000000000..d2294ebc9 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_snapshot_table_async_internal.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SnapshotTable +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_SnapshotTable_async_internal] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_snapshot_table(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.SnapshotTableRequest( + name="name_value", + cluster="cluster_value", + snapshot_id="snapshot_id_value", + ) + + # Make the request + operation = client._snapshot_table(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_SnapshotTable_async_internal] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_snapshot_table_sync_internal.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_snapshot_table_sync_internal.py new file mode 100644 index 000000000..670e2d4a3 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_snapshot_table_sync_internal.py @@ -0,0 +1,58 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for SnapshotTable +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_SnapshotTable_sync_internal] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_snapshot_table(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.SnapshotTableRequest( + name="name_value", + cluster="cluster_value", + snapshot_id="snapshot_id_value", + ) + + # Make the request + operation = client._snapshot_table(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_SnapshotTable_sync_internal] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_test_iam_permissions_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_test_iam_permissions_async.py new file mode 100644 index 000000000..3b6d093ad --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_test_iam_permissions_async.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TestIamPermissions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_TestIamPermissions_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 +from google.iam.v1 import iam_policy_pb2 # type: ignore + + +async def sample_test_iam_permissions(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = iam_policy_pb2.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value1', 'permissions_value2'], + ) + + # Make the request + response = await client.test_iam_permissions(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_TestIamPermissions_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_test_iam_permissions_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_test_iam_permissions_sync.py new file mode 100644 index 000000000..0b12ef63d --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_test_iam_permissions_sync.py @@ -0,0 +1,54 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for TestIamPermissions +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_TestIamPermissions_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 +from google.iam.v1 import iam_policy_pb2 # type: ignore + + +def sample_test_iam_permissions(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = iam_policy_pb2.TestIamPermissionsRequest( + resource="resource_value", + permissions=['permissions_value1', 'permissions_value2'], + ) + + # Make the request + response = client.test_iam_permissions(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_TestIamPermissions_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_undelete_table_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_undelete_table_async.py new file mode 100644 index 000000000..242e598ea --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_undelete_table_async.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UndeleteTable +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_UndeleteTable_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_undelete_table(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.UndeleteTableRequest( + name="name_value", + ) + + # Make the request + operation = client.undelete_table(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_UndeleteTable_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_undelete_table_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_undelete_table_sync.py new file mode 100644 index 000000000..08e69142f --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_undelete_table_sync.py @@ -0,0 +1,56 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UndeleteTable +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_UndeleteTable_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_undelete_table(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.UndeleteTableRequest( + name="name_value", + ) + + # Make the request + operation = client.undelete_table(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_UndeleteTable_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_update_authorized_view_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_update_authorized_view_async.py new file mode 100644 index 000000000..15d983359 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_update_authorized_view_async.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateAuthorizedView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_UpdateAuthorizedView_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_update_authorized_view(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.UpdateAuthorizedViewRequest( + ) + + # Make the request + operation = client.update_authorized_view(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_UpdateAuthorizedView_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_update_authorized_view_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_update_authorized_view_sync.py new file mode 100644 index 000000000..247d5ee47 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_update_authorized_view_sync.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateAuthorizedView +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_UpdateAuthorizedView_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_update_authorized_view(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.UpdateAuthorizedViewRequest( + ) + + # Make the request + operation = client.update_authorized_view(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_UpdateAuthorizedView_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_update_backup_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_update_backup_async.py new file mode 100644 index 000000000..1a7e51e93 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_update_backup_async.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateBackup +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_UpdateBackup_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_update_backup(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + backup = admin_v2.Backup() + backup.source_table = "source_table_value" + + request = admin_v2.UpdateBackupRequest( + backup=backup, + ) + + # Make the request + response = await client.update_backup(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_UpdateBackup_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_update_backup_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_update_backup_sync.py new file mode 100644 index 000000000..bdbafc9f9 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_update_backup_sync.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateBackup +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_UpdateBackup_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_update_backup(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + backup = admin_v2.Backup() + backup.source_table = "source_table_value" + + request = admin_v2.UpdateBackupRequest( + backup=backup, + ) + + # Make the request + response = client.update_backup(request=request) + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_UpdateBackup_sync] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_update_table_async.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_update_table_async.py new file mode 100644 index 000000000..27cd8789b --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_update_table_async.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateTable +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_UpdateTable_async] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +async def sample_update_table(): + # Create a client + client = admin_v2.BigtableTableAdminAsyncClient() + + # Initialize request argument(s) + request = admin_v2.UpdateTableRequest( + ) + + # Make the request + operation = client.update_table(request=request) + + print("Waiting for operation to complete...") + + response = (await operation).result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_UpdateTable_async] diff --git a/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_update_table_sync.py b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_update_table_sync.py new file mode 100644 index 000000000..f8c743b71 --- /dev/null +++ b/samples/generated_samples/bigtableadmin_v2_generated_bigtable_table_admin_update_table_sync.py @@ -0,0 +1,55 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Generated code. DO NOT EDIT! +# +# Snippet for UpdateTable +# NOTE: This snippet has been automatically generated for illustrative purposes only. +# It may require modifications to work in your environment. + +# To install the latest published package dependency, execute the following: +# python3 -m pip install google-cloud-bigtable-admin + + +# [START bigtableadmin_v2_generated_BigtableTableAdmin_UpdateTable_sync] +# This snippet has been automatically generated and should be regarded as a +# code template only. +# It will require modifications to work: +# - It may require correct/in-range values for request initialization. +# - It may require specifying regional endpoints when creating the service +# client as shown in: +# https://googleapis.dev/python/google-api-core/latest/client_options.html +from google.cloud.bigtable import admin_v2 + + +def sample_update_table(): + # Create a client + client = admin_v2.BigtableTableAdminClient() + + # Initialize request argument(s) + request = admin_v2.UpdateTableRequest( + ) + + # Make the request + operation = client.update_table(request=request) + + print("Waiting for operation to complete...") + + response = operation.result() + + # Handle the response + print(response) + +# [END bigtableadmin_v2_generated_BigtableTableAdmin_UpdateTable_sync] diff --git a/samples/generated_samples/snippet_metadata_google.bigtable.admin.v2.json b/samples/generated_samples/snippet_metadata_google.bigtable.admin.v2.json new file mode 100644 index 000000000..1768074fe --- /dev/null +++ b/samples/generated_samples/snippet_metadata_google.bigtable.admin.v2.json @@ -0,0 +1,10048 @@ +{ + "clientLibrary": { + "apis": [ + { + "id": "google.bigtable.admin.v2", + "version": "v2" + } + ], + "language": "PYTHON", + "name": "google-cloud-bigtable-admin", + "version": "0.1.0" + }, + "snippets": [ + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.create_app_profile", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateAppProfile", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "CreateAppProfile" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CreateAppProfileRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "app_profile_id", + "type": "str" + }, + { + "name": "app_profile", + "type": "google.cloud.bigtable.admin_v2.types.AppProfile" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.AppProfile", + "shortName": "create_app_profile" + }, + "description": "Sample for CreateAppProfile", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_create_app_profile_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateAppProfile_async", + "segments": [ + { + "end": 56, + "start": 27, + "type": "FULL" + }, + { + "end": 56, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 50, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 53, + "start": 51, + "type": "REQUEST_EXECUTION" + }, + { + "end": 57, + "start": 54, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_create_app_profile_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.create_app_profile", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateAppProfile", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "CreateAppProfile" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CreateAppProfileRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "app_profile_id", + "type": "str" + }, + { + "name": "app_profile", + "type": "google.cloud.bigtable.admin_v2.types.AppProfile" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.AppProfile", + "shortName": "create_app_profile" + }, + "description": "Sample for CreateAppProfile", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_create_app_profile_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateAppProfile_sync", + "segments": [ + { + "end": 56, + "start": 27, + "type": "FULL" + }, + { + "end": 56, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 50, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 53, + "start": 51, + "type": "REQUEST_EXECUTION" + }, + { + "end": 57, + "start": 54, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_create_app_profile_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.create_cluster", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateCluster", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "CreateCluster" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CreateClusterRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "cluster_id", + "type": "str" + }, + { + "name": "cluster", + "type": "google.cloud.bigtable.admin_v2.types.Cluster" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_cluster" + }, + "description": "Sample for CreateCluster", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_create_cluster_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateCluster_async", + "segments": [ + { + "end": 56, + "start": 27, + "type": "FULL" + }, + { + "end": 56, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 53, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 57, + "start": 54, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_create_cluster_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.create_cluster", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateCluster", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "CreateCluster" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CreateClusterRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "cluster_id", + "type": "str" + }, + { + "name": "cluster", + "type": "google.cloud.bigtable.admin_v2.types.Cluster" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_cluster" + }, + "description": "Sample for CreateCluster", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_create_cluster_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateCluster_sync", + "segments": [ + { + "end": 56, + "start": 27, + "type": "FULL" + }, + { + "end": 56, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 53, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 57, + "start": 54, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_create_cluster_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.create_instance", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateInstance", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "CreateInstance" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CreateInstanceRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "instance_id", + "type": "str" + }, + { + "name": "instance", + "type": "google.cloud.bigtable.admin_v2.types.Instance" + }, + { + "name": "clusters", + "type": "MutableMapping[str, google.cloud.bigtable.admin_v2.types.Cluster]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_instance" + }, + "description": "Sample for CreateInstance", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_create_instance_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateInstance_async", + "segments": [ + { + "end": 60, + "start": 27, + "type": "FULL" + }, + { + "end": 60, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 50, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 57, + "start": 51, + "type": "REQUEST_EXECUTION" + }, + { + "end": 61, + "start": 58, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_create_instance_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.create_instance", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateInstance", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "CreateInstance" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CreateInstanceRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "instance_id", + "type": "str" + }, + { + "name": "instance", + "type": "google.cloud.bigtable.admin_v2.types.Instance" + }, + { + "name": "clusters", + "type": "MutableMapping[str, google.cloud.bigtable.admin_v2.types.Cluster]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_instance" + }, + "description": "Sample for CreateInstance", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_create_instance_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateInstance_sync", + "segments": [ + { + "end": 60, + "start": 27, + "type": "FULL" + }, + { + "end": 60, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 50, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 57, + "start": 51, + "type": "REQUEST_EXECUTION" + }, + { + "end": 61, + "start": 58, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_create_instance_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.create_logical_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateLogicalView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "CreateLogicalView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CreateLogicalViewRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "logical_view", + "type": "google.cloud.bigtable.admin_v2.types.LogicalView" + }, + { + "name": "logical_view_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_logical_view" + }, + "description": "Sample for CreateLogicalView", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_create_logical_view_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateLogicalView_async", + "segments": [ + { + "end": 60, + "start": 27, + "type": "FULL" + }, + { + "end": 60, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 50, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 57, + "start": 51, + "type": "REQUEST_EXECUTION" + }, + { + "end": 61, + "start": 58, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_create_logical_view_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.create_logical_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateLogicalView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "CreateLogicalView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CreateLogicalViewRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "logical_view", + "type": "google.cloud.bigtable.admin_v2.types.LogicalView" + }, + { + "name": "logical_view_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_logical_view" + }, + "description": "Sample for CreateLogicalView", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_create_logical_view_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateLogicalView_sync", + "segments": [ + { + "end": 60, + "start": 27, + "type": "FULL" + }, + { + "end": 60, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 50, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 57, + "start": 51, + "type": "REQUEST_EXECUTION" + }, + { + "end": 61, + "start": 58, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_create_logical_view_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.create_materialized_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateMaterializedView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "CreateMaterializedView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CreateMaterializedViewRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "materialized_view", + "type": "google.cloud.bigtable.admin_v2.types.MaterializedView" + }, + { + "name": "materialized_view_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_materialized_view" + }, + "description": "Sample for CreateMaterializedView", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_create_materialized_view_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateMaterializedView_async", + "segments": [ + { + "end": 60, + "start": 27, + "type": "FULL" + }, + { + "end": 60, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 50, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 57, + "start": 51, + "type": "REQUEST_EXECUTION" + }, + { + "end": 61, + "start": 58, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_create_materialized_view_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.create_materialized_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.CreateMaterializedView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "CreateMaterializedView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CreateMaterializedViewRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "materialized_view", + "type": "google.cloud.bigtable.admin_v2.types.MaterializedView" + }, + { + "name": "materialized_view_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_materialized_view" + }, + "description": "Sample for CreateMaterializedView", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_create_materialized_view_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_CreateMaterializedView_sync", + "segments": [ + { + "end": 60, + "start": 27, + "type": "FULL" + }, + { + "end": 60, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 50, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 57, + "start": 51, + "type": "REQUEST_EXECUTION" + }, + { + "end": 61, + "start": 58, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_create_materialized_view_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.delete_app_profile", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteAppProfile", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "DeleteAppProfile" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.DeleteAppProfileRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "ignore_warnings", + "type": "bool" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "shortName": "delete_app_profile" + }, + "description": "Sample for DeleteAppProfile", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_delete_app_profile_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteAppProfile_async", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_delete_app_profile_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.delete_app_profile", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteAppProfile", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "DeleteAppProfile" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.DeleteAppProfileRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "ignore_warnings", + "type": "bool" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "shortName": "delete_app_profile" + }, + "description": "Sample for DeleteAppProfile", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_delete_app_profile_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteAppProfile_sync", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_delete_app_profile_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.delete_cluster", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteCluster", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "DeleteCluster" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.DeleteClusterRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "shortName": "delete_cluster" + }, + "description": "Sample for DeleteCluster", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_delete_cluster_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteCluster_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_delete_cluster_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.delete_cluster", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteCluster", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "DeleteCluster" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.DeleteClusterRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "shortName": "delete_cluster" + }, + "description": "Sample for DeleteCluster", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_delete_cluster_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteCluster_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_delete_cluster_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.delete_instance", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteInstance", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "DeleteInstance" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.DeleteInstanceRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "shortName": "delete_instance" + }, + "description": "Sample for DeleteInstance", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_delete_instance_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteInstance_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_delete_instance_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.delete_instance", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteInstance", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "DeleteInstance" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.DeleteInstanceRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "shortName": "delete_instance" + }, + "description": "Sample for DeleteInstance", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_delete_instance_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteInstance_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_delete_instance_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.delete_logical_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteLogicalView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "DeleteLogicalView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.DeleteLogicalViewRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "shortName": "delete_logical_view" + }, + "description": "Sample for DeleteLogicalView", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_delete_logical_view_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteLogicalView_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_delete_logical_view_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.delete_logical_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteLogicalView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "DeleteLogicalView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.DeleteLogicalViewRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "shortName": "delete_logical_view" + }, + "description": "Sample for DeleteLogicalView", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_delete_logical_view_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteLogicalView_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_delete_logical_view_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.delete_materialized_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteMaterializedView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "DeleteMaterializedView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.DeleteMaterializedViewRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "shortName": "delete_materialized_view" + }, + "description": "Sample for DeleteMaterializedView", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_delete_materialized_view_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteMaterializedView_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_delete_materialized_view_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.delete_materialized_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.DeleteMaterializedView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "DeleteMaterializedView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.DeleteMaterializedViewRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "shortName": "delete_materialized_view" + }, + "description": "Sample for DeleteMaterializedView", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_delete_materialized_view_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_DeleteMaterializedView_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_delete_materialized_view_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.get_app_profile", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetAppProfile", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "GetAppProfile" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.GetAppProfileRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.AppProfile", + "shortName": "get_app_profile" + }, + "description": "Sample for GetAppProfile", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_get_app_profile_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetAppProfile_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_get_app_profile_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.get_app_profile", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetAppProfile", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "GetAppProfile" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.GetAppProfileRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.AppProfile", + "shortName": "get_app_profile" + }, + "description": "Sample for GetAppProfile", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_get_app_profile_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetAppProfile_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_get_app_profile_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.get_cluster", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetCluster", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "GetCluster" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.GetClusterRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.Cluster", + "shortName": "get_cluster" + }, + "description": "Sample for GetCluster", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_get_cluster_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetCluster_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_get_cluster_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.get_cluster", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetCluster", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "GetCluster" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.GetClusterRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.Cluster", + "shortName": "get_cluster" + }, + "description": "Sample for GetCluster", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_get_cluster_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetCluster_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_get_cluster_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.get_iam_policy", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetIamPolicy", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "GetIamPolicy" + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.GetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "get_iam_policy" + }, + "description": "Sample for GetIamPolicy", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_get_iam_policy_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetIamPolicy_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 41, + "start": 39, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 42, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_get_iam_policy_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.get_iam_policy", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetIamPolicy", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "GetIamPolicy" + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.GetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "get_iam_policy" + }, + "description": "Sample for GetIamPolicy", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_get_iam_policy_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetIamPolicy_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 41, + "start": 39, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 42, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_get_iam_policy_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.get_instance", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetInstance", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "GetInstance" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.GetInstanceRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.Instance", + "shortName": "get_instance" + }, + "description": "Sample for GetInstance", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_get_instance_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetInstance_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_get_instance_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.get_instance", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetInstance", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "GetInstance" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.GetInstanceRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.Instance", + "shortName": "get_instance" + }, + "description": "Sample for GetInstance", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_get_instance_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetInstance_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_get_instance_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.get_logical_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetLogicalView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "GetLogicalView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.GetLogicalViewRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.LogicalView", + "shortName": "get_logical_view" + }, + "description": "Sample for GetLogicalView", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_get_logical_view_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetLogicalView_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_get_logical_view_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.get_logical_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetLogicalView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "GetLogicalView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.GetLogicalViewRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.LogicalView", + "shortName": "get_logical_view" + }, + "description": "Sample for GetLogicalView", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_get_logical_view_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetLogicalView_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_get_logical_view_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.get_materialized_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetMaterializedView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "GetMaterializedView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.GetMaterializedViewRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.MaterializedView", + "shortName": "get_materialized_view" + }, + "description": "Sample for GetMaterializedView", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_get_materialized_view_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetMaterializedView_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_get_materialized_view_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.get_materialized_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.GetMaterializedView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "GetMaterializedView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.GetMaterializedViewRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.MaterializedView", + "shortName": "get_materialized_view" + }, + "description": "Sample for GetMaterializedView", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_get_materialized_view_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_GetMaterializedView_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_get_materialized_view_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.list_app_profiles", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListAppProfiles", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "ListAppProfiles" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ListAppProfilesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.pagers.ListAppProfilesAsyncPager", + "shortName": "list_app_profiles" + }, + "description": "Sample for ListAppProfiles", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_list_app_profiles_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListAppProfiles_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_list_app_profiles_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.list_app_profiles", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListAppProfiles", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "ListAppProfiles" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ListAppProfilesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.pagers.ListAppProfilesPager", + "shortName": "list_app_profiles" + }, + "description": "Sample for ListAppProfiles", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_list_app_profiles_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListAppProfiles_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_list_app_profiles_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.list_clusters", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListClusters", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "ListClusters" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ListClustersRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.ListClustersResponse", + "shortName": "list_clusters" + }, + "description": "Sample for ListClusters", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_list_clusters_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListClusters_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_list_clusters_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.list_clusters", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListClusters", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "ListClusters" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ListClustersRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.ListClustersResponse", + "shortName": "list_clusters" + }, + "description": "Sample for ListClusters", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_list_clusters_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListClusters_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_list_clusters_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.list_hot_tablets", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListHotTablets", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "ListHotTablets" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ListHotTabletsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.pagers.ListHotTabletsAsyncPager", + "shortName": "list_hot_tablets" + }, + "description": "Sample for ListHotTablets", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_list_hot_tablets_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListHotTablets_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_list_hot_tablets_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.list_hot_tablets", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListHotTablets", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "ListHotTablets" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ListHotTabletsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.pagers.ListHotTabletsPager", + "shortName": "list_hot_tablets" + }, + "description": "Sample for ListHotTablets", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_list_hot_tablets_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListHotTablets_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_list_hot_tablets_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.list_instances", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListInstances", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "ListInstances" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ListInstancesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.ListInstancesResponse", + "shortName": "list_instances" + }, + "description": "Sample for ListInstances", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_list_instances_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListInstances_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_list_instances_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.list_instances", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListInstances", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "ListInstances" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ListInstancesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.ListInstancesResponse", + "shortName": "list_instances" + }, + "description": "Sample for ListInstances", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_list_instances_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListInstances_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_list_instances_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.list_logical_views", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListLogicalViews", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "ListLogicalViews" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ListLogicalViewsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.pagers.ListLogicalViewsAsyncPager", + "shortName": "list_logical_views" + }, + "description": "Sample for ListLogicalViews", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_list_logical_views_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListLogicalViews_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_list_logical_views_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.list_logical_views", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListLogicalViews", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "ListLogicalViews" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ListLogicalViewsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.pagers.ListLogicalViewsPager", + "shortName": "list_logical_views" + }, + "description": "Sample for ListLogicalViews", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_list_logical_views_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListLogicalViews_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_list_logical_views_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.list_materialized_views", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListMaterializedViews", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "ListMaterializedViews" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ListMaterializedViewsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.pagers.ListMaterializedViewsAsyncPager", + "shortName": "list_materialized_views" + }, + "description": "Sample for ListMaterializedViews", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_list_materialized_views_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListMaterializedViews_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_list_materialized_views_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.list_materialized_views", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.ListMaterializedViews", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "ListMaterializedViews" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ListMaterializedViewsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.pagers.ListMaterializedViewsPager", + "shortName": "list_materialized_views" + }, + "description": "Sample for ListMaterializedViews", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_list_materialized_views_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_ListMaterializedViews_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_list_materialized_views_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.partial_update_cluster", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateCluster", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "PartialUpdateCluster" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.PartialUpdateClusterRequest" + }, + { + "name": "cluster", + "type": "google.cloud.bigtable.admin_v2.types.Cluster" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "partial_update_cluster" + }, + "description": "Sample for PartialUpdateCluster", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_partial_update_cluster_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateCluster_async", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 51, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "start": 52, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_partial_update_cluster_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.partial_update_cluster", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateCluster", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "PartialUpdateCluster" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.PartialUpdateClusterRequest" + }, + { + "name": "cluster", + "type": "google.cloud.bigtable.admin_v2.types.Cluster" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "partial_update_cluster" + }, + "description": "Sample for PartialUpdateCluster", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_partial_update_cluster_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateCluster_sync", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 51, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "start": 52, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_partial_update_cluster_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.partial_update_instance", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateInstance", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "PartialUpdateInstance" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.PartialUpdateInstanceRequest" + }, + { + "name": "instance", + "type": "google.cloud.bigtable.admin_v2.types.Instance" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "partial_update_instance" + }, + "description": "Sample for PartialUpdateInstance", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_partial_update_instance_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateInstance_async", + "segments": [ + { + "end": 58, + "start": 27, + "type": "FULL" + }, + { + "end": 58, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 48, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 55, + "start": 49, + "type": "REQUEST_EXECUTION" + }, + { + "end": 59, + "start": 56, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_partial_update_instance_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.partial_update_instance", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.PartialUpdateInstance", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "PartialUpdateInstance" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.PartialUpdateInstanceRequest" + }, + { + "name": "instance", + "type": "google.cloud.bigtable.admin_v2.types.Instance" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "partial_update_instance" + }, + "description": "Sample for PartialUpdateInstance", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_partial_update_instance_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_PartialUpdateInstance_sync", + "segments": [ + { + "end": 58, + "start": 27, + "type": "FULL" + }, + { + "end": 58, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 48, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 55, + "start": 49, + "type": "REQUEST_EXECUTION" + }, + { + "end": 59, + "start": 56, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_partial_update_instance_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.set_iam_policy", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.SetIamPolicy", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "SetIamPolicy" + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.SetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "set_iam_policy" + }, + "description": "Sample for SetIamPolicy", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_set_iam_policy_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_SetIamPolicy_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 41, + "start": 39, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 42, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_set_iam_policy_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.set_iam_policy", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.SetIamPolicy", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "SetIamPolicy" + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.SetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "set_iam_policy" + }, + "description": "Sample for SetIamPolicy", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_set_iam_policy_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_SetIamPolicy_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 41, + "start": 39, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 42, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_set_iam_policy_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.test_iam_permissions", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.TestIamPermissions", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "TestIamPermissions" + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "permissions", + "type": "MutableSequence[str]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.iam.v1.iam_policy_pb2.TestIamPermissionsResponse", + "shortName": "test_iam_permissions" + }, + "description": "Sample for TestIamPermissions", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_test_iam_permissions_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_TestIamPermissions_async", + "segments": [ + { + "end": 53, + "start": 27, + "type": "FULL" + }, + { + "end": 53, + "start": 27, + "type": "SHORT" + }, + { + "end": 41, + "start": 39, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 42, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 50, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 54, + "start": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_test_iam_permissions_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.test_iam_permissions", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.TestIamPermissions", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "TestIamPermissions" + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "permissions", + "type": "MutableSequence[str]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.iam.v1.iam_policy_pb2.TestIamPermissionsResponse", + "shortName": "test_iam_permissions" + }, + "description": "Sample for TestIamPermissions", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_test_iam_permissions_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_TestIamPermissions_sync", + "segments": [ + { + "end": 53, + "start": 27, + "type": "FULL" + }, + { + "end": 53, + "start": 27, + "type": "SHORT" + }, + { + "end": 41, + "start": 39, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 42, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 50, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 54, + "start": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_test_iam_permissions_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.update_app_profile", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateAppProfile", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "UpdateAppProfile" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.UpdateAppProfileRequest" + }, + { + "name": "app_profile", + "type": "google.cloud.bigtable.admin_v2.types.AppProfile" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "update_app_profile" + }, + "description": "Sample for UpdateAppProfile", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_update_app_profile_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateAppProfile_async", + "segments": [ + { + "end": 58, + "start": 27, + "type": "FULL" + }, + { + "end": 58, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 48, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 55, + "start": 49, + "type": "REQUEST_EXECUTION" + }, + { + "end": 59, + "start": 56, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_update_app_profile_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.update_app_profile", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateAppProfile", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "UpdateAppProfile" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.UpdateAppProfileRequest" + }, + { + "name": "app_profile", + "type": "google.cloud.bigtable.admin_v2.types.AppProfile" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "update_app_profile" + }, + "description": "Sample for UpdateAppProfile", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_update_app_profile_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateAppProfile_sync", + "segments": [ + { + "end": 58, + "start": 27, + "type": "FULL" + }, + { + "end": 58, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 48, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 55, + "start": 49, + "type": "REQUEST_EXECUTION" + }, + { + "end": 59, + "start": 56, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_update_app_profile_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.update_cluster", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateCluster", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "UpdateCluster" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.Cluster" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "update_cluster" + }, + "description": "Sample for UpdateCluster", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_update_cluster_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_async", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 51, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "start": 52, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_update_cluster_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.update_cluster", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateCluster", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "UpdateCluster" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.Cluster" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "update_cluster" + }, + "description": "Sample for UpdateCluster", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_update_cluster_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateCluster_sync", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 51, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "start": 52, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_update_cluster_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.update_instance", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateInstance", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "UpdateInstance" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.Instance" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.Instance", + "shortName": "update_instance" + }, + "description": "Sample for UpdateInstance", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_update_instance_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateInstance_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_update_instance_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.update_instance", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateInstance", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "UpdateInstance" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.Instance" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.Instance", + "shortName": "update_instance" + }, + "description": "Sample for UpdateInstance", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_update_instance_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateInstance_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_update_instance_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.update_logical_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateLogicalView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "UpdateLogicalView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.UpdateLogicalViewRequest" + }, + { + "name": "logical_view", + "type": "google.cloud.bigtable.admin_v2.types.LogicalView" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "update_logical_view" + }, + "description": "Sample for UpdateLogicalView", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_update_logical_view_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateLogicalView_async", + "segments": [ + { + "end": 58, + "start": 27, + "type": "FULL" + }, + { + "end": 58, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 48, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 55, + "start": 49, + "type": "REQUEST_EXECUTION" + }, + { + "end": 59, + "start": 56, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_update_logical_view_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.update_logical_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateLogicalView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "UpdateLogicalView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.UpdateLogicalViewRequest" + }, + { + "name": "logical_view", + "type": "google.cloud.bigtable.admin_v2.types.LogicalView" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "update_logical_view" + }, + "description": "Sample for UpdateLogicalView", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_update_logical_view_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateLogicalView_sync", + "segments": [ + { + "end": 58, + "start": 27, + "type": "FULL" + }, + { + "end": 58, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 48, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 55, + "start": 49, + "type": "REQUEST_EXECUTION" + }, + { + "end": 59, + "start": 56, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_update_logical_view_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient", + "shortName": "BigtableInstanceAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminAsyncClient.update_materialized_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateMaterializedView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "UpdateMaterializedView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.UpdateMaterializedViewRequest" + }, + { + "name": "materialized_view", + "type": "google.cloud.bigtable.admin_v2.types.MaterializedView" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "update_materialized_view" + }, + "description": "Sample for UpdateMaterializedView", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_update_materialized_view_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateMaterializedView_async", + "segments": [ + { + "end": 58, + "start": 27, + "type": "FULL" + }, + { + "end": 58, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 48, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 55, + "start": 49, + "type": "REQUEST_EXECUTION" + }, + { + "end": 59, + "start": 56, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_update_materialized_view_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient", + "shortName": "BigtableInstanceAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient.update_materialized_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin.UpdateMaterializedView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableInstanceAdmin", + "shortName": "BigtableInstanceAdmin" + }, + "shortName": "UpdateMaterializedView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.UpdateMaterializedViewRequest" + }, + { + "name": "materialized_view", + "type": "google.cloud.bigtable.admin_v2.types.MaterializedView" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "update_materialized_view" + }, + "description": "Sample for UpdateMaterializedView", + "file": "bigtableadmin_v2_generated_bigtable_instance_admin_update_materialized_view_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableInstanceAdmin_UpdateMaterializedView_sync", + "segments": [ + { + "end": 58, + "start": 27, + "type": "FULL" + }, + { + "end": 58, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 48, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 55, + "start": 49, + "type": "REQUEST_EXECUTION" + }, + { + "end": 59, + "start": 56, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_instance_admin_update_materialized_view_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.check_consistency", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "CheckConsistency" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CheckConsistencyRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "consistency_token", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.CheckConsistencyResponse", + "shortName": "check_consistency" + }, + "description": "Sample for CheckConsistency", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_check_consistency_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_check_consistency_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.check_consistency", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CheckConsistency", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "CheckConsistency" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CheckConsistencyRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "consistency_token", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.CheckConsistencyResponse", + "shortName": "check_consistency" + }, + "description": "Sample for CheckConsistency", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_check_consistency_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CheckConsistency_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_check_consistency_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.copy_backup", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "CopyBackup" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CopyBackupRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "backup_id", + "type": "str" + }, + { + "name": "source_backup", + "type": "str" + }, + { + "name": "expire_time", + "type": "google.protobuf.timestamp_pb2.Timestamp" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "copy_backup" + }, + "description": "Sample for CopyBackup", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_copy_backup_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CopyBackup_async", + "segments": [ + { + "end": 57, + "start": 27, + "type": "FULL" + }, + { + "end": 57, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 54, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 58, + "start": 55, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_copy_backup_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.copy_backup", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CopyBackup", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "CopyBackup" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CopyBackupRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "backup_id", + "type": "str" + }, + { + "name": "source_backup", + "type": "str" + }, + { + "name": "expire_time", + "type": "google.protobuf.timestamp_pb2.Timestamp" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "copy_backup" + }, + "description": "Sample for CopyBackup", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_copy_backup_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CopyBackup_sync", + "segments": [ + { + "end": 57, + "start": 27, + "type": "FULL" + }, + { + "end": 57, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 54, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 58, + "start": 55, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_copy_backup_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.create_authorized_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "CreateAuthorizedView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CreateAuthorizedViewRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "authorized_view", + "type": "google.cloud.bigtable.admin_v2.types.AuthorizedView" + }, + { + "name": "authorized_view_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_authorized_view" + }, + "description": "Sample for CreateAuthorizedView", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_create_authorized_view_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CreateAuthorizedView_async", + "segments": [ + { + "end": 56, + "start": 27, + "type": "FULL" + }, + { + "end": 56, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 53, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 57, + "start": 54, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_create_authorized_view_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.create_authorized_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateAuthorizedView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "CreateAuthorizedView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CreateAuthorizedViewRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "authorized_view", + "type": "google.cloud.bigtable.admin_v2.types.AuthorizedView" + }, + { + "name": "authorized_view_id", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_authorized_view" + }, + "description": "Sample for CreateAuthorizedView", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_create_authorized_view_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CreateAuthorizedView_sync", + "segments": [ + { + "end": 56, + "start": 27, + "type": "FULL" + }, + { + "end": 56, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 53, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 57, + "start": 54, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_create_authorized_view_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.create_backup", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "CreateBackup" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CreateBackupRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "backup_id", + "type": "str" + }, + { + "name": "backup", + "type": "google.cloud.bigtable.admin_v2.types.Backup" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_backup" + }, + "description": "Sample for CreateBackup", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_create_backup_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CreateBackup_async", + "segments": [ + { + "end": 60, + "start": 27, + "type": "FULL" + }, + { + "end": 60, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 50, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 57, + "start": 51, + "type": "REQUEST_EXECUTION" + }, + { + "end": 61, + "start": 58, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_create_backup_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.create_backup", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateBackup", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "CreateBackup" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CreateBackupRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "backup_id", + "type": "str" + }, + { + "name": "backup", + "type": "google.cloud.bigtable.admin_v2.types.Backup" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_backup" + }, + "description": "Sample for CreateBackup", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_create_backup_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CreateBackup_sync", + "segments": [ + { + "end": 60, + "start": 27, + "type": "FULL" + }, + { + "end": 60, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 50, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 57, + "start": 51, + "type": "REQUEST_EXECUTION" + }, + { + "end": 61, + "start": 58, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_create_backup_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.create_table_from_snapshot", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "CreateTableFromSnapshot" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CreateTableFromSnapshotRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "table_id", + "type": "str" + }, + { + "name": "source_snapshot", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "create_table_from_snapshot" + }, + "description": "Sample for CreateTableFromSnapshot", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_create_table_from_snapshot_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CreateTableFromSnapshot_async", + "segments": [ + { + "end": 57, + "start": 27, + "type": "FULL" + }, + { + "end": 57, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 54, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 58, + "start": 55, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_create_table_from_snapshot_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.create_table_from_snapshot", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateTableFromSnapshot", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "CreateTableFromSnapshot" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CreateTableFromSnapshotRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "table_id", + "type": "str" + }, + { + "name": "source_snapshot", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "create_table_from_snapshot" + }, + "description": "Sample for CreateTableFromSnapshot", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_create_table_from_snapshot_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CreateTableFromSnapshot_sync", + "segments": [ + { + "end": 57, + "start": 27, + "type": "FULL" + }, + { + "end": 57, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 54, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 58, + "start": 55, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_create_table_from_snapshot_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.create_table", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateTable", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "CreateTable" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CreateTableRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "table_id", + "type": "str" + }, + { + "name": "table", + "type": "google.cloud.bigtable.admin_v2.types.Table" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.Table", + "shortName": "create_table" + }, + "description": "Sample for CreateTable", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_create_table_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CreateTable_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_create_table_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.create_table", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.CreateTable", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "CreateTable" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.CreateTableRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "table_id", + "type": "str" + }, + { + "name": "table", + "type": "google.cloud.bigtable.admin_v2.types.Table" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.Table", + "shortName": "create_table" + }, + "description": "Sample for CreateTable", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_create_table_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_CreateTable_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_create_table_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.delete_authorized_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "DeleteAuthorizedView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.DeleteAuthorizedViewRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "shortName": "delete_authorized_view" + }, + "description": "Sample for DeleteAuthorizedView", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_delete_authorized_view_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_DeleteAuthorizedView_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_delete_authorized_view_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.delete_authorized_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteAuthorizedView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "DeleteAuthorizedView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.DeleteAuthorizedViewRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "shortName": "delete_authorized_view" + }, + "description": "Sample for DeleteAuthorizedView", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_delete_authorized_view_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_DeleteAuthorizedView_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_delete_authorized_view_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.delete_backup", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "DeleteBackup" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.DeleteBackupRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "shortName": "delete_backup" + }, + "description": "Sample for DeleteBackup", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_delete_backup_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_DeleteBackup_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_delete_backup_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.delete_backup", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteBackup", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "DeleteBackup" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.DeleteBackupRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "shortName": "delete_backup" + }, + "description": "Sample for DeleteBackup", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_delete_backup_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_DeleteBackup_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_delete_backup_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient._delete_snapshot", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "DeleteSnapshot" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.DeleteSnapshotRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "shortName": "_delete_snapshot" + }, + "description": "Sample for DeleteSnapshot", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_delete_snapshot_async_internal.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSnapshot_async_internal", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_delete_snapshot_async_internal.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient._delete_snapshot", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteSnapshot", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "DeleteSnapshot" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.DeleteSnapshotRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "shortName": "_delete_snapshot" + }, + "description": "Sample for DeleteSnapshot", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_delete_snapshot_sync_internal.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_DeleteSnapshot_sync_internal", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_delete_snapshot_sync_internal.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.delete_table", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "DeleteTable" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.DeleteTableRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "shortName": "delete_table" + }, + "description": "Sample for DeleteTable", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_delete_table_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_DeleteTable_async", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_delete_table_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.delete_table", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DeleteTable", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "DeleteTable" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.DeleteTableRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "shortName": "delete_table" + }, + "description": "Sample for DeleteTable", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_delete_table_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_DeleteTable_sync", + "segments": [ + { + "end": 49, + "start": 27, + "type": "FULL" + }, + { + "end": 49, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_delete_table_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.drop_row_range", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "DropRowRange" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.DropRowRangeRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "shortName": "drop_row_range" + }, + "description": "Sample for DropRowRange", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_drop_row_range_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_DropRowRange_async", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_drop_row_range_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.drop_row_range", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.DropRowRange", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "DropRowRange" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.DropRowRangeRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "shortName": "drop_row_range" + }, + "description": "Sample for DropRowRange", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_drop_row_range_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_DropRowRange_sync", + "segments": [ + { + "end": 50, + "start": 27, + "type": "FULL" + }, + { + "end": 50, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_drop_row_range_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.generate_consistency_token", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "GenerateConsistencyToken" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.GenerateConsistencyTokenRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.GenerateConsistencyTokenResponse", + "shortName": "generate_consistency_token" + }, + "description": "Sample for GenerateConsistencyToken", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_generate_consistency_token_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GenerateConsistencyToken_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_generate_consistency_token_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.generate_consistency_token", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GenerateConsistencyToken", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "GenerateConsistencyToken" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.GenerateConsistencyTokenRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.GenerateConsistencyTokenResponse", + "shortName": "generate_consistency_token" + }, + "description": "Sample for GenerateConsistencyToken", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_generate_consistency_token_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GenerateConsistencyToken_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_generate_consistency_token_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.get_authorized_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "GetAuthorizedView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.GetAuthorizedViewRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.AuthorizedView", + "shortName": "get_authorized_view" + }, + "description": "Sample for GetAuthorizedView", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_get_authorized_view_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GetAuthorizedView_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_get_authorized_view_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.get_authorized_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetAuthorizedView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "GetAuthorizedView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.GetAuthorizedViewRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.AuthorizedView", + "shortName": "get_authorized_view" + }, + "description": "Sample for GetAuthorizedView", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_get_authorized_view_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GetAuthorizedView_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_get_authorized_view_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.get_backup", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetBackup", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "GetBackup" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.GetBackupRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.Backup", + "shortName": "get_backup" + }, + "description": "Sample for GetBackup", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_get_backup_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GetBackup_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_get_backup_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.get_backup", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetBackup", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "GetBackup" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.GetBackupRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.Backup", + "shortName": "get_backup" + }, + "description": "Sample for GetBackup", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_get_backup_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GetBackup_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_get_backup_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.get_iam_policy", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetIamPolicy", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "GetIamPolicy" + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.GetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "get_iam_policy" + }, + "description": "Sample for GetIamPolicy", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_get_iam_policy_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GetIamPolicy_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 41, + "start": 39, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 42, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_get_iam_policy_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.get_iam_policy", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetIamPolicy", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "GetIamPolicy" + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.GetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "get_iam_policy" + }, + "description": "Sample for GetIamPolicy", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_get_iam_policy_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GetIamPolicy_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 41, + "start": 39, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 42, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_get_iam_policy_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient._get_snapshot", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "GetSnapshot" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.GetSnapshotRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.Snapshot", + "shortName": "_get_snapshot" + }, + "description": "Sample for GetSnapshot", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_get_snapshot_async_internal.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GetSnapshot_async_internal", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_get_snapshot_async_internal.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient._get_snapshot", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetSnapshot", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "GetSnapshot" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.GetSnapshotRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.Snapshot", + "shortName": "_get_snapshot" + }, + "description": "Sample for GetSnapshot", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_get_snapshot_sync_internal.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GetSnapshot_sync_internal", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_get_snapshot_sync_internal.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.get_table", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetTable", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "GetTable" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.GetTableRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.Table", + "shortName": "get_table" + }, + "description": "Sample for GetTable", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_get_table_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GetTable_async", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_get_table_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.get_table", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.GetTable", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "GetTable" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.GetTableRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.Table", + "shortName": "get_table" + }, + "description": "Sample for GetTable", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_get_table_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_GetTable_sync", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_get_table_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.list_authorized_views", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "ListAuthorizedViews" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ListAuthorizedViewsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.services.bigtable_table_admin.pagers.ListAuthorizedViewsAsyncPager", + "shortName": "list_authorized_views" + }, + "description": "Sample for ListAuthorizedViews", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_list_authorized_views_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_ListAuthorizedViews_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_list_authorized_views_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.list_authorized_views", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListAuthorizedViews", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "ListAuthorizedViews" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ListAuthorizedViewsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.services.bigtable_table_admin.pagers.ListAuthorizedViewsPager", + "shortName": "list_authorized_views" + }, + "description": "Sample for ListAuthorizedViews", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_list_authorized_views_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_ListAuthorizedViews_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_list_authorized_views_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.list_backups", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListBackups", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "ListBackups" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ListBackupsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.services.bigtable_table_admin.pagers.ListBackupsAsyncPager", + "shortName": "list_backups" + }, + "description": "Sample for ListBackups", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_list_backups_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_ListBackups_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_list_backups_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.list_backups", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListBackups", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "ListBackups" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ListBackupsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.services.bigtable_table_admin.pagers.ListBackupsPager", + "shortName": "list_backups" + }, + "description": "Sample for ListBackups", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_list_backups_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_ListBackups_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_list_backups_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient._list_snapshots", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "ListSnapshots" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ListSnapshotsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.services.bigtable_table_admin.pagers.ListSnapshotsAsyncPager", + "shortName": "_list_snapshots" + }, + "description": "Sample for ListSnapshots", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_list_snapshots_async_internal.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_ListSnapshots_async_internal", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_list_snapshots_async_internal.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient._list_snapshots", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListSnapshots", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "ListSnapshots" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ListSnapshotsRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.services.bigtable_table_admin.pagers.ListSnapshotsPager", + "shortName": "_list_snapshots" + }, + "description": "Sample for ListSnapshots", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_list_snapshots_sync_internal.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_ListSnapshots_sync_internal", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_list_snapshots_sync_internal.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.list_tables", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListTables", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "ListTables" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ListTablesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.services.bigtable_table_admin.pagers.ListTablesAsyncPager", + "shortName": "list_tables" + }, + "description": "Sample for ListTables", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_list_tables_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_ListTables_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_list_tables_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.list_tables", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ListTables", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "ListTables" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ListTablesRequest" + }, + { + "name": "parent", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.services.bigtable_table_admin.pagers.ListTablesPager", + "shortName": "list_tables" + }, + "description": "Sample for ListTables", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_list_tables_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_ListTables_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_list_tables_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient._modify_column_families", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "ModifyColumnFamilies" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ModifyColumnFamiliesRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "modifications", + "type": "MutableSequence[google.cloud.bigtable.admin_v2.types.ModifyColumnFamiliesRequest.Modification]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.Table", + "shortName": "_modify_column_families" + }, + "description": "Sample for ModifyColumnFamilies", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_modify_column_families_async_internal.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_ModifyColumnFamilies_async_internal", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_modify_column_families_async_internal.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient._modify_column_families", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.ModifyColumnFamilies", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "ModifyColumnFamilies" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.ModifyColumnFamiliesRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "modifications", + "type": "MutableSequence[google.cloud.bigtable.admin_v2.types.ModifyColumnFamiliesRequest.Modification]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.Table", + "shortName": "_modify_column_families" + }, + "description": "Sample for ModifyColumnFamilies", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_modify_column_families_sync_internal.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_ModifyColumnFamilies_sync_internal", + "segments": [ + { + "end": 51, + "start": 27, + "type": "FULL" + }, + { + "end": 51, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 48, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 52, + "start": 49, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_modify_column_families_sync_internal.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient._restore_table", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "RestoreTable" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.RestoreTableRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "_restore_table" + }, + "description": "Sample for RestoreTable", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_restore_table_async_internal.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_async_internal", + "segments": [ + { + "end": 57, + "start": 27, + "type": "FULL" + }, + { + "end": 57, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 54, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 58, + "start": 55, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_restore_table_async_internal.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient._restore_table", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.RestoreTable", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "RestoreTable" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.RestoreTableRequest" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "_restore_table" + }, + "description": "Sample for RestoreTable", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_restore_table_sync_internal.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_RestoreTable_sync_internal", + "segments": [ + { + "end": 57, + "start": 27, + "type": "FULL" + }, + { + "end": 57, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 54, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 58, + "start": 55, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_restore_table_sync_internal.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.set_iam_policy", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.SetIamPolicy", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "SetIamPolicy" + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.SetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "set_iam_policy" + }, + "description": "Sample for SetIamPolicy", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_set_iam_policy_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_SetIamPolicy_async", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 41, + "start": 39, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 42, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_set_iam_policy_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.set_iam_policy", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.SetIamPolicy", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "SetIamPolicy" + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.SetIamPolicyRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.iam.v1.policy_pb2.Policy", + "shortName": "set_iam_policy" + }, + "description": "Sample for SetIamPolicy", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_set_iam_policy_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_SetIamPolicy_sync", + "segments": [ + { + "end": 52, + "start": 27, + "type": "FULL" + }, + { + "end": 52, + "start": 27, + "type": "SHORT" + }, + { + "end": 41, + "start": 39, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 46, + "start": 42, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 49, + "start": 47, + "type": "REQUEST_EXECUTION" + }, + { + "end": 53, + "start": 50, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_set_iam_policy_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient._snapshot_table", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "SnapshotTable" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.SnapshotTableRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "cluster", + "type": "str" + }, + { + "name": "snapshot_id", + "type": "str" + }, + { + "name": "description", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "_snapshot_table" + }, + "description": "Sample for SnapshotTable", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_snapshot_table_async_internal.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_SnapshotTable_async_internal", + "segments": [ + { + "end": 57, + "start": 27, + "type": "FULL" + }, + { + "end": 57, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 54, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 58, + "start": 55, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_snapshot_table_async_internal.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient._snapshot_table", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.SnapshotTable", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "SnapshotTable" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.SnapshotTableRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "cluster", + "type": "str" + }, + { + "name": "snapshot_id", + "type": "str" + }, + { + "name": "description", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "_snapshot_table" + }, + "description": "Sample for SnapshotTable", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_snapshot_table_sync_internal.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_SnapshotTable_sync_internal", + "segments": [ + { + "end": 57, + "start": 27, + "type": "FULL" + }, + { + "end": 57, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 54, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 58, + "start": 55, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_snapshot_table_sync_internal.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.test_iam_permissions", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.TestIamPermissions", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "TestIamPermissions" + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "permissions", + "type": "MutableSequence[str]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.iam.v1.iam_policy_pb2.TestIamPermissionsResponse", + "shortName": "test_iam_permissions" + }, + "description": "Sample for TestIamPermissions", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_test_iam_permissions_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_TestIamPermissions_async", + "segments": [ + { + "end": 53, + "start": 27, + "type": "FULL" + }, + { + "end": 53, + "start": 27, + "type": "SHORT" + }, + { + "end": 41, + "start": 39, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 42, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 50, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 54, + "start": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_test_iam_permissions_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.test_iam_permissions", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.TestIamPermissions", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "TestIamPermissions" + }, + "parameters": [ + { + "name": "request", + "type": "google.iam.v1.iam_policy_pb2.TestIamPermissionsRequest" + }, + { + "name": "resource", + "type": "str" + }, + { + "name": "permissions", + "type": "MutableSequence[str]" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.iam.v1.iam_policy_pb2.TestIamPermissionsResponse", + "shortName": "test_iam_permissions" + }, + "description": "Sample for TestIamPermissions", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_test_iam_permissions_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_TestIamPermissions_sync", + "segments": [ + { + "end": 53, + "start": 27, + "type": "FULL" + }, + { + "end": 53, + "start": 27, + "type": "SHORT" + }, + { + "end": 41, + "start": 39, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 47, + "start": 42, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 50, + "start": 48, + "type": "REQUEST_EXECUTION" + }, + { + "end": 54, + "start": 51, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_test_iam_permissions_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.undelete_table", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "UndeleteTable" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.UndeleteTableRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "undelete_table" + }, + "description": "Sample for UndeleteTable", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_undelete_table_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_UndeleteTable_async", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_undelete_table_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.undelete_table", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UndeleteTable", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "UndeleteTable" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.UndeleteTableRequest" + }, + { + "name": "name", + "type": "str" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "undelete_table" + }, + "description": "Sample for UndeleteTable", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_undelete_table_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_UndeleteTable_sync", + "segments": [ + { + "end": 55, + "start": 27, + "type": "FULL" + }, + { + "end": 55, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 45, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 52, + "start": 46, + "type": "REQUEST_EXECUTION" + }, + { + "end": 56, + "start": 53, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_undelete_table_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.update_authorized_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "UpdateAuthorizedView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.UpdateAuthorizedViewRequest" + }, + { + "name": "authorized_view", + "type": "google.cloud.bigtable.admin_v2.types.AuthorizedView" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "update_authorized_view" + }, + "description": "Sample for UpdateAuthorizedView", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_update_authorized_view_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_UpdateAuthorizedView_async", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 51, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "start": 52, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_update_authorized_view_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.update_authorized_view", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UpdateAuthorizedView", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "UpdateAuthorizedView" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.UpdateAuthorizedViewRequest" + }, + { + "name": "authorized_view", + "type": "google.cloud.bigtable.admin_v2.types.AuthorizedView" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "update_authorized_view" + }, + "description": "Sample for UpdateAuthorizedView", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_update_authorized_view_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_UpdateAuthorizedView_sync", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 51, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "start": 52, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_update_authorized_view_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.update_backup", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "UpdateBackup" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.UpdateBackupRequest" + }, + { + "name": "backup", + "type": "google.cloud.bigtable.admin_v2.types.Backup" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.Backup", + "shortName": "update_backup" + }, + "description": "Sample for UpdateBackup", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_update_backup_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_UpdateBackup_async", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 48, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 51, + "start": 49, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "start": 52, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_update_backup_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.update_backup", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UpdateBackup", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "UpdateBackup" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.UpdateBackupRequest" + }, + { + "name": "backup", + "type": "google.cloud.bigtable.admin_v2.types.Backup" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.cloud.bigtable.admin_v2.types.Backup", + "shortName": "update_backup" + }, + "description": "Sample for UpdateBackup", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_update_backup_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_UpdateBackup_sync", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 48, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 51, + "start": 49, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "start": 52, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_update_backup_sync.py" + }, + { + "canonical": true, + "clientMethod": { + "async": true, + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient", + "shortName": "BaseBigtableTableAdminAsyncClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminAsyncClient.update_table", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "UpdateTable" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.UpdateTableRequest" + }, + { + "name": "table", + "type": "google.cloud.bigtable.admin_v2.types.Table" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation_async.AsyncOperation", + "shortName": "update_table" + }, + "description": "Sample for UpdateTable", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_update_table_async.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_UpdateTable_async", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 51, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "start": 52, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_update_table_async.py" + }, + { + "canonical": true, + "clientMethod": { + "client": { + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient", + "shortName": "BaseBigtableTableAdminClient" + }, + "fullName": "google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient.update_table", + "method": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin.UpdateTable", + "service": { + "fullName": "google.bigtable.admin.v2.BigtableTableAdmin", + "shortName": "BigtableTableAdmin" + }, + "shortName": "UpdateTable" + }, + "parameters": [ + { + "name": "request", + "type": "google.cloud.bigtable.admin_v2.types.UpdateTableRequest" + }, + { + "name": "table", + "type": "google.cloud.bigtable.admin_v2.types.Table" + }, + { + "name": "update_mask", + "type": "google.protobuf.field_mask_pb2.FieldMask" + }, + { + "name": "retry", + "type": "google.api_core.retry.Retry" + }, + { + "name": "timeout", + "type": "float" + }, + { + "name": "metadata", + "type": "Sequence[Tuple[str, Union[str, bytes]]]" + } + ], + "resultType": "google.api_core.operation.Operation", + "shortName": "update_table" + }, + "description": "Sample for UpdateTable", + "file": "bigtableadmin_v2_generated_bigtable_table_admin_update_table_sync.py", + "language": "PYTHON", + "origin": "API_DEFINITION", + "regionTag": "bigtableadmin_v2_generated_BigtableTableAdmin_UpdateTable_sync", + "segments": [ + { + "end": 54, + "start": 27, + "type": "FULL" + }, + { + "end": 54, + "start": 27, + "type": "SHORT" + }, + { + "end": 40, + "start": 38, + "type": "CLIENT_INITIALIZATION" + }, + { + "end": 44, + "start": 41, + "type": "REQUEST_INITIALIZATION" + }, + { + "end": 51, + "start": 45, + "type": "REQUEST_EXECUTION" + }, + { + "end": 55, + "start": 52, + "type": "RESPONSE_HANDLING" + } + ], + "title": "bigtableadmin_v2_generated_bigtable_table_admin_update_table_sync.py" + } + ] +} diff --git a/scripts/fixup_bigtable_admin_v2_keywords.py b/scripts/fixup_admin_v2_keywords.py similarity index 98% rename from scripts/fixup_bigtable_admin_v2_keywords.py rename to scripts/fixup_admin_v2_keywords.py index 352e63a93..d287df24f 100644 --- a/scripts/fixup_bigtable_admin_v2_keywords.py +++ b/scripts/fixup_admin_v2_keywords.py @@ -36,7 +36,7 @@ def partition( return results[1], results[0] -class bigtable_adminCallTransformer(cst.CSTTransformer): +class adminCallTransformer(cst.CSTTransformer): CTRL_PARAMS: Tuple[str] = ('retry', 'timeout', 'metadata') METHOD_TO_PARAMS: Dict[str, Tuple[str]] = { 'check_consistency': ('name', 'consistency_token', 'standard_read_remote_writes', 'data_boost_read_local_writes', ), @@ -145,7 +145,7 @@ def fix_files( in_dir: pathlib.Path, out_dir: pathlib.Path, *, - transformer=bigtable_adminCallTransformer(), + transformer=adminCallTransformer(), ): """Duplicate the input dir to the output dir, fixing file method calls. @@ -178,7 +178,7 @@ def fix_files( if __name__ == '__main__': parser = argparse.ArgumentParser( - description="""Fix up source that uses the bigtable_admin client library. + description="""Fix up source that uses the admin client library. The existing sources are NOT overwritten but are copied to output_dir with changes made. diff --git a/setup.py b/setup.py index 7e89af11b..bb5c6dce5 100644 --- a/setup.py +++ b/setup.py @@ -94,7 +94,7 @@ extras_require=extras, scripts=[ "scripts/fixup_bigtable_v2_keywords.py", - "scripts/fixup_bigtable_admin_v2_keywords.py", + "scripts/fixup_admin_v2_keywords.py", ], python_requires=">=3.7", include_package_data=True, diff --git a/tests/system/data/setup_fixtures.py b/tests/system/data/setup_fixtures.py index 3b5a0af06..f6644bf8b 100644 --- a/tests/system/data/setup_fixtures.py +++ b/tests/system/data/setup_fixtures.py @@ -37,7 +37,7 @@ def instance_id(admin_client, project_id, cluster_config): """ Returns BIGTABLE_TEST_INSTANCE if set, otherwise creates a new temporary instance for the test session """ - from google.cloud.bigtable_admin_v2 import types + from google.cloud.bigtable.admin_v2 import types from google.api_core import exceptions from google.cloud.environment_vars import BIGTABLE_EMULATOR diff --git a/tests/system/data/test_system_async.py b/tests/system/data/test_system_async.py index 53e97acc1..c2e13bb11 100644 --- a/tests/system/data/test_system_async.py +++ b/tests/system/data/test_system_async.py @@ -111,7 +111,7 @@ def column_family_config(self): """ specify column families to create when creating a new test table """ - from google.cloud.bigtable_admin_v2 import types + from google.cloud.bigtable.admin_v2 import types return {TEST_FAMILY: types.ColumnFamily(), TEST_FAMILY_2: types.ColumnFamily()} @@ -127,7 +127,7 @@ def cluster_config(self, project_id): """ Configuration for the clusters to use when creating a new instance """ - from google.cloud.bigtable_admin_v2 import types + from google.cloud.bigtable.admin_v2 import types cluster = { "test-cluster": types.Cluster( diff --git a/tests/system/data/test_system_autogen.py b/tests/system/data/test_system_autogen.py index ede24be76..972638c1e 100644 --- a/tests/system/data/test_system_autogen.py +++ b/tests/system/data/test_system_autogen.py @@ -89,7 +89,7 @@ def table(self, client, table_id, instance_id): @pytest.fixture(scope="session") def column_family_config(self): """specify column families to create when creating a new test table""" - from google.cloud.bigtable_admin_v2 import types + from google.cloud.bigtable.admin_v2 import types return {TEST_FAMILY: types.ColumnFamily(), TEST_FAMILY_2: types.ColumnFamily()} @@ -101,7 +101,7 @@ def init_table_id(self): @pytest.fixture(scope="session") def cluster_config(self, project_id): """Configuration for the clusters to use when creating a new instance""" - from google.cloud.bigtable_admin_v2 import types + from google.cloud.bigtable.admin_v2 import types cluster = { "test-cluster": types.Cluster( diff --git a/tests/unit/admin_overlay/test_admin_packaging.py b/tests/unit/admin_overlay/test_admin_packaging.py new file mode 100644 index 000000000..97302c66e --- /dev/null +++ b/tests/unit/admin_overlay/test_admin_packaging.py @@ -0,0 +1,41 @@ +# Copyright 2025 Google LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import importlib + +import pytest + + +@pytest.mark.parametrize( + "module", ["google.cloud.bigtable.admin", "google.cloud.bigtable.admin_v2"] +) +def test_admin_overlay_imports(module): + # Simulate from import dynamically using importlib + mod = importlib.import_module(module) + + # Check that the import aliasing works as expected for overlay/autogenerated clients/types. + classes_to_modules = { + "BigtableTableAdminClient": "google.cloud.bigtable.admin_v2.overlay.services.bigtable_table_admin.client", + "RestoreTableOperation": "google.cloud.bigtable.admin_v2.overlay.types.restore_table", + "BigtableInstanceAdminClient": "google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.client", + "RestoreTableRequest": "google.cloud.bigtable.admin_v2.types.bigtable_table_admin", + } + + for cls_name, submodule_name in classes_to_modules.items(): + cls = getattr(mod, cls_name) + submodule = importlib.import_module(submodule_name) + assert cls == getattr(submodule, cls_name) + + # Check that from import * has the class inside. + assert cls_name in mod.__all__ diff --git a/tests/unit/admin_overlay/test_client.py b/tests/unit/admin_overlay/test_client.py new file mode 100644 index 000000000..6b6a15e2e --- /dev/null +++ b/tests/unit/admin_overlay/test_client.py @@ -0,0 +1,223 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock +except ImportError: # pragma: NO COVER + import mock + +import functools + +from google.api_core import gapic_v1 +from google.api_core import retry as retries +from google.cloud.bigtable.admin_v2.services.bigtable_table_admin import transports +from google.cloud.bigtable.admin_v2.types import bigtable_table_admin +from google.cloud.bigtable.admin_v2.overlay.services.bigtable_table_admin.client import ( + BigtableTableAdminClient, + DEFAULT_CLIENT_INFO, +) +from google.cloud.bigtable.admin_v2.overlay.types import consistency, restore_table + +from google.cloud.bigtable import __version__ as bigtable_version + +import pytest + + +PARENT_NAME = "my_parent" +TABLE_NAME = "my_table" +CONSISTENCY_TOKEN = "abcdefg" + + +@pytest.mark.parametrize( + "transport_class,transport_name", + [ + ( + transports.BigtableTableAdminGrpcTransport, + "grpc", + ), + ( + transports.BigtableTableAdminRestTransport, + "rest", + ), + ], +) +def test_bigtable_table_admin_client_client_version(transport_class, transport_name): + with mock.patch.object(transport_class, "__init__") as patched: + patched.return_value = None + BigtableTableAdminClient(transport=transport_name) + transport_init_call = patched.call_args + assert transport_init_call.kwargs["client_info"] == DEFAULT_CLIENT_INFO + + assert ( + DEFAULT_CLIENT_INFO.client_library_version + == f"{bigtable_version}-admin-overlay" + ) + + +@pytest.mark.parametrize( + "kwargs", + [ + { + "request": bigtable_table_admin.RestoreTableRequest( + parent=PARENT_NAME, + table_id=TABLE_NAME, + ) + }, + { + "request": { + "parent": PARENT_NAME, + "table_id": TABLE_NAME, + }, + }, + { + "request": bigtable_table_admin.RestoreTableRequest( + parent=PARENT_NAME, + table_id=TABLE_NAME, + ), + "retry": mock.Mock(spec=retries.Retry), + "timeout": mock.Mock(spec=retries.Retry), + "metadata": [("foo", "bar")], + }, + ], +) +def test_bigtable_table_admin_client_restore_table(kwargs): + client = BigtableTableAdminClient() + + with mock.patch.object(restore_table, "RestoreTableOperation") as future_mock: + with mock.patch.object(client, "_transport") as transport_mock: + with mock.patch.object(client, "_restore_table") as restore_table_mock: + operation_mock = mock.Mock() + restore_table_mock.return_value = operation_mock + client.restore_table(**kwargs) + + restore_table_mock.assert_called_once_with( + request=kwargs["request"], + retry=kwargs.get("retry", gapic_v1.method.DEFAULT), + timeout=kwargs.get("timeout", gapic_v1.method.DEFAULT), + metadata=kwargs.get("metadata", ()), + ) + future_mock.assert_called_once_with( + transport_mock.operations_client, operation_mock + ) + + +@pytest.mark.parametrize( + "kwargs", + [ + { + "request": bigtable_table_admin.CheckConsistencyRequest( + name=TABLE_NAME, + consistency_token=CONSISTENCY_TOKEN, + ) + }, + { + "request": { + "name": TABLE_NAME, + "consistency_token": CONSISTENCY_TOKEN, + }, + }, + { + "name": TABLE_NAME, + "consistency_token": CONSISTENCY_TOKEN, + }, + { + "request": bigtable_table_admin.CheckConsistencyRequest( + name=TABLE_NAME, + consistency_token=CONSISTENCY_TOKEN, + ), + "retry": mock.Mock(spec=retries.Retry), + "timeout": mock.Mock(spec=retries.Retry), + "metadata": [("foo", "bar")], + }, + ], +) +def test_bigtable_table_admin_client_wait_for_consistency(kwargs): + client = BigtableTableAdminClient() + + future = client.wait_for_consistency(**kwargs) + + assert isinstance(future, consistency.CheckConsistencyPollingFuture) + assert future._default_retry == kwargs.get("retry", gapic_v1.method.DEFAULT) + + check_consistency_call = future._check_consistency_call + assert isinstance(check_consistency_call, functools.partial) + + assert check_consistency_call.func == client.check_consistency + assert check_consistency_call.args == (kwargs.get("request", None),) + assert check_consistency_call.keywords == { + "name": kwargs.get("name", None), + "consistency_token": kwargs.get("consistency_token", None), + "timeout": kwargs.get("timeout", gapic_v1.method.DEFAULT), + "metadata": kwargs.get("metadata", ()), + } + + +@pytest.mark.parametrize( + "kwargs", + [ + { + "request": bigtable_table_admin.GenerateConsistencyTokenRequest( + name=TABLE_NAME, + ) + }, + { + "request": {"name": TABLE_NAME}, + }, + { + "name": TABLE_NAME, + }, + { + "request": bigtable_table_admin.GenerateConsistencyTokenRequest( + name=TABLE_NAME, + ), + "retry": mock.Mock(spec=retries.Retry), + "timeout": mock.Mock(spec=retries.Retry), + "metadata": [("foo", "bar")], + }, + ], +) +def test_bigtable_table_admin_client_wait_for_replication(kwargs): + client = BigtableTableAdminClient() + + with mock.patch.object(client, "generate_consistency_token") as generate_mock: + generate_mock.return_value = ( + bigtable_table_admin.GenerateConsistencyTokenResponse( + consistency_token=CONSISTENCY_TOKEN, + ) + ) + future = client.wait_for_replication(**kwargs) + + expected_check_consistency_request = ( + bigtable_table_admin.CheckConsistencyRequest( + name=TABLE_NAME, + consistency_token=CONSISTENCY_TOKEN, + ) + ) + + assert isinstance(future, consistency.CheckConsistencyPollingFuture) + assert future._default_retry == kwargs.get("retry", gapic_v1.method.DEFAULT) + + check_consistency_call = future._check_consistency_call + assert isinstance(check_consistency_call, functools.partial) + + assert check_consistency_call.func == client.check_consistency + assert check_consistency_call.args == (expected_check_consistency_request,) + assert check_consistency_call.keywords == { + "name": None, + "consistency_token": None, + "timeout": kwargs.get("timeout", gapic_v1.method.DEFAULT), + "metadata": kwargs.get("metadata", ()), + } diff --git a/tests/unit/admin_overlay/test_consistency.py b/tests/unit/admin_overlay/test_consistency.py new file mode 100644 index 000000000..b55aa03a5 --- /dev/null +++ b/tests/unit/admin_overlay/test_consistency.py @@ -0,0 +1,97 @@ +# -*- coding: utf-8 -*- +# Copyright 2025 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock +except ImportError: # pragma: NO COVER + import mock + +from google.api_core import retry as retries +from google.api_core import exceptions +from google.cloud.bigtable.admin_v2.overlay.types import consistency +from google.cloud.bigtable.admin_v2.types import bigtable_table_admin + +import pytest + + +TRUE_CONSISTENCY_RESPONSE = bigtable_table_admin.CheckConsistencyResponse( + consistent=True +) + +FALSE_CONSISTENCY_RESPONSE = bigtable_table_admin.CheckConsistencyResponse( + consistent=False +) + + +def mock_check_consistency_callable(max_poll_count=1): + # Return False max_poll_count - 1 times, then True, for a total of + # max_poll_count calls. + side_effect = [FALSE_CONSISTENCY_RESPONSE] * (max_poll_count - 1) + side_effect.append(TRUE_CONSISTENCY_RESPONSE) + return mock.Mock(spec=["__call__"], side_effect=side_effect) + + +def test_check_consistency_future_cancel(): + check_consistency_call = mock_check_consistency_callable() + future = consistency.CheckConsistencyPollingFuture(check_consistency_call) + with pytest.raises(NotImplementedError): + future.cancel() + + with pytest.raises(NotImplementedError): + future.cancelled() + + +def test_check_consistency_future_result(): + times = 5 + check_consistency_call = mock_check_consistency_callable(times) + future = consistency.CheckConsistencyPollingFuture(check_consistency_call) + is_consistent = future.result() + + assert is_consistent + check_consistency_call.assert_has_calls( + [mock.call(retry=future._default_retry)] * times + ) + + # Check that calling result again doesn't produce more calls. + is_consistent = future.result() + + assert is_consistent + check_consistency_call.assert_has_calls( + [mock.call(retry=future._default_retry)] * times + ) + + +def test_check_consistency_future_result_default_retry(): + times = 5 + check_consistency_call = mock_check_consistency_callable(times) + retry = mock.Mock(spec=retries.Retry) + future = consistency.CheckConsistencyPollingFuture( + check_consistency_call, default_retry=retry + ) + is_consistent = future.result() + + assert is_consistent + check_consistency_call.assert_has_calls([mock.call(retry=retry)] * times) + + +def test_check_consistency_future_result_different_retry(): + check_consistency_call = mock.Mock( + spec=["__call__"], side_effect=exceptions.DeadlineExceeded("Deadline Exceeded.") + ) + future = consistency.CheckConsistencyPollingFuture(check_consistency_call) + + with pytest.raises(exceptions.DeadlineExceeded): + future.result() diff --git a/tests/unit/admin_overlay/test_restore_table.py b/tests/unit/admin_overlay/test_restore_table.py new file mode 100644 index 000000000..f9cd2f4f0 --- /dev/null +++ b/tests/unit/admin_overlay/test_restore_table.py @@ -0,0 +1,201 @@ +# Copyright 2025 Google LLC. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# try/except added for compatibility with python < 3.8 +try: + from unittest import mock +except ImportError: # pragma: NO COVER + import mock + +from google.longrunning import operations_pb2 +from google.rpc import status_pb2, code_pb2 + +from google.api_core import operation, exceptions +from google.api_core.operations_v1 import operations_client +from google.cloud.bigtable.admin_v2.types import bigtable_table_admin, table +from google.cloud.bigtable.admin_v2.overlay.types import restore_table + +import pytest + + +# Set up the mock operations +DEFAULT_MAX_POLL = 3 +RESTORE_TABLE_OPERATION_TABLE_NAME = "Test Table" +RESTORE_TABLE_OPERATION_NAME = "test/restore_table" +RESTORE_TABLE_OPERATION_METADATA = bigtable_table_admin.RestoreTableMetadata( + name=RESTORE_TABLE_OPERATION_TABLE_NAME, +) +OPTIMIZE_RESTORED_TABLE_OPERATION_NAME = "test/optimize_restore_table" +OPTIMIZE_RESTORED_TABLE_METADATA = bigtable_table_admin.OptimizeRestoredTableMetadata( + name=RESTORE_TABLE_OPERATION_TABLE_NAME, +) + +OPTIMIZE_RESTORED_TABLE_OPERATION_ID = "abcdefg" +RESTORE_TABLE_OPERATION_FINISHED_RESPONSE = table.Table( + name=RESTORE_TABLE_OPERATION_TABLE_NAME, +) +RESTORE_TABLE_OPERATION_FINISHED_ERROR = status_pb2.Status( + code=code_pb2.DEADLINE_EXCEEDED, message="Deadline Exceeded" +) + + +def make_operation_proto( + name, done=False, metadata=None, response=None, error=None, **kwargs +): + operation_proto = operations_pb2.Operation(name=name, done=done, **kwargs) + + if metadata is not None: + operation_proto.metadata.Pack(metadata._pb) + + if response is not None: + operation_proto.response.Pack(response._pb) + + if error is not None: + operation_proto.error.CopyFrom(error) + + return operation_proto + + +RESTORE_TABLE_IN_PROGRESS_OPERATION_PROTO = make_operation_proto( + name=RESTORE_TABLE_OPERATION_NAME, + done=False, + metadata=RESTORE_TABLE_OPERATION_METADATA, +) + +OPTIMIZE_RESTORED_TABLE_OPERATION_PROTO = make_operation_proto( + name=OPTIMIZE_RESTORED_TABLE_OPERATION_NAME, + metadata=OPTIMIZE_RESTORED_TABLE_METADATA, +) + + +# Set up the mock operation client +def mock_restore_table_operation( + max_poll_count=DEFAULT_MAX_POLL, fail=False, has_optimize_operation=True +): + client = mock.Mock(spec=operations_client.OperationsClient) + + # Set up the polling + side_effect = [RESTORE_TABLE_IN_PROGRESS_OPERATION_PROTO] * (max_poll_count - 1) + finished_operation_metadata = bigtable_table_admin.RestoreTableMetadata() + bigtable_table_admin.RestoreTableMetadata.copy_from( + finished_operation_metadata, RESTORE_TABLE_OPERATION_METADATA + ) + if has_optimize_operation: + finished_operation_metadata.optimize_table_operation_name = ( + OPTIMIZE_RESTORED_TABLE_OPERATION_ID + ) + + if fail: + final_operation_proto = make_operation_proto( + name=RESTORE_TABLE_OPERATION_NAME, + done=True, + metadata=finished_operation_metadata, + error=RESTORE_TABLE_OPERATION_FINISHED_ERROR, + ) + else: + final_operation_proto = make_operation_proto( + name=RESTORE_TABLE_OPERATION_NAME, + done=True, + metadata=finished_operation_metadata, + response=RESTORE_TABLE_OPERATION_FINISHED_RESPONSE, + ) + side_effect.append(final_operation_proto) + refresh = mock.Mock(spec=["__call__"], side_effect=side_effect) + cancel = mock.Mock(spec=["__call__"]) + future = operation.Operation( + RESTORE_TABLE_IN_PROGRESS_OPERATION_PROTO, + refresh, + cancel, + result_type=table.Table, + metadata_type=bigtable_table_admin.RestoreTableMetadata, + ) + + # Set up the optimize_restore_table_operation + client.get_operation.side_effect = [OPTIMIZE_RESTORED_TABLE_OPERATION_PROTO] + + return restore_table.RestoreTableOperation(client, future) + + +def test_restore_table_operation_client_success_has_optimize(): + restore_table_operation = mock_restore_table_operation() + + optimize_restored_table_operation = ( + restore_table_operation.optimize_restored_table_operation() + ) + + assert isinstance(optimize_restored_table_operation, operation.Operation) + assert ( + optimize_restored_table_operation._operation + == OPTIMIZE_RESTORED_TABLE_OPERATION_PROTO + ) + restore_table_operation._operations_client.get_operation.assert_called_with( + name=OPTIMIZE_RESTORED_TABLE_OPERATION_ID + ) + restore_table_operation._refresh.assert_has_calls([mock.call()] * DEFAULT_MAX_POLL) + + +@pytest.mark.parametrize( + "input_timeout,expected_timeout", + [ + (restore_table.Timeout.DEFAULT_TIMEOUT, operation.Operation._DEFAULT_VALUE), + (100, 100), + ], +) +def test_restore_table_timeouts(input_timeout, expected_timeout): + restore_table_operation = mock_restore_table_operation() + with mock.patch.object(restore_table_operation, "_blocking_poll") as poll_mock: + restore_table_operation.optimize_restored_table_operation(timeout=input_timeout) + poll_mock.assert_called_once_with( + timeout=expected_timeout, retry=None, polling=None + ) + + +def test_restore_table_operation_success_has_optimize_also_call_result(): + restore_table_operation = mock_restore_table_operation() + + restore_table_operation.result() + optimize_restored_table_operation = ( + restore_table_operation.optimize_restored_table_operation() + ) + + assert isinstance(optimize_restored_table_operation, operation.Operation) + assert ( + optimize_restored_table_operation._operation + == OPTIMIZE_RESTORED_TABLE_OPERATION_PROTO + ) + restore_table_operation._operations_client.get_operation.assert_called_with( + name=OPTIMIZE_RESTORED_TABLE_OPERATION_ID + ) + restore_table_operation._refresh.assert_has_calls([mock.call()] * DEFAULT_MAX_POLL) + + +def test_restore_table_operation_success_no_optimize(): + restore_table_operation = mock_restore_table_operation(has_optimize_operation=False) + + restore_table_operation.result() + optimize_restored_table_operation = ( + restore_table_operation.optimize_restored_table_operation() + ) + + assert optimize_restored_table_operation is None + restore_table_operation._operations_client.get_operation.assert_not_called() + + +def test_restore_table_operation_exception(): + restore_table_operation = mock_restore_table_operation( + fail=True, has_optimize_operation=False + ) + + with pytest.raises(exceptions.GoogleAPICallError): + restore_table_operation.optimize_restored_table_operation() diff --git a/tests/unit/gapic/bigtable_admin_v2/__init__.py b/tests/unit/gapic/admin_v2/__init__.py similarity index 100% rename from tests/unit/gapic/bigtable_admin_v2/__init__.py rename to tests/unit/gapic/admin_v2/__init__.py diff --git a/tests/unit/gapic/bigtable_admin_v2/test_bigtable_instance_admin.py b/tests/unit/gapic/admin_v2/test_bigtable_instance_admin.py similarity index 99% rename from tests/unit/gapic/bigtable_admin_v2/test_bigtable_instance_admin.py rename to tests/unit/gapic/admin_v2/test_bigtable_instance_admin.py index 69bad1c7b..4d33ea327 100644 --- a/tests/unit/gapic/bigtable_admin_v2/test_bigtable_instance_admin.py +++ b/tests/unit/gapic/admin_v2/test_bigtable_instance_admin.py @@ -57,18 +57,18 @@ from google.api_core import retry as retries from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( +from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import ( BigtableInstanceAdminAsyncClient, ) -from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( +from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) -from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import pagers -from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import transports -from google.cloud.bigtable_admin_v2.types import bigtable_instance_admin -from google.cloud.bigtable_admin_v2.types import common -from google.cloud.bigtable_admin_v2.types import instance -from google.cloud.bigtable_admin_v2.types import instance as gba_instance +from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import pagers +from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import transports +from google.cloud.bigtable.admin_v2.types import bigtable_instance_admin +from google.cloud.bigtable.admin_v2.types import common +from google.cloud.bigtable.admin_v2.types import instance +from google.cloud.bigtable.admin_v2.types import instance as gba_instance from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import options_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore @@ -1104,7 +1104,7 @@ def test_bigtable_instance_admin_client_client_options_credentials_file( def test_bigtable_instance_admin_client_client_options_from_dict(): with mock.patch( - "google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.transports.BigtableInstanceAdminGrpcTransport.__init__" + "google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.transports.BigtableInstanceAdminGrpcTransport.__init__" ) as grpc_transport: grpc_transport.return_value = None client = BigtableInstanceAdminClient( @@ -9000,6 +9000,7 @@ def test_get_logical_view(request_type, transport: str = "grpc"): name="name_value", query="query_value", etag="etag_value", + deletion_protection=True, ) response = client.get_logical_view(request) @@ -9014,6 +9015,7 @@ def test_get_logical_view(request_type, transport: str = "grpc"): assert response.name == "name_value" assert response.query == "query_value" assert response.etag == "etag_value" + assert response.deletion_protection is True def test_get_logical_view_non_empty_request_with_auto_populated_field(): @@ -9145,6 +9147,7 @@ async def test_get_logical_view_async( name="name_value", query="query_value", etag="etag_value", + deletion_protection=True, ) ) response = await client.get_logical_view(request) @@ -9160,6 +9163,7 @@ async def test_get_logical_view_async( assert response.name == "name_value" assert response.query == "query_value" assert response.etag == "etag_value" + assert response.deletion_protection is True @pytest.mark.asyncio @@ -19861,6 +19865,7 @@ async def test_get_logical_view_empty_call_grpc_asyncio(): name="name_value", query="query_value", etag="etag_value", + deletion_protection=True, ) ) await client.get_logical_view(request=None) @@ -23249,6 +23254,7 @@ def test_create_logical_view_rest_call_success(request_type): "name": "name_value", "query": "query_value", "etag": "etag_value", + "deletion_protection": True, } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency @@ -23452,6 +23458,7 @@ def test_get_logical_view_rest_call_success(request_type): name="name_value", query="query_value", etag="etag_value", + deletion_protection=True, ) # Wrap the value into a proper Response obj @@ -23471,6 +23478,7 @@ def test_get_logical_view_rest_call_success(request_type): assert response.name == "name_value" assert response.query == "query_value" assert response.etag == "etag_value" + assert response.deletion_protection is True @pytest.mark.parametrize("null_interceptor", [True, False]) @@ -23720,6 +23728,7 @@ def test_update_logical_view_rest_call_success(request_type): "name": "projects/sample1/instances/sample2/logicalViews/sample3", "query": "query_value", "etag": "etag_value", + "deletion_protection": True, } # The version of a generated dependency at test runtime may differ from the version used during generation. # Delete any fields which are not present in the current runtime dependency @@ -25475,7 +25484,7 @@ def test_bigtable_instance_admin_base_transport_error(): def test_bigtable_instance_admin_base_transport(): # Instantiate the base transport. with mock.patch( - "google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.transports.BigtableInstanceAdminTransport.__init__" + "google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.transports.BigtableInstanceAdminTransport.__init__" ) as Transport: Transport.return_value = None transport = transports.BigtableInstanceAdminTransport( @@ -25543,7 +25552,7 @@ def test_bigtable_instance_admin_base_transport_with_credentials_file(): with mock.patch.object( google.auth, "load_credentials_from_file", autospec=True ) as load_creds, mock.patch( - "google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.transports.BigtableInstanceAdminTransport._prep_wrapped_messages" + "google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.transports.BigtableInstanceAdminTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) @@ -25570,7 +25579,7 @@ def test_bigtable_instance_admin_base_transport_with_credentials_file(): def test_bigtable_instance_admin_base_transport_with_adc(): # Test the default credentials are used if credentials and credentials_file are None. with mock.patch.object(google.auth, "default", autospec=True) as adc, mock.patch( - "google.cloud.bigtable_admin_v2.services.bigtable_instance_admin.transports.BigtableInstanceAdminTransport._prep_wrapped_messages" + "google.cloud.bigtable.admin_v2.services.bigtable_instance_admin.transports.BigtableInstanceAdminTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None adc.return_value = (ga_credentials.AnonymousCredentials(), None) diff --git a/tests/unit/gapic/bigtable_admin_v2/test_bigtable_table_admin.py b/tests/unit/gapic/admin_v2/test_bigtable_table_admin.py similarity index 94% rename from tests/unit/gapic/bigtable_admin_v2/test_bigtable_table_admin.py rename to tests/unit/gapic/admin_v2/test_bigtable_table_admin.py index 67b4302c9..4a0e4e0f8 100644 --- a/tests/unit/gapic/bigtable_admin_v2/test_bigtable_table_admin.py +++ b/tests/unit/gapic/admin_v2/test_bigtable_table_admin.py @@ -57,18 +57,18 @@ from google.api_core import retry as retries from google.auth import credentials as ga_credentials from google.auth.exceptions import MutualTLSChannelError -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( - BigtableTableAdminAsyncClient, +from google.cloud.bigtable.admin_v2.services.bigtable_table_admin import ( + BaseBigtableTableAdminAsyncClient, ) -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( - BigtableTableAdminClient, +from google.cloud.bigtable.admin_v2.services.bigtable_table_admin import ( + BaseBigtableTableAdminClient, ) -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import pagers -from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import transports -from google.cloud.bigtable_admin_v2.types import bigtable_table_admin -from google.cloud.bigtable_admin_v2.types import table -from google.cloud.bigtable_admin_v2.types import table as gba_table -from google.cloud.bigtable_admin_v2.types import types +from google.cloud.bigtable.admin_v2.services.bigtable_table_admin import pagers +from google.cloud.bigtable.admin_v2.services.bigtable_table_admin import transports +from google.cloud.bigtable.admin_v2.types import bigtable_table_admin +from google.cloud.bigtable.admin_v2.types import table +from google.cloud.bigtable.admin_v2.types import table as gba_table +from google.cloud.bigtable.admin_v2.types import types from google.iam.v1 import iam_policy_pb2 # type: ignore from google.iam.v1 import options_pb2 # type: ignore from google.iam.v1 import policy_pb2 # type: ignore @@ -138,45 +138,45 @@ def test__get_default_mtls_endpoint(): sandbox_mtls_endpoint = "example.mtls.sandbox.googleapis.com" non_googleapi = "api.example.com" - assert BigtableTableAdminClient._get_default_mtls_endpoint(None) is None + assert BaseBigtableTableAdminClient._get_default_mtls_endpoint(None) is None assert ( - BigtableTableAdminClient._get_default_mtls_endpoint(api_endpoint) + BaseBigtableTableAdminClient._get_default_mtls_endpoint(api_endpoint) == api_mtls_endpoint ) assert ( - BigtableTableAdminClient._get_default_mtls_endpoint(api_mtls_endpoint) + BaseBigtableTableAdminClient._get_default_mtls_endpoint(api_mtls_endpoint) == api_mtls_endpoint ) assert ( - BigtableTableAdminClient._get_default_mtls_endpoint(sandbox_endpoint) + BaseBigtableTableAdminClient._get_default_mtls_endpoint(sandbox_endpoint) == sandbox_mtls_endpoint ) assert ( - BigtableTableAdminClient._get_default_mtls_endpoint(sandbox_mtls_endpoint) + BaseBigtableTableAdminClient._get_default_mtls_endpoint(sandbox_mtls_endpoint) == sandbox_mtls_endpoint ) assert ( - BigtableTableAdminClient._get_default_mtls_endpoint(non_googleapi) + BaseBigtableTableAdminClient._get_default_mtls_endpoint(non_googleapi) == non_googleapi ) def test__read_environment_variables(): - assert BigtableTableAdminClient._read_environment_variables() == ( + assert BaseBigtableTableAdminClient._read_environment_variables() == ( False, "auto", None, ) with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "true"}): - assert BigtableTableAdminClient._read_environment_variables() == ( + assert BaseBigtableTableAdminClient._read_environment_variables() == ( True, "auto", None, ) with mock.patch.dict(os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "false"}): - assert BigtableTableAdminClient._read_environment_variables() == ( + assert BaseBigtableTableAdminClient._read_environment_variables() == ( False, "auto", None, @@ -186,28 +186,28 @@ def test__read_environment_variables(): os.environ, {"GOOGLE_API_USE_CLIENT_CERTIFICATE": "Unsupported"} ): with pytest.raises(ValueError) as excinfo: - BigtableTableAdminClient._read_environment_variables() + BaseBigtableTableAdminClient._read_environment_variables() assert ( str(excinfo.value) == "Environment variable `GOOGLE_API_USE_CLIENT_CERTIFICATE` must be either `true` or `false`" ) with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "never"}): - assert BigtableTableAdminClient._read_environment_variables() == ( + assert BaseBigtableTableAdminClient._read_environment_variables() == ( False, "never", None, ) with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "always"}): - assert BigtableTableAdminClient._read_environment_variables() == ( + assert BaseBigtableTableAdminClient._read_environment_variables() == ( False, "always", None, ) with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}): - assert BigtableTableAdminClient._read_environment_variables() == ( + assert BaseBigtableTableAdminClient._read_environment_variables() == ( False, "auto", None, @@ -215,14 +215,14 @@ def test__read_environment_variables(): with mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "Unsupported"}): with pytest.raises(MutualTLSChannelError) as excinfo: - BigtableTableAdminClient._read_environment_variables() + BaseBigtableTableAdminClient._read_environment_variables() assert ( str(excinfo.value) == "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`" ) with mock.patch.dict(os.environ, {"GOOGLE_CLOUD_UNIVERSE_DOMAIN": "foo.com"}): - assert BigtableTableAdminClient._read_environment_variables() == ( + assert BaseBigtableTableAdminClient._read_environment_variables() == ( False, "auto", "foo.com", @@ -233,15 +233,15 @@ def test__get_client_cert_source(): mock_provided_cert_source = mock.Mock() mock_default_cert_source = mock.Mock() - assert BigtableTableAdminClient._get_client_cert_source(None, False) is None + assert BaseBigtableTableAdminClient._get_client_cert_source(None, False) is None assert ( - BigtableTableAdminClient._get_client_cert_source( + BaseBigtableTableAdminClient._get_client_cert_source( mock_provided_cert_source, False ) is None ) assert ( - BigtableTableAdminClient._get_client_cert_source( + BaseBigtableTableAdminClient._get_client_cert_source( mock_provided_cert_source, True ) == mock_provided_cert_source @@ -255,11 +255,11 @@ def test__get_client_cert_source(): return_value=mock_default_cert_source, ): assert ( - BigtableTableAdminClient._get_client_cert_source(None, True) + BaseBigtableTableAdminClient._get_client_cert_source(None, True) is mock_default_cert_source ) assert ( - BigtableTableAdminClient._get_client_cert_source( + BaseBigtableTableAdminClient._get_client_cert_source( mock_provided_cert_source, "true" ) is mock_provided_cert_source @@ -267,68 +267,72 @@ def test__get_client_cert_source(): @mock.patch.object( - BigtableTableAdminClient, + BaseBigtableTableAdminClient, "_DEFAULT_ENDPOINT_TEMPLATE", - modify_default_endpoint_template(BigtableTableAdminClient), + modify_default_endpoint_template(BaseBigtableTableAdminClient), ) @mock.patch.object( - BigtableTableAdminAsyncClient, + BaseBigtableTableAdminAsyncClient, "_DEFAULT_ENDPOINT_TEMPLATE", - modify_default_endpoint_template(BigtableTableAdminAsyncClient), + modify_default_endpoint_template(BaseBigtableTableAdminAsyncClient), ) def test__get_api_endpoint(): api_override = "foo.com" mock_client_cert_source = mock.Mock() - default_universe = BigtableTableAdminClient._DEFAULT_UNIVERSE - default_endpoint = BigtableTableAdminClient._DEFAULT_ENDPOINT_TEMPLATE.format( + default_universe = BaseBigtableTableAdminClient._DEFAULT_UNIVERSE + default_endpoint = BaseBigtableTableAdminClient._DEFAULT_ENDPOINT_TEMPLATE.format( UNIVERSE_DOMAIN=default_universe ) mock_universe = "bar.com" - mock_endpoint = BigtableTableAdminClient._DEFAULT_ENDPOINT_TEMPLATE.format( + mock_endpoint = BaseBigtableTableAdminClient._DEFAULT_ENDPOINT_TEMPLATE.format( UNIVERSE_DOMAIN=mock_universe ) assert ( - BigtableTableAdminClient._get_api_endpoint( + BaseBigtableTableAdminClient._get_api_endpoint( api_override, mock_client_cert_source, default_universe, "always" ) == api_override ) assert ( - BigtableTableAdminClient._get_api_endpoint( + BaseBigtableTableAdminClient._get_api_endpoint( None, mock_client_cert_source, default_universe, "auto" ) - == BigtableTableAdminClient.DEFAULT_MTLS_ENDPOINT + == BaseBigtableTableAdminClient.DEFAULT_MTLS_ENDPOINT ) assert ( - BigtableTableAdminClient._get_api_endpoint(None, None, default_universe, "auto") + BaseBigtableTableAdminClient._get_api_endpoint( + None, None, default_universe, "auto" + ) == default_endpoint ) assert ( - BigtableTableAdminClient._get_api_endpoint( + BaseBigtableTableAdminClient._get_api_endpoint( None, None, default_universe, "always" ) - == BigtableTableAdminClient.DEFAULT_MTLS_ENDPOINT + == BaseBigtableTableAdminClient.DEFAULT_MTLS_ENDPOINT ) assert ( - BigtableTableAdminClient._get_api_endpoint( + BaseBigtableTableAdminClient._get_api_endpoint( None, mock_client_cert_source, default_universe, "always" ) - == BigtableTableAdminClient.DEFAULT_MTLS_ENDPOINT + == BaseBigtableTableAdminClient.DEFAULT_MTLS_ENDPOINT ) assert ( - BigtableTableAdminClient._get_api_endpoint(None, None, mock_universe, "never") + BaseBigtableTableAdminClient._get_api_endpoint( + None, None, mock_universe, "never" + ) == mock_endpoint ) assert ( - BigtableTableAdminClient._get_api_endpoint( + BaseBigtableTableAdminClient._get_api_endpoint( None, None, default_universe, "never" ) == default_endpoint ) with pytest.raises(MutualTLSChannelError) as excinfo: - BigtableTableAdminClient._get_api_endpoint( + BaseBigtableTableAdminClient._get_api_endpoint( None, mock_client_cert_source, mock_universe, "auto" ) assert ( @@ -342,22 +346,22 @@ def test__get_universe_domain(): universe_domain_env = "bar.com" assert ( - BigtableTableAdminClient._get_universe_domain( + BaseBigtableTableAdminClient._get_universe_domain( client_universe_domain, universe_domain_env ) == client_universe_domain ) assert ( - BigtableTableAdminClient._get_universe_domain(None, universe_domain_env) + BaseBigtableTableAdminClient._get_universe_domain(None, universe_domain_env) == universe_domain_env ) assert ( - BigtableTableAdminClient._get_universe_domain(None, None) - == BigtableTableAdminClient._DEFAULT_UNIVERSE + BaseBigtableTableAdminClient._get_universe_domain(None, None) + == BaseBigtableTableAdminClient._DEFAULT_UNIVERSE ) with pytest.raises(ValueError) as excinfo: - BigtableTableAdminClient._get_universe_domain("", None) + BaseBigtableTableAdminClient._get_universe_domain("", None) assert str(excinfo.value) == "Universe Domain cannot be an empty string." @@ -377,7 +381,7 @@ def test__get_universe_domain(): def test__add_cred_info_for_auth_errors(error_code, cred_info_json, show_cred_info): cred = mock.Mock(["get_cred_info"]) cred.get_cred_info = mock.Mock(return_value=cred_info_json) - client = BigtableTableAdminClient(credentials=cred) + client = BaseBigtableTableAdminClient(credentials=cred) client._transport._credentials = cred error = core_exceptions.GoogleAPICallError("message", details=["foo"]) @@ -394,7 +398,7 @@ def test__add_cred_info_for_auth_errors(error_code, cred_info_json, show_cred_in def test__add_cred_info_for_auth_errors_no_get_cred_info(error_code): cred = mock.Mock([]) assert not hasattr(cred, "get_cred_info") - client = BigtableTableAdminClient(credentials=cred) + client = BaseBigtableTableAdminClient(credentials=cred) client._transport._credentials = cred error = core_exceptions.GoogleAPICallError("message", details=[]) @@ -407,12 +411,12 @@ def test__add_cred_info_for_auth_errors_no_get_cred_info(error_code): @pytest.mark.parametrize( "client_class,transport_name", [ - (BigtableTableAdminClient, "grpc"), - (BigtableTableAdminAsyncClient, "grpc_asyncio"), - (BigtableTableAdminClient, "rest"), + (BaseBigtableTableAdminClient, "grpc"), + (BaseBigtableTableAdminAsyncClient, "grpc_asyncio"), + (BaseBigtableTableAdminClient, "rest"), ], ) -def test_bigtable_table_admin_client_from_service_account_info( +def test_base_bigtable_table_admin_client_from_service_account_info( client_class, transport_name ): creds = ga_credentials.AnonymousCredentials() @@ -440,7 +444,7 @@ def test_bigtable_table_admin_client_from_service_account_info( (transports.BigtableTableAdminRestTransport, "rest"), ], ) -def test_bigtable_table_admin_client_service_account_always_use_jwt( +def test_base_bigtable_table_admin_client_service_account_always_use_jwt( transport_class, transport_name ): with mock.patch.object( @@ -461,12 +465,12 @@ def test_bigtable_table_admin_client_service_account_always_use_jwt( @pytest.mark.parametrize( "client_class,transport_name", [ - (BigtableTableAdminClient, "grpc"), - (BigtableTableAdminAsyncClient, "grpc_asyncio"), - (BigtableTableAdminClient, "rest"), + (BaseBigtableTableAdminClient, "grpc"), + (BaseBigtableTableAdminAsyncClient, "grpc_asyncio"), + (BaseBigtableTableAdminClient, "rest"), ], ) -def test_bigtable_table_admin_client_from_service_account_file( +def test_base_bigtable_table_admin_client_from_service_account_file( client_class, transport_name ): creds = ga_credentials.AnonymousCredentials() @@ -493,51 +497,59 @@ def test_bigtable_table_admin_client_from_service_account_file( ) -def test_bigtable_table_admin_client_get_transport_class(): - transport = BigtableTableAdminClient.get_transport_class() +def test_base_bigtable_table_admin_client_get_transport_class(): + transport = BaseBigtableTableAdminClient.get_transport_class() available_transports = [ transports.BigtableTableAdminGrpcTransport, transports.BigtableTableAdminRestTransport, ] assert transport in available_transports - transport = BigtableTableAdminClient.get_transport_class("grpc") + transport = BaseBigtableTableAdminClient.get_transport_class("grpc") assert transport == transports.BigtableTableAdminGrpcTransport @pytest.mark.parametrize( "client_class,transport_class,transport_name", [ - (BigtableTableAdminClient, transports.BigtableTableAdminGrpcTransport, "grpc"), ( - BigtableTableAdminAsyncClient, + BaseBigtableTableAdminClient, + transports.BigtableTableAdminGrpcTransport, + "grpc", + ), + ( + BaseBigtableTableAdminAsyncClient, transports.BigtableTableAdminGrpcAsyncIOTransport, "grpc_asyncio", ), - (BigtableTableAdminClient, transports.BigtableTableAdminRestTransport, "rest"), + ( + BaseBigtableTableAdminClient, + transports.BigtableTableAdminRestTransport, + "rest", + ), ], ) @mock.patch.object( - BigtableTableAdminClient, + BaseBigtableTableAdminClient, "_DEFAULT_ENDPOINT_TEMPLATE", - modify_default_endpoint_template(BigtableTableAdminClient), + modify_default_endpoint_template(BaseBigtableTableAdminClient), ) @mock.patch.object( - BigtableTableAdminAsyncClient, + BaseBigtableTableAdminAsyncClient, "_DEFAULT_ENDPOINT_TEMPLATE", - modify_default_endpoint_template(BigtableTableAdminAsyncClient), + modify_default_endpoint_template(BaseBigtableTableAdminAsyncClient), ) -def test_bigtable_table_admin_client_client_options( +def test_base_bigtable_table_admin_client_client_options( client_class, transport_class, transport_name ): # Check that if channel is provided we won't create a new one. - with mock.patch.object(BigtableTableAdminClient, "get_transport_class") as gtc: + with mock.patch.object(BaseBigtableTableAdminClient, "get_transport_class") as gtc: transport = transport_class(credentials=ga_credentials.AnonymousCredentials()) client = client_class(transport=transport) gtc.assert_not_called() # Check that if channel is provided via str we will create a new one. - with mock.patch.object(BigtableTableAdminClient, "get_transport_class") as gtc: + with mock.patch.object(BaseBigtableTableAdminClient, "get_transport_class") as gtc: client = client_class(transport=transport_name) gtc.assert_called() @@ -661,37 +673,37 @@ def test_bigtable_table_admin_client_client_options( "client_class,transport_class,transport_name,use_client_cert_env", [ ( - BigtableTableAdminClient, + BaseBigtableTableAdminClient, transports.BigtableTableAdminGrpcTransport, "grpc", "true", ), ( - BigtableTableAdminAsyncClient, + BaseBigtableTableAdminAsyncClient, transports.BigtableTableAdminGrpcAsyncIOTransport, "grpc_asyncio", "true", ), ( - BigtableTableAdminClient, + BaseBigtableTableAdminClient, transports.BigtableTableAdminGrpcTransport, "grpc", "false", ), ( - BigtableTableAdminAsyncClient, + BaseBigtableTableAdminAsyncClient, transports.BigtableTableAdminGrpcAsyncIOTransport, "grpc_asyncio", "false", ), ( - BigtableTableAdminClient, + BaseBigtableTableAdminClient, transports.BigtableTableAdminRestTransport, "rest", "true", ), ( - BigtableTableAdminClient, + BaseBigtableTableAdminClient, transports.BigtableTableAdminRestTransport, "rest", "false", @@ -699,17 +711,17 @@ def test_bigtable_table_admin_client_client_options( ], ) @mock.patch.object( - BigtableTableAdminClient, + BaseBigtableTableAdminClient, "_DEFAULT_ENDPOINT_TEMPLATE", - modify_default_endpoint_template(BigtableTableAdminClient), + modify_default_endpoint_template(BaseBigtableTableAdminClient), ) @mock.patch.object( - BigtableTableAdminAsyncClient, + BaseBigtableTableAdminAsyncClient, "_DEFAULT_ENDPOINT_TEMPLATE", - modify_default_endpoint_template(BigtableTableAdminAsyncClient), + modify_default_endpoint_template(BaseBigtableTableAdminAsyncClient), ) @mock.patch.dict(os.environ, {"GOOGLE_API_USE_MTLS_ENDPOINT": "auto"}) -def test_bigtable_table_admin_client_mtls_env_auto( +def test_base_bigtable_table_admin_client_mtls_env_auto( client_class, transport_class, transport_name, use_client_cert_env ): # This tests the endpoint autoswitch behavior. Endpoint is autoswitched to the default @@ -812,19 +824,21 @@ def test_bigtable_table_admin_client_mtls_env_auto( @pytest.mark.parametrize( - "client_class", [BigtableTableAdminClient, BigtableTableAdminAsyncClient] + "client_class", [BaseBigtableTableAdminClient, BaseBigtableTableAdminAsyncClient] ) @mock.patch.object( - BigtableTableAdminClient, + BaseBigtableTableAdminClient, "DEFAULT_ENDPOINT", - modify_default_endpoint(BigtableTableAdminClient), + modify_default_endpoint(BaseBigtableTableAdminClient), ) @mock.patch.object( - BigtableTableAdminAsyncClient, + BaseBigtableTableAdminAsyncClient, "DEFAULT_ENDPOINT", - modify_default_endpoint(BigtableTableAdminAsyncClient), + modify_default_endpoint(BaseBigtableTableAdminAsyncClient), ) -def test_bigtable_table_admin_client_get_mtls_endpoint_and_cert_source(client_class): +def test_base_bigtable_table_admin_client_get_mtls_endpoint_and_cert_source( + client_class, +): mock_client_cert_source = mock.Mock() # Test the case GOOGLE_API_USE_CLIENT_CERTIFICATE is "true". @@ -916,27 +930,27 @@ def test_bigtable_table_admin_client_get_mtls_endpoint_and_cert_source(client_cl @pytest.mark.parametrize( - "client_class", [BigtableTableAdminClient, BigtableTableAdminAsyncClient] + "client_class", [BaseBigtableTableAdminClient, BaseBigtableTableAdminAsyncClient] ) @mock.patch.object( - BigtableTableAdminClient, + BaseBigtableTableAdminClient, "_DEFAULT_ENDPOINT_TEMPLATE", - modify_default_endpoint_template(BigtableTableAdminClient), + modify_default_endpoint_template(BaseBigtableTableAdminClient), ) @mock.patch.object( - BigtableTableAdminAsyncClient, + BaseBigtableTableAdminAsyncClient, "_DEFAULT_ENDPOINT_TEMPLATE", - modify_default_endpoint_template(BigtableTableAdminAsyncClient), + modify_default_endpoint_template(BaseBigtableTableAdminAsyncClient), ) -def test_bigtable_table_admin_client_client_api_endpoint(client_class): +def test_base_bigtable_table_admin_client_client_api_endpoint(client_class): mock_client_cert_source = client_cert_source_callback api_override = "foo.com" - default_universe = BigtableTableAdminClient._DEFAULT_UNIVERSE - default_endpoint = BigtableTableAdminClient._DEFAULT_ENDPOINT_TEMPLATE.format( + default_universe = BaseBigtableTableAdminClient._DEFAULT_UNIVERSE + default_endpoint = BaseBigtableTableAdminClient._DEFAULT_ENDPOINT_TEMPLATE.format( UNIVERSE_DOMAIN=default_universe ) mock_universe = "bar.com" - mock_endpoint = BigtableTableAdminClient._DEFAULT_ENDPOINT_TEMPLATE.format( + mock_endpoint = BaseBigtableTableAdminClient._DEFAULT_ENDPOINT_TEMPLATE.format( UNIVERSE_DOMAIN=mock_universe ) @@ -1004,16 +1018,24 @@ def test_bigtable_table_admin_client_client_api_endpoint(client_class): @pytest.mark.parametrize( "client_class,transport_class,transport_name", [ - (BigtableTableAdminClient, transports.BigtableTableAdminGrpcTransport, "grpc"), ( - BigtableTableAdminAsyncClient, + BaseBigtableTableAdminClient, + transports.BigtableTableAdminGrpcTransport, + "grpc", + ), + ( + BaseBigtableTableAdminAsyncClient, transports.BigtableTableAdminGrpcAsyncIOTransport, "grpc_asyncio", ), - (BigtableTableAdminClient, transports.BigtableTableAdminRestTransport, "rest"), + ( + BaseBigtableTableAdminClient, + transports.BigtableTableAdminRestTransport, + "rest", + ), ], ) -def test_bigtable_table_admin_client_client_options_scopes( +def test_base_bigtable_table_admin_client_client_options_scopes( client_class, transport_class, transport_name ): # Check the case scopes are provided. @@ -1042,26 +1064,26 @@ def test_bigtable_table_admin_client_client_options_scopes( "client_class,transport_class,transport_name,grpc_helpers", [ ( - BigtableTableAdminClient, + BaseBigtableTableAdminClient, transports.BigtableTableAdminGrpcTransport, "grpc", grpc_helpers, ), ( - BigtableTableAdminAsyncClient, + BaseBigtableTableAdminAsyncClient, transports.BigtableTableAdminGrpcAsyncIOTransport, "grpc_asyncio", grpc_helpers_async, ), ( - BigtableTableAdminClient, + BaseBigtableTableAdminClient, transports.BigtableTableAdminRestTransport, "rest", None, ), ], ) -def test_bigtable_table_admin_client_client_options_credentials_file( +def test_base_bigtable_table_admin_client_client_options_credentials_file( client_class, transport_class, transport_name, grpc_helpers ): # Check the case credentials file is provided. @@ -1085,12 +1107,12 @@ def test_bigtable_table_admin_client_client_options_credentials_file( ) -def test_bigtable_table_admin_client_client_options_from_dict(): +def test_base_bigtable_table_admin_client_client_options_from_dict(): with mock.patch( - "google.cloud.bigtable_admin_v2.services.bigtable_table_admin.transports.BigtableTableAdminGrpcTransport.__init__" + "google.cloud.bigtable.admin_v2.services.bigtable_table_admin.transports.BigtableTableAdminGrpcTransport.__init__" ) as grpc_transport: grpc_transport.return_value = None - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( client_options={"api_endpoint": "squid.clam.whelk"} ) grpc_transport.assert_called_once_with( @@ -1110,20 +1132,20 @@ def test_bigtable_table_admin_client_client_options_from_dict(): "client_class,transport_class,transport_name,grpc_helpers", [ ( - BigtableTableAdminClient, + BaseBigtableTableAdminClient, transports.BigtableTableAdminGrpcTransport, "grpc", grpc_helpers, ), ( - BigtableTableAdminAsyncClient, + BaseBigtableTableAdminAsyncClient, transports.BigtableTableAdminGrpcAsyncIOTransport, "grpc_asyncio", grpc_helpers_async, ), ], ) -def test_bigtable_table_admin_client_create_channel_credentials_file( +def test_base_bigtable_table_admin_client_create_channel_credentials_file( client_class, transport_class, transport_name, grpc_helpers ): # Check the case credentials file is provided. @@ -1190,7 +1212,7 @@ def test_bigtable_table_admin_client_create_channel_credentials_file( ], ) def test_create_table(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1225,7 +1247,7 @@ def test_create_table(request_type, transport: str = "grpc"): def test_create_table_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1256,7 +1278,7 @@ def test_create_table_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1294,7 +1316,7 @@ async def test_create_table_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -1334,7 +1356,7 @@ async def test_create_table_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.CreateTableRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -1374,7 +1396,7 @@ async def test_create_table_async_from_dict(): def test_create_table_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -1404,7 +1426,7 @@ def test_create_table_field_headers(): @pytest.mark.asyncio async def test_create_table_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -1433,7 +1455,7 @@ async def test_create_table_field_headers_async(): def test_create_table_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -1465,7 +1487,7 @@ def test_create_table_flattened(): def test_create_table_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -1482,7 +1504,7 @@ def test_create_table_flattened_error(): @pytest.mark.asyncio async def test_create_table_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -1517,7 +1539,7 @@ async def test_create_table_flattened_async(): @pytest.mark.asyncio async def test_create_table_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -1540,7 +1562,7 @@ async def test_create_table_flattened_error_async(): ], ) def test_create_table_from_snapshot(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1570,7 +1592,7 @@ def test_create_table_from_snapshot(request_type, transport: str = "grpc"): def test_create_table_from_snapshot_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1605,7 +1627,7 @@ def test_create_table_from_snapshot_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1653,7 +1675,7 @@ async def test_create_table_from_snapshot_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -1698,7 +1720,7 @@ async def test_create_table_from_snapshot_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.CreateTableFromSnapshotRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -1733,7 +1755,7 @@ async def test_create_table_from_snapshot_async_from_dict(): def test_create_table_from_snapshot_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -1765,7 +1787,7 @@ def test_create_table_from_snapshot_field_headers(): @pytest.mark.asyncio async def test_create_table_from_snapshot_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -1798,7 +1820,7 @@ async def test_create_table_from_snapshot_field_headers_async(): def test_create_table_from_snapshot_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -1832,7 +1854,7 @@ def test_create_table_from_snapshot_flattened(): def test_create_table_from_snapshot_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -1849,7 +1871,7 @@ def test_create_table_from_snapshot_flattened_error(): @pytest.mark.asyncio async def test_create_table_from_snapshot_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -1888,7 +1910,7 @@ async def test_create_table_from_snapshot_flattened_async(): @pytest.mark.asyncio async def test_create_table_from_snapshot_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -1911,7 +1933,7 @@ async def test_create_table_from_snapshot_flattened_error_async(): ], ) def test_list_tables(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -1942,7 +1964,7 @@ def test_list_tables(request_type, transport: str = "grpc"): def test_list_tables_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -1973,7 +1995,7 @@ def test_list_tables_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2011,7 +2033,7 @@ async def test_list_tables_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -2050,7 +2072,7 @@ async def test_list_tables_async_use_cached_wrapped_rpc( async def test_list_tables_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.ListTablesRequest ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -2086,7 +2108,7 @@ async def test_list_tables_async_from_dict(): def test_list_tables_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -2116,7 +2138,7 @@ def test_list_tables_field_headers(): @pytest.mark.asyncio async def test_list_tables_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -2147,7 +2169,7 @@ async def test_list_tables_field_headers_async(): def test_list_tables_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -2171,7 +2193,7 @@ def test_list_tables_flattened(): def test_list_tables_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -2186,7 +2208,7 @@ def test_list_tables_flattened_error(): @pytest.mark.asyncio async def test_list_tables_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -2215,7 +2237,7 @@ async def test_list_tables_flattened_async(): @pytest.mark.asyncio async def test_list_tables_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -2229,7 +2251,7 @@ async def test_list_tables_flattened_error_async(): def test_list_tables_pager(transport_name: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2283,7 +2305,7 @@ def test_list_tables_pager(transport_name: str = "grpc"): def test_list_tables_pages(transport_name: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -2325,7 +2347,7 @@ def test_list_tables_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_tables_async_pager(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -2375,7 +2397,7 @@ async def test_list_tables_async_pager(): @pytest.mark.asyncio async def test_list_tables_async_pages(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -2430,7 +2452,7 @@ async def test_list_tables_async_pages(): ], ) def test_get_table(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2465,7 +2487,7 @@ def test_get_table(request_type, transport: str = "grpc"): def test_get_table_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2494,7 +2516,7 @@ def test_get_table_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2530,7 +2552,7 @@ async def test_get_table_async_use_cached_wrapped_rpc(transport: str = "grpc_asy # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -2569,7 +2591,7 @@ async def test_get_table_async_use_cached_wrapped_rpc(transport: str = "grpc_asy async def test_get_table_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.GetTableRequest ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -2609,7 +2631,7 @@ async def test_get_table_async_from_dict(): def test_get_table_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -2639,7 +2661,7 @@ def test_get_table_field_headers(): @pytest.mark.asyncio async def test_get_table_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -2668,7 +2690,7 @@ async def test_get_table_field_headers_async(): def test_get_table_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -2692,7 +2714,7 @@ def test_get_table_flattened(): def test_get_table_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -2707,7 +2729,7 @@ def test_get_table_flattened_error(): @pytest.mark.asyncio async def test_get_table_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -2734,7 +2756,7 @@ async def test_get_table_flattened_async(): @pytest.mark.asyncio async def test_get_table_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -2755,7 +2777,7 @@ async def test_get_table_flattened_error_async(): ], ) def test_update_table(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -2783,7 +2805,7 @@ def test_update_table(request_type, transport: str = "grpc"): def test_update_table_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2808,7 +2830,7 @@ def test_update_table_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -2851,7 +2873,7 @@ async def test_update_table_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -2896,7 +2918,7 @@ async def test_update_table_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.UpdateTableRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -2929,7 +2951,7 @@ async def test_update_table_async_from_dict(): def test_update_table_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -2959,7 +2981,7 @@ def test_update_table_field_headers(): @pytest.mark.asyncio async def test_update_table_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -2990,7 +3012,7 @@ async def test_update_table_field_headers_async(): def test_update_table_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -3018,7 +3040,7 @@ def test_update_table_flattened(): def test_update_table_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -3034,7 +3056,7 @@ def test_update_table_flattened_error(): @pytest.mark.asyncio async def test_update_table_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -3067,7 +3089,7 @@ async def test_update_table_flattened_async(): @pytest.mark.asyncio async def test_update_table_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -3089,7 +3111,7 @@ async def test_update_table_flattened_error_async(): ], ) def test_delete_table(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3117,7 +3139,7 @@ def test_delete_table(request_type, transport: str = "grpc"): def test_delete_table_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3146,7 +3168,7 @@ def test_delete_table_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3184,7 +3206,7 @@ async def test_delete_table_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -3224,7 +3246,7 @@ async def test_delete_table_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.DeleteTableRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -3255,7 +3277,7 @@ async def test_delete_table_async_from_dict(): def test_delete_table_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -3285,7 +3307,7 @@ def test_delete_table_field_headers(): @pytest.mark.asyncio async def test_delete_table_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -3314,7 +3336,7 @@ async def test_delete_table_field_headers_async(): def test_delete_table_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -3338,7 +3360,7 @@ def test_delete_table_flattened(): def test_delete_table_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -3353,7 +3375,7 @@ def test_delete_table_flattened_error(): @pytest.mark.asyncio async def test_delete_table_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -3380,7 +3402,7 @@ async def test_delete_table_flattened_async(): @pytest.mark.asyncio async def test_delete_table_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -3401,7 +3423,7 @@ async def test_delete_table_flattened_error_async(): ], ) def test_undelete_table(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3429,7 +3451,7 @@ def test_undelete_table(request_type, transport: str = "grpc"): def test_undelete_table_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3458,7 +3480,7 @@ def test_undelete_table_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3501,7 +3523,7 @@ async def test_undelete_table_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -3546,7 +3568,7 @@ async def test_undelete_table_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.UndeleteTableRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -3579,7 +3601,7 @@ async def test_undelete_table_async_from_dict(): def test_undelete_table_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -3609,7 +3631,7 @@ def test_undelete_table_field_headers(): @pytest.mark.asyncio async def test_undelete_table_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -3640,7 +3662,7 @@ async def test_undelete_table_field_headers_async(): def test_undelete_table_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -3664,7 +3686,7 @@ def test_undelete_table_flattened(): def test_undelete_table_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -3679,7 +3701,7 @@ def test_undelete_table_flattened_error(): @pytest.mark.asyncio async def test_undelete_table_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -3708,7 +3730,7 @@ async def test_undelete_table_flattened_async(): @pytest.mark.asyncio async def test_undelete_table_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -3729,7 +3751,7 @@ async def test_undelete_table_flattened_error_async(): ], ) def test_create_authorized_view(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -3759,7 +3781,7 @@ def test_create_authorized_view(request_type, transport: str = "grpc"): def test_create_authorized_view_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3792,7 +3814,7 @@ def test_create_authorized_view_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -3840,7 +3862,7 @@ async def test_create_authorized_view_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -3885,7 +3907,7 @@ async def test_create_authorized_view_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.CreateAuthorizedViewRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -3920,7 +3942,7 @@ async def test_create_authorized_view_async_from_dict(): def test_create_authorized_view_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -3952,7 +3974,7 @@ def test_create_authorized_view_field_headers(): @pytest.mark.asyncio async def test_create_authorized_view_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -3985,7 +4007,7 @@ async def test_create_authorized_view_field_headers_async(): def test_create_authorized_view_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -4019,7 +4041,7 @@ def test_create_authorized_view_flattened(): def test_create_authorized_view_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -4036,7 +4058,7 @@ def test_create_authorized_view_flattened_error(): @pytest.mark.asyncio async def test_create_authorized_view_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -4075,7 +4097,7 @@ async def test_create_authorized_view_flattened_async(): @pytest.mark.asyncio async def test_create_authorized_view_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -4098,7 +4120,7 @@ async def test_create_authorized_view_flattened_error_async(): ], ) def test_list_authorized_views(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4131,7 +4153,7 @@ def test_list_authorized_views(request_type, transport: str = "grpc"): def test_list_authorized_views_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4164,7 +4186,7 @@ def test_list_authorized_views_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4207,7 +4229,7 @@ async def test_list_authorized_views_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -4247,7 +4269,7 @@ async def test_list_authorized_views_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.ListAuthorizedViewsRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -4285,7 +4307,7 @@ async def test_list_authorized_views_async_from_dict(): def test_list_authorized_views_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -4317,7 +4339,7 @@ def test_list_authorized_views_field_headers(): @pytest.mark.asyncio async def test_list_authorized_views_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -4350,7 +4372,7 @@ async def test_list_authorized_views_field_headers_async(): def test_list_authorized_views_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -4376,7 +4398,7 @@ def test_list_authorized_views_flattened(): def test_list_authorized_views_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -4391,7 +4413,7 @@ def test_list_authorized_views_flattened_error(): @pytest.mark.asyncio async def test_list_authorized_views_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -4422,7 +4444,7 @@ async def test_list_authorized_views_flattened_async(): @pytest.mark.asyncio async def test_list_authorized_views_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -4436,7 +4458,7 @@ async def test_list_authorized_views_flattened_error_async(): def test_list_authorized_views_pager(transport_name: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -4492,7 +4514,7 @@ def test_list_authorized_views_pager(transport_name: str = "grpc"): def test_list_authorized_views_pages(transport_name: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -4536,7 +4558,7 @@ def test_list_authorized_views_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_authorized_views_async_pager(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -4588,7 +4610,7 @@ async def test_list_authorized_views_async_pager(): @pytest.mark.asyncio async def test_list_authorized_views_async_pages(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -4645,7 +4667,7 @@ async def test_list_authorized_views_async_pages(): ], ) def test_get_authorized_view(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -4682,7 +4704,7 @@ def test_get_authorized_view(request_type, transport: str = "grpc"): def test_get_authorized_view_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4713,7 +4735,7 @@ def test_get_authorized_view_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -4755,7 +4777,7 @@ async def test_get_authorized_view_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -4795,7 +4817,7 @@ async def test_get_authorized_view_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.GetAuthorizedViewRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -4837,7 +4859,7 @@ async def test_get_authorized_view_async_from_dict(): def test_get_authorized_view_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -4869,7 +4891,7 @@ def test_get_authorized_view_field_headers(): @pytest.mark.asyncio async def test_get_authorized_view_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -4902,7 +4924,7 @@ async def test_get_authorized_view_field_headers_async(): def test_get_authorized_view_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -4928,7 +4950,7 @@ def test_get_authorized_view_flattened(): def test_get_authorized_view_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -4943,7 +4965,7 @@ def test_get_authorized_view_flattened_error(): @pytest.mark.asyncio async def test_get_authorized_view_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -4974,7 +4996,7 @@ async def test_get_authorized_view_flattened_async(): @pytest.mark.asyncio async def test_get_authorized_view_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -4995,7 +5017,7 @@ async def test_get_authorized_view_flattened_error_async(): ], ) def test_update_authorized_view(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5025,7 +5047,7 @@ def test_update_authorized_view(request_type, transport: str = "grpc"): def test_update_authorized_view_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5052,7 +5074,7 @@ def test_update_authorized_view_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5100,7 +5122,7 @@ async def test_update_authorized_view_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -5145,7 +5167,7 @@ async def test_update_authorized_view_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.UpdateAuthorizedViewRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -5180,7 +5202,7 @@ async def test_update_authorized_view_async_from_dict(): def test_update_authorized_view_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -5212,7 +5234,7 @@ def test_update_authorized_view_field_headers(): @pytest.mark.asyncio async def test_update_authorized_view_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -5245,7 +5267,7 @@ async def test_update_authorized_view_field_headers_async(): def test_update_authorized_view_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -5275,7 +5297,7 @@ def test_update_authorized_view_flattened(): def test_update_authorized_view_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -5291,7 +5313,7 @@ def test_update_authorized_view_flattened_error(): @pytest.mark.asyncio async def test_update_authorized_view_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -5326,7 +5348,7 @@ async def test_update_authorized_view_flattened_async(): @pytest.mark.asyncio async def test_update_authorized_view_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -5348,7 +5370,7 @@ async def test_update_authorized_view_flattened_error_async(): ], ) def test_delete_authorized_view(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5378,7 +5400,7 @@ def test_delete_authorized_view(request_type, transport: str = "grpc"): def test_delete_authorized_view_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5411,7 +5433,7 @@ def test_delete_authorized_view_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5454,7 +5476,7 @@ async def test_delete_authorized_view_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -5494,7 +5516,7 @@ async def test_delete_authorized_view_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.DeleteAuthorizedViewRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -5527,7 +5549,7 @@ async def test_delete_authorized_view_async_from_dict(): def test_delete_authorized_view_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -5559,7 +5581,7 @@ def test_delete_authorized_view_field_headers(): @pytest.mark.asyncio async def test_delete_authorized_view_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -5590,7 +5612,7 @@ async def test_delete_authorized_view_field_headers_async(): def test_delete_authorized_view_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -5616,7 +5638,7 @@ def test_delete_authorized_view_flattened(): def test_delete_authorized_view_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -5631,7 +5653,7 @@ def test_delete_authorized_view_flattened_error(): @pytest.mark.asyncio async def test_delete_authorized_view_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -5660,7 +5682,7 @@ async def test_delete_authorized_view_flattened_async(): @pytest.mark.asyncio async def test_delete_authorized_view_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -5680,8 +5702,8 @@ async def test_delete_authorized_view_flattened_error_async(): dict, ], ) -def test_modify_column_families(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( +def test__modify_column_families(request_type, transport: str = "grpc"): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -5700,7 +5722,7 @@ def test_modify_column_families(request_type, transport: str = "grpc"): granularity=table.Table.TimestampGranularity.MILLIS, deletion_protection=True, ) - response = client.modify_column_families(request) + response = client._modify_column_families(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 @@ -5715,10 +5737,10 @@ def test_modify_column_families(request_type, transport: str = "grpc"): assert response.deletion_protection is True -def test_modify_column_families_non_empty_request_with_auto_populated_field(): +def test__modify_column_families_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5737,7 +5759,7 @@ def test_modify_column_families_non_empty_request_with_auto_populated_field(): call.return_value.name = ( "foo" # operation_request.operation in compute client(s) expect a string. ) - client.modify_column_families(request=request) + client._modify_column_families(request=request) call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == bigtable_table_admin.ModifyColumnFamiliesRequest( @@ -5745,11 +5767,11 @@ def test_modify_column_families_non_empty_request_with_auto_populated_field(): ) -def test_modify_column_families_use_cached_wrapped_rpc(): +def test__modify_column_families_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -5773,12 +5795,12 @@ def test_modify_column_families_use_cached_wrapped_rpc(): client._transport.modify_column_families ] = mock_rpc request = {} - client.modify_column_families(request) + client._modify_column_families(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 - client.modify_column_families(request) + client._modify_column_families(request) # Establish that a new wrapper was not created for this call assert wrapper_fn.call_count == 0 @@ -5786,13 +5808,13 @@ def test_modify_column_families_use_cached_wrapped_rpc(): @pytest.mark.asyncio -async def test_modify_column_families_async_use_cached_wrapped_rpc( +async def test__modify_column_families_async_use_cached_wrapped_rpc( transport: str = "grpc_asyncio", ): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -5815,12 +5837,12 @@ async def test_modify_column_families_async_use_cached_wrapped_rpc( ] = mock_rpc request = {} - await client.modify_column_families(request) + await client._modify_column_families(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 - await client.modify_column_families(request) + await client._modify_column_families(request) # Establish that a new wrapper was not created for this call assert wrapper_fn.call_count == 0 @@ -5828,11 +5850,11 @@ async def test_modify_column_families_async_use_cached_wrapped_rpc( @pytest.mark.asyncio -async def test_modify_column_families_async( +async def test__modify_column_families_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.ModifyColumnFamiliesRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -5853,7 +5875,7 @@ async def test_modify_column_families_async( deletion_protection=True, ) ) - response = await client.modify_column_families(request) + response = await client._modify_column_families(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) @@ -5869,12 +5891,12 @@ async def test_modify_column_families_async( @pytest.mark.asyncio -async def test_modify_column_families_async_from_dict(): - await test_modify_column_families_async(request_type=dict) +async def test__modify_column_families_async_from_dict(): + await test__modify_column_families_async(request_type=dict) -def test_modify_column_families_field_headers(): - client = BigtableTableAdminClient( +def test__modify_column_families_field_headers(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -5889,7 +5911,7 @@ def test_modify_column_families_field_headers(): type(client.transport.modify_column_families), "__call__" ) as call: call.return_value = table.Table() - client.modify_column_families(request) + client._modify_column_families(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 @@ -5905,8 +5927,8 @@ def test_modify_column_families_field_headers(): @pytest.mark.asyncio -async def test_modify_column_families_field_headers_async(): - client = BigtableTableAdminAsyncClient( +async def test__modify_column_families_field_headers_async(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -5921,7 +5943,7 @@ async def test_modify_column_families_field_headers_async(): type(client.transport.modify_column_families), "__call__" ) as call: call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(table.Table()) - await client.modify_column_families(request) + await client._modify_column_families(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) @@ -5936,8 +5958,8 @@ async def test_modify_column_families_field_headers_async(): ) in kw["metadata"] -def test_modify_column_families_flattened(): - client = BigtableTableAdminClient( +def test__modify_column_families_flattened(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -5949,7 +5971,7 @@ def test_modify_column_families_flattened(): call.return_value = table.Table() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.modify_column_families( + client._modify_column_families( name="name_value", modifications=[ bigtable_table_admin.ModifyColumnFamiliesRequest.Modification( @@ -5972,15 +5994,15 @@ def test_modify_column_families_flattened(): assert arg == mock_val -def test_modify_column_families_flattened_error(): - client = BigtableTableAdminClient( +def test__modify_column_families_flattened_error(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - client.modify_column_families( + client._modify_column_families( bigtable_table_admin.ModifyColumnFamiliesRequest(), name="name_value", modifications=[ @@ -5992,8 +6014,8 @@ def test_modify_column_families_flattened_error(): @pytest.mark.asyncio -async def test_modify_column_families_flattened_async(): - client = BigtableTableAdminAsyncClient( +async def test__modify_column_families_flattened_async(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -6007,7 +6029,7 @@ async def test_modify_column_families_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(table.Table()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.modify_column_families( + response = await client._modify_column_families( name="name_value", modifications=[ bigtable_table_admin.ModifyColumnFamiliesRequest.Modification( @@ -6031,15 +6053,15 @@ async def test_modify_column_families_flattened_async(): @pytest.mark.asyncio -async def test_modify_column_families_flattened_error_async(): - client = BigtableTableAdminAsyncClient( +async def test__modify_column_families_flattened_error_async(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - await client.modify_column_families( + await client._modify_column_families( bigtable_table_admin.ModifyColumnFamiliesRequest(), name="name_value", modifications=[ @@ -6058,7 +6080,7 @@ async def test_modify_column_families_flattened_error_async(): ], ) def test_drop_row_range(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6086,7 +6108,7 @@ def test_drop_row_range(request_type, transport: str = "grpc"): def test_drop_row_range_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6115,7 +6137,7 @@ def test_drop_row_range_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6153,7 +6175,7 @@ async def test_drop_row_range_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -6193,7 +6215,7 @@ async def test_drop_row_range_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.DropRowRangeRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -6224,7 +6246,7 @@ async def test_drop_row_range_async_from_dict(): def test_drop_row_range_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -6254,7 +6276,7 @@ def test_drop_row_range_field_headers(): @pytest.mark.asyncio async def test_drop_row_range_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -6290,7 +6312,7 @@ async def test_drop_row_range_field_headers_async(): ], ) def test_generate_consistency_token(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6323,7 +6345,7 @@ def test_generate_consistency_token(request_type, transport: str = "grpc"): def test_generate_consistency_token_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6354,7 +6376,7 @@ def test_generate_consistency_token_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6397,7 +6419,7 @@ async def test_generate_consistency_token_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -6437,7 +6459,7 @@ async def test_generate_consistency_token_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.GenerateConsistencyTokenRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -6475,7 +6497,7 @@ async def test_generate_consistency_token_async_from_dict(): def test_generate_consistency_token_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -6507,7 +6529,7 @@ def test_generate_consistency_token_field_headers(): @pytest.mark.asyncio async def test_generate_consistency_token_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -6540,7 +6562,7 @@ async def test_generate_consistency_token_field_headers_async(): def test_generate_consistency_token_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -6566,7 +6588,7 @@ def test_generate_consistency_token_flattened(): def test_generate_consistency_token_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -6581,7 +6603,7 @@ def test_generate_consistency_token_flattened_error(): @pytest.mark.asyncio async def test_generate_consistency_token_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -6612,7 +6634,7 @@ async def test_generate_consistency_token_flattened_async(): @pytest.mark.asyncio async def test_generate_consistency_token_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -6633,7 +6655,7 @@ async def test_generate_consistency_token_flattened_error_async(): ], ) def test_check_consistency(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6666,7 +6688,7 @@ def test_check_consistency(request_type, transport: str = "grpc"): def test_check_consistency_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6699,7 +6721,7 @@ def test_check_consistency_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -6739,7 +6761,7 @@ async def test_check_consistency_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -6779,7 +6801,7 @@ async def test_check_consistency_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.CheckConsistencyRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -6817,7 +6839,7 @@ async def test_check_consistency_async_from_dict(): def test_check_consistency_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -6849,7 +6871,7 @@ def test_check_consistency_field_headers(): @pytest.mark.asyncio async def test_check_consistency_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -6882,7 +6904,7 @@ async def test_check_consistency_field_headers_async(): def test_check_consistency_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -6912,7 +6934,7 @@ def test_check_consistency_flattened(): def test_check_consistency_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -6928,7 +6950,7 @@ def test_check_consistency_flattened_error(): @pytest.mark.asyncio async def test_check_consistency_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -6963,7 +6985,7 @@ async def test_check_consistency_flattened_async(): @pytest.mark.asyncio async def test_check_consistency_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -6984,8 +7006,8 @@ async def test_check_consistency_flattened_error_async(): dict, ], ) -def test_snapshot_table(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( +def test__snapshot_table(request_type, transport: str = "grpc"): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -6998,7 +7020,7 @@ def test_snapshot_table(request_type, transport: str = "grpc"): with mock.patch.object(type(client.transport.snapshot_table), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/spam") - response = client.snapshot_table(request) + response = client._snapshot_table(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 @@ -7010,10 +7032,10 @@ def test_snapshot_table(request_type, transport: str = "grpc"): assert isinstance(response, future.Future) -def test_snapshot_table_non_empty_request_with_auto_populated_field(): +def test__snapshot_table_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -7033,7 +7055,7 @@ def test_snapshot_table_non_empty_request_with_auto_populated_field(): call.return_value.name = ( "foo" # operation_request.operation in compute client(s) expect a string. ) - client.snapshot_table(request=request) + client._snapshot_table(request=request) call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == bigtable_table_admin.SnapshotTableRequest( @@ -7044,11 +7066,11 @@ def test_snapshot_table_non_empty_request_with_auto_populated_field(): ) -def test_snapshot_table_use_cached_wrapped_rpc(): +def test__snapshot_table_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -7067,7 +7089,7 @@ def test_snapshot_table_use_cached_wrapped_rpc(): ) client._transport._wrapped_methods[client._transport.snapshot_table] = mock_rpc request = {} - client.snapshot_table(request) + client._snapshot_table(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 @@ -7077,7 +7099,7 @@ def test_snapshot_table_use_cached_wrapped_rpc(): # Subsequent calls should use the cached wrapper wrapper_fn.reset_mock() - client.snapshot_table(request) + client._snapshot_table(request) # Establish that a new wrapper was not created for this call assert wrapper_fn.call_count == 0 @@ -7085,13 +7107,13 @@ def test_snapshot_table_use_cached_wrapped_rpc(): @pytest.mark.asyncio -async def test_snapshot_table_async_use_cached_wrapped_rpc( +async def test__snapshot_table_async_use_cached_wrapped_rpc( transport: str = "grpc_asyncio", ): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -7114,7 +7136,7 @@ async def test_snapshot_table_async_use_cached_wrapped_rpc( ] = mock_rpc request = {} - await client.snapshot_table(request) + await client._snapshot_table(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 @@ -7124,7 +7146,7 @@ async def test_snapshot_table_async_use_cached_wrapped_rpc( # Subsequent calls should use the cached wrapper wrapper_fn.reset_mock() - await client.snapshot_table(request) + await client._snapshot_table(request) # Establish that a new wrapper was not created for this call assert wrapper_fn.call_count == 0 @@ -7132,11 +7154,11 @@ async def test_snapshot_table_async_use_cached_wrapped_rpc( @pytest.mark.asyncio -async def test_snapshot_table_async( +async def test__snapshot_table_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.SnapshotTableRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -7151,7 +7173,7 @@ async def test_snapshot_table_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/spam") ) - response = await client.snapshot_table(request) + response = await client._snapshot_table(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) @@ -7164,12 +7186,12 @@ async def test_snapshot_table_async( @pytest.mark.asyncio -async def test_snapshot_table_async_from_dict(): - await test_snapshot_table_async(request_type=dict) +async def test__snapshot_table_async_from_dict(): + await test__snapshot_table_async(request_type=dict) -def test_snapshot_table_field_headers(): - client = BigtableTableAdminClient( +def test__snapshot_table_field_headers(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -7182,7 +7204,7 @@ def test_snapshot_table_field_headers(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.snapshot_table), "__call__") as call: call.return_value = operations_pb2.Operation(name="operations/op") - client.snapshot_table(request) + client._snapshot_table(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 @@ -7198,8 +7220,8 @@ def test_snapshot_table_field_headers(): @pytest.mark.asyncio -async def test_snapshot_table_field_headers_async(): - client = BigtableTableAdminAsyncClient( +async def test__snapshot_table_field_headers_async(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -7214,7 +7236,7 @@ async def test_snapshot_table_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/op") ) - await client.snapshot_table(request) + await client._snapshot_table(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) @@ -7229,8 +7251,8 @@ async def test_snapshot_table_field_headers_async(): ) in kw["metadata"] -def test_snapshot_table_flattened(): - client = BigtableTableAdminClient( +def test__snapshot_table_flattened(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -7240,7 +7262,7 @@ def test_snapshot_table_flattened(): call.return_value = operations_pb2.Operation(name="operations/op") # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.snapshot_table( + client._snapshot_table( name="name_value", cluster="cluster_value", snapshot_id="snapshot_id_value", @@ -7265,15 +7287,15 @@ def test_snapshot_table_flattened(): assert arg == mock_val -def test_snapshot_table_flattened_error(): - client = BigtableTableAdminClient( +def test__snapshot_table_flattened_error(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - client.snapshot_table( + client._snapshot_table( bigtable_table_admin.SnapshotTableRequest(), name="name_value", cluster="cluster_value", @@ -7283,8 +7305,8 @@ def test_snapshot_table_flattened_error(): @pytest.mark.asyncio -async def test_snapshot_table_flattened_async(): - client = BigtableTableAdminAsyncClient( +async def test__snapshot_table_flattened_async(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -7298,7 +7320,7 @@ async def test_snapshot_table_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.snapshot_table( + response = await client._snapshot_table( name="name_value", cluster="cluster_value", snapshot_id="snapshot_id_value", @@ -7324,15 +7346,15 @@ async def test_snapshot_table_flattened_async(): @pytest.mark.asyncio -async def test_snapshot_table_flattened_error_async(): - client = BigtableTableAdminAsyncClient( +async def test__snapshot_table_flattened_error_async(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - await client.snapshot_table( + await client._snapshot_table( bigtable_table_admin.SnapshotTableRequest(), name="name_value", cluster="cluster_value", @@ -7348,8 +7370,8 @@ async def test_snapshot_table_flattened_error_async(): dict, ], ) -def test_get_snapshot(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( +def test__get_snapshot(request_type, transport: str = "grpc"): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7367,7 +7389,7 @@ def test_get_snapshot(request_type, transport: str = "grpc"): state=table.Snapshot.State.READY, description="description_value", ) - response = client.get_snapshot(request) + response = client._get_snapshot(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 @@ -7383,10 +7405,10 @@ def test_get_snapshot(request_type, transport: str = "grpc"): assert response.description == "description_value" -def test_get_snapshot_non_empty_request_with_auto_populated_field(): +def test__get_snapshot_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -7403,7 +7425,7 @@ def test_get_snapshot_non_empty_request_with_auto_populated_field(): call.return_value.name = ( "foo" # operation_request.operation in compute client(s) expect a string. ) - client.get_snapshot(request=request) + client._get_snapshot(request=request) call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == bigtable_table_admin.GetSnapshotRequest( @@ -7411,11 +7433,11 @@ def test_get_snapshot_non_empty_request_with_auto_populated_field(): ) -def test_get_snapshot_use_cached_wrapped_rpc(): +def test__get_snapshot_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -7434,12 +7456,12 @@ def test_get_snapshot_use_cached_wrapped_rpc(): ) client._transport._wrapped_methods[client._transport.get_snapshot] = mock_rpc request = {} - client.get_snapshot(request) + client._get_snapshot(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 - client.get_snapshot(request) + client._get_snapshot(request) # Establish that a new wrapper was not created for this call assert wrapper_fn.call_count == 0 @@ -7447,13 +7469,13 @@ def test_get_snapshot_use_cached_wrapped_rpc(): @pytest.mark.asyncio -async def test_get_snapshot_async_use_cached_wrapped_rpc( +async def test__get_snapshot_async_use_cached_wrapped_rpc( transport: str = "grpc_asyncio", ): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -7476,12 +7498,12 @@ async def test_get_snapshot_async_use_cached_wrapped_rpc( ] = mock_rpc request = {} - await client.get_snapshot(request) + await client._get_snapshot(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 - await client.get_snapshot(request) + await client._get_snapshot(request) # Establish that a new wrapper was not created for this call assert wrapper_fn.call_count == 0 @@ -7489,11 +7511,11 @@ async def test_get_snapshot_async_use_cached_wrapped_rpc( @pytest.mark.asyncio -async def test_get_snapshot_async( +async def test__get_snapshot_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.GetSnapshotRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -7513,7 +7535,7 @@ async def test_get_snapshot_async( description="description_value", ) ) - response = await client.get_snapshot(request) + response = await client._get_snapshot(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) @@ -7530,12 +7552,12 @@ async def test_get_snapshot_async( @pytest.mark.asyncio -async def test_get_snapshot_async_from_dict(): - await test_get_snapshot_async(request_type=dict) +async def test__get_snapshot_async_from_dict(): + await test__get_snapshot_async(request_type=dict) -def test_get_snapshot_field_headers(): - client = BigtableTableAdminClient( +def test__get_snapshot_field_headers(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -7548,7 +7570,7 @@ def test_get_snapshot_field_headers(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_snapshot), "__call__") as call: call.return_value = table.Snapshot() - client.get_snapshot(request) + client._get_snapshot(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 @@ -7564,8 +7586,8 @@ def test_get_snapshot_field_headers(): @pytest.mark.asyncio -async def test_get_snapshot_field_headers_async(): - client = BigtableTableAdminAsyncClient( +async def test__get_snapshot_field_headers_async(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -7578,7 +7600,7 @@ async def test_get_snapshot_field_headers_async(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.get_snapshot), "__call__") as call: call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(table.Snapshot()) - await client.get_snapshot(request) + await client._get_snapshot(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) @@ -7593,8 +7615,8 @@ async def test_get_snapshot_field_headers_async(): ) in kw["metadata"] -def test_get_snapshot_flattened(): - client = BigtableTableAdminClient( +def test__get_snapshot_flattened(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -7604,7 +7626,7 @@ def test_get_snapshot_flattened(): call.return_value = table.Snapshot() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.get_snapshot( + client._get_snapshot( name="name_value", ) @@ -7617,23 +7639,23 @@ def test_get_snapshot_flattened(): assert arg == mock_val -def test_get_snapshot_flattened_error(): - client = BigtableTableAdminClient( +def test__get_snapshot_flattened_error(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - client.get_snapshot( + client._get_snapshot( bigtable_table_admin.GetSnapshotRequest(), name="name_value", ) @pytest.mark.asyncio -async def test_get_snapshot_flattened_async(): - client = BigtableTableAdminAsyncClient( +async def test__get_snapshot_flattened_async(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -7645,7 +7667,7 @@ async def test_get_snapshot_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(table.Snapshot()) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.get_snapshot( + response = await client._get_snapshot( name="name_value", ) @@ -7659,15 +7681,15 @@ async def test_get_snapshot_flattened_async(): @pytest.mark.asyncio -async def test_get_snapshot_flattened_error_async(): - client = BigtableTableAdminAsyncClient( +async def test__get_snapshot_flattened_error_async(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - await client.get_snapshot( + await client._get_snapshot( bigtable_table_admin.GetSnapshotRequest(), name="name_value", ) @@ -7680,8 +7702,8 @@ async def test_get_snapshot_flattened_error_async(): dict, ], ) -def test_list_snapshots(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( +def test__list_snapshots(request_type, transport: str = "grpc"): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -7696,7 +7718,7 @@ def test_list_snapshots(request_type, transport: str = "grpc"): call.return_value = bigtable_table_admin.ListSnapshotsResponse( next_page_token="next_page_token_value", ) - response = client.list_snapshots(request) + response = client._list_snapshots(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 @@ -7709,10 +7731,10 @@ def test_list_snapshots(request_type, transport: str = "grpc"): assert response.next_page_token == "next_page_token_value" -def test_list_snapshots_non_empty_request_with_auto_populated_field(): +def test__list_snapshots_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -7730,7 +7752,7 @@ def test_list_snapshots_non_empty_request_with_auto_populated_field(): call.return_value.name = ( "foo" # operation_request.operation in compute client(s) expect a string. ) - client.list_snapshots(request=request) + client._list_snapshots(request=request) call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == bigtable_table_admin.ListSnapshotsRequest( @@ -7739,11 +7761,11 @@ def test_list_snapshots_non_empty_request_with_auto_populated_field(): ) -def test_list_snapshots_use_cached_wrapped_rpc(): +def test__list_snapshots_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -7762,12 +7784,12 @@ def test_list_snapshots_use_cached_wrapped_rpc(): ) client._transport._wrapped_methods[client._transport.list_snapshots] = mock_rpc request = {} - client.list_snapshots(request) + client._list_snapshots(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 - client.list_snapshots(request) + client._list_snapshots(request) # Establish that a new wrapper was not created for this call assert wrapper_fn.call_count == 0 @@ -7775,13 +7797,13 @@ def test_list_snapshots_use_cached_wrapped_rpc(): @pytest.mark.asyncio -async def test_list_snapshots_async_use_cached_wrapped_rpc( +async def test__list_snapshots_async_use_cached_wrapped_rpc( transport: str = "grpc_asyncio", ): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -7804,12 +7826,12 @@ async def test_list_snapshots_async_use_cached_wrapped_rpc( ] = mock_rpc request = {} - await client.list_snapshots(request) + await client._list_snapshots(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 - await client.list_snapshots(request) + await client._list_snapshots(request) # Establish that a new wrapper was not created for this call assert wrapper_fn.call_count == 0 @@ -7817,11 +7839,11 @@ async def test_list_snapshots_async_use_cached_wrapped_rpc( @pytest.mark.asyncio -async def test_list_snapshots_async( +async def test__list_snapshots_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.ListSnapshotsRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -7838,7 +7860,7 @@ async def test_list_snapshots_async( next_page_token="next_page_token_value", ) ) - response = await client.list_snapshots(request) + response = await client._list_snapshots(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) @@ -7852,12 +7874,12 @@ async def test_list_snapshots_async( @pytest.mark.asyncio -async def test_list_snapshots_async_from_dict(): - await test_list_snapshots_async(request_type=dict) +async def test__list_snapshots_async_from_dict(): + await test__list_snapshots_async(request_type=dict) -def test_list_snapshots_field_headers(): - client = BigtableTableAdminClient( +def test__list_snapshots_field_headers(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -7870,7 +7892,7 @@ def test_list_snapshots_field_headers(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.list_snapshots), "__call__") as call: call.return_value = bigtable_table_admin.ListSnapshotsResponse() - client.list_snapshots(request) + client._list_snapshots(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 @@ -7886,8 +7908,8 @@ def test_list_snapshots_field_headers(): @pytest.mark.asyncio -async def test_list_snapshots_field_headers_async(): - client = BigtableTableAdminAsyncClient( +async def test__list_snapshots_field_headers_async(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -7902,7 +7924,7 @@ async def test_list_snapshots_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( bigtable_table_admin.ListSnapshotsResponse() ) - await client.list_snapshots(request) + await client._list_snapshots(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) @@ -7917,8 +7939,8 @@ async def test_list_snapshots_field_headers_async(): ) in kw["metadata"] -def test_list_snapshots_flattened(): - client = BigtableTableAdminClient( +def test__list_snapshots_flattened(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -7928,7 +7950,7 @@ def test_list_snapshots_flattened(): call.return_value = bigtable_table_admin.ListSnapshotsResponse() # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.list_snapshots( + client._list_snapshots( parent="parent_value", ) @@ -7941,23 +7963,23 @@ def test_list_snapshots_flattened(): assert arg == mock_val -def test_list_snapshots_flattened_error(): - client = BigtableTableAdminClient( +def test__list_snapshots_flattened_error(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - client.list_snapshots( + client._list_snapshots( bigtable_table_admin.ListSnapshotsRequest(), parent="parent_value", ) @pytest.mark.asyncio -async def test_list_snapshots_flattened_async(): - client = BigtableTableAdminAsyncClient( +async def test__list_snapshots_flattened_async(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -7971,7 +7993,7 @@ async def test_list_snapshots_flattened_async(): ) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.list_snapshots( + response = await client._list_snapshots( parent="parent_value", ) @@ -7985,22 +8007,22 @@ async def test_list_snapshots_flattened_async(): @pytest.mark.asyncio -async def test_list_snapshots_flattened_error_async(): - client = BigtableTableAdminAsyncClient( +async def test__list_snapshots_flattened_error_async(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - await client.list_snapshots( + await client._list_snapshots( bigtable_table_admin.ListSnapshotsRequest(), parent="parent_value", ) -def test_list_snapshots_pager(transport_name: str = "grpc"): - client = BigtableTableAdminClient( +def test__list_snapshots_pager(transport_name: str = "grpc"): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -8042,7 +8064,7 @@ def test_list_snapshots_pager(transport_name: str = "grpc"): expected_metadata = tuple(expected_metadata) + ( gapic_v1.routing_header.to_grpc_metadata((("parent", ""),)), ) - pager = client.list_snapshots(request={}, retry=retry, timeout=timeout) + pager = client._list_snapshots(request={}, retry=retry, timeout=timeout) assert pager._metadata == expected_metadata assert pager._retry == retry @@ -8053,8 +8075,8 @@ def test_list_snapshots_pager(transport_name: str = "grpc"): assert all(isinstance(i, table.Snapshot) for i in results) -def test_list_snapshots_pages(transport_name: str = "grpc"): - client = BigtableTableAdminClient( +def test__list_snapshots_pages(transport_name: str = "grpc"): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -8089,14 +8111,14 @@ def test_list_snapshots_pages(transport_name: str = "grpc"): ), RuntimeError, ) - pages = list(client.list_snapshots(request={}).pages) + pages = list(client._list_snapshots(request={}).pages) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token @pytest.mark.asyncio -async def test_list_snapshots_async_pager(): - client = BigtableTableAdminAsyncClient( +async def test__list_snapshots_async_pager(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -8132,7 +8154,7 @@ async def test_list_snapshots_async_pager(): ), RuntimeError, ) - async_pager = await client.list_snapshots( + async_pager = await client._list_snapshots( request={}, ) assert async_pager.next_page_token == "abc" @@ -8145,8 +8167,8 @@ async def test_list_snapshots_async_pager(): @pytest.mark.asyncio -async def test_list_snapshots_async_pages(): - client = BigtableTableAdminAsyncClient( +async def test__list_snapshots_async_pages(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -8186,7 +8208,7 @@ async def test_list_snapshots_async_pages(): # Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch` # See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372 async for page_ in ( # pragma: no branch - await client.list_snapshots(request={}) + await client._list_snapshots(request={}) ).pages: pages.append(page_) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): @@ -8200,8 +8222,8 @@ async def test_list_snapshots_async_pages(): dict, ], ) -def test_delete_snapshot(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( +def test__delete_snapshot(request_type, transport: str = "grpc"): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8214,7 +8236,7 @@ def test_delete_snapshot(request_type, transport: str = "grpc"): with mock.patch.object(type(client.transport.delete_snapshot), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = None - response = client.delete_snapshot(request) + response = client._delete_snapshot(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 @@ -8226,10 +8248,10 @@ def test_delete_snapshot(request_type, transport: str = "grpc"): assert response is None -def test_delete_snapshot_non_empty_request_with_auto_populated_field(): +def test__delete_snapshot_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -8246,7 +8268,7 @@ def test_delete_snapshot_non_empty_request_with_auto_populated_field(): call.return_value.name = ( "foo" # operation_request.operation in compute client(s) expect a string. ) - client.delete_snapshot(request=request) + client._delete_snapshot(request=request) call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == bigtable_table_admin.DeleteSnapshotRequest( @@ -8254,11 +8276,11 @@ def test_delete_snapshot_non_empty_request_with_auto_populated_field(): ) -def test_delete_snapshot_use_cached_wrapped_rpc(): +def test__delete_snapshot_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -8277,12 +8299,12 @@ def test_delete_snapshot_use_cached_wrapped_rpc(): ) client._transport._wrapped_methods[client._transport.delete_snapshot] = mock_rpc request = {} - client.delete_snapshot(request) + client._delete_snapshot(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 - client.delete_snapshot(request) + client._delete_snapshot(request) # Establish that a new wrapper was not created for this call assert wrapper_fn.call_count == 0 @@ -8290,13 +8312,13 @@ def test_delete_snapshot_use_cached_wrapped_rpc(): @pytest.mark.asyncio -async def test_delete_snapshot_async_use_cached_wrapped_rpc( +async def test__delete_snapshot_async_use_cached_wrapped_rpc( transport: str = "grpc_asyncio", ): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -8319,12 +8341,12 @@ async def test_delete_snapshot_async_use_cached_wrapped_rpc( ] = mock_rpc request = {} - await client.delete_snapshot(request) + await client._delete_snapshot(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 - await client.delete_snapshot(request) + await client._delete_snapshot(request) # Establish that a new wrapper was not created for this call assert wrapper_fn.call_count == 0 @@ -8332,11 +8354,11 @@ async def test_delete_snapshot_async_use_cached_wrapped_rpc( @pytest.mark.asyncio -async def test_delete_snapshot_async( +async def test__delete_snapshot_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.DeleteSnapshotRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -8349,7 +8371,7 @@ async def test_delete_snapshot_async( with mock.patch.object(type(client.transport.delete_snapshot), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - response = await client.delete_snapshot(request) + response = await client._delete_snapshot(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) @@ -8362,12 +8384,12 @@ async def test_delete_snapshot_async( @pytest.mark.asyncio -async def test_delete_snapshot_async_from_dict(): - await test_delete_snapshot_async(request_type=dict) +async def test__delete_snapshot_async_from_dict(): + await test__delete_snapshot_async(request_type=dict) -def test_delete_snapshot_field_headers(): - client = BigtableTableAdminClient( +def test__delete_snapshot_field_headers(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -8380,7 +8402,7 @@ def test_delete_snapshot_field_headers(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_snapshot), "__call__") as call: call.return_value = None - client.delete_snapshot(request) + client._delete_snapshot(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 @@ -8396,8 +8418,8 @@ def test_delete_snapshot_field_headers(): @pytest.mark.asyncio -async def test_delete_snapshot_field_headers_async(): - client = BigtableTableAdminAsyncClient( +async def test__delete_snapshot_field_headers_async(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -8410,7 +8432,7 @@ async def test_delete_snapshot_field_headers_async(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.delete_snapshot), "__call__") as call: call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_snapshot(request) + await client._delete_snapshot(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) @@ -8425,8 +8447,8 @@ async def test_delete_snapshot_field_headers_async(): ) in kw["metadata"] -def test_delete_snapshot_flattened(): - client = BigtableTableAdminClient( +def test__delete_snapshot_flattened(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -8436,7 +8458,7 @@ def test_delete_snapshot_flattened(): call.return_value = None # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - client.delete_snapshot( + client._delete_snapshot( name="name_value", ) @@ -8449,23 +8471,23 @@ def test_delete_snapshot_flattened(): assert arg == mock_val -def test_delete_snapshot_flattened_error(): - client = BigtableTableAdminClient( +def test__delete_snapshot_flattened_error(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - client.delete_snapshot( + client._delete_snapshot( bigtable_table_admin.DeleteSnapshotRequest(), name="name_value", ) @pytest.mark.asyncio -async def test_delete_snapshot_flattened_async(): - client = BigtableTableAdminAsyncClient( +async def test__delete_snapshot_flattened_async(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -8477,7 +8499,7 @@ async def test_delete_snapshot_flattened_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) # Call the method with a truthy value for each flattened field, # using the keyword arguments to the method. - response = await client.delete_snapshot( + response = await client._delete_snapshot( name="name_value", ) @@ -8491,15 +8513,15 @@ async def test_delete_snapshot_flattened_async(): @pytest.mark.asyncio -async def test_delete_snapshot_flattened_error_async(): - client = BigtableTableAdminAsyncClient( +async def test__delete_snapshot_flattened_error_async(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - await client.delete_snapshot( + await client._delete_snapshot( bigtable_table_admin.DeleteSnapshotRequest(), name="name_value", ) @@ -8513,7 +8535,7 @@ async def test_delete_snapshot_flattened_error_async(): ], ) def test_create_backup(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8541,7 +8563,7 @@ def test_create_backup(request_type, transport: str = "grpc"): def test_create_backup_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -8572,7 +8594,7 @@ def test_create_backup_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -8615,7 +8637,7 @@ async def test_create_backup_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -8660,7 +8682,7 @@ async def test_create_backup_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.CreateBackupRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -8693,7 +8715,7 @@ async def test_create_backup_async_from_dict(): def test_create_backup_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -8723,7 +8745,7 @@ def test_create_backup_field_headers(): @pytest.mark.asyncio async def test_create_backup_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -8754,7 +8776,7 @@ async def test_create_backup_field_headers_async(): def test_create_backup_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -8786,7 +8808,7 @@ def test_create_backup_flattened(): def test_create_backup_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -8803,7 +8825,7 @@ def test_create_backup_flattened_error(): @pytest.mark.asyncio async def test_create_backup_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -8840,7 +8862,7 @@ async def test_create_backup_flattened_async(): @pytest.mark.asyncio async def test_create_backup_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -8863,7 +8885,7 @@ async def test_create_backup_flattened_error_async(): ], ) def test_get_backup(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -8904,7 +8926,7 @@ def test_get_backup(request_type, transport: str = "grpc"): def test_get_backup_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -8933,7 +8955,7 @@ def test_get_backup_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -8969,7 +8991,7 @@ async def test_get_backup_async_use_cached_wrapped_rpc(transport: str = "grpc_as # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -9008,7 +9030,7 @@ async def test_get_backup_async_use_cached_wrapped_rpc(transport: str = "grpc_as async def test_get_backup_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.GetBackupRequest ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -9054,7 +9076,7 @@ async def test_get_backup_async_from_dict(): def test_get_backup_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -9084,7 +9106,7 @@ def test_get_backup_field_headers(): @pytest.mark.asyncio async def test_get_backup_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -9113,7 +9135,7 @@ async def test_get_backup_field_headers_async(): def test_get_backup_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -9137,7 +9159,7 @@ def test_get_backup_flattened(): def test_get_backup_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -9152,7 +9174,7 @@ def test_get_backup_flattened_error(): @pytest.mark.asyncio async def test_get_backup_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -9179,7 +9201,7 @@ async def test_get_backup_flattened_async(): @pytest.mark.asyncio async def test_get_backup_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -9200,7 +9222,7 @@ async def test_get_backup_flattened_error_async(): ], ) def test_update_backup(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9241,7 +9263,7 @@ def test_update_backup(request_type, transport: str = "grpc"): def test_update_backup_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -9266,7 +9288,7 @@ def test_update_backup_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -9304,7 +9326,7 @@ async def test_update_backup_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -9344,7 +9366,7 @@ async def test_update_backup_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.UpdateBackupRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -9390,7 +9412,7 @@ async def test_update_backup_async_from_dict(): def test_update_backup_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -9420,7 +9442,7 @@ def test_update_backup_field_headers(): @pytest.mark.asyncio async def test_update_backup_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -9449,7 +9471,7 @@ async def test_update_backup_field_headers_async(): def test_update_backup_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -9477,7 +9499,7 @@ def test_update_backup_flattened(): def test_update_backup_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -9493,7 +9515,7 @@ def test_update_backup_flattened_error(): @pytest.mark.asyncio async def test_update_backup_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -9524,7 +9546,7 @@ async def test_update_backup_flattened_async(): @pytest.mark.asyncio async def test_update_backup_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -9546,7 +9568,7 @@ async def test_update_backup_flattened_error_async(): ], ) def test_delete_backup(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9574,7 +9596,7 @@ def test_delete_backup(request_type, transport: str = "grpc"): def test_delete_backup_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -9603,7 +9625,7 @@ def test_delete_backup_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -9641,7 +9663,7 @@ async def test_delete_backup_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -9681,7 +9703,7 @@ async def test_delete_backup_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.DeleteBackupRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -9712,7 +9734,7 @@ async def test_delete_backup_async_from_dict(): def test_delete_backup_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -9742,7 +9764,7 @@ def test_delete_backup_field_headers(): @pytest.mark.asyncio async def test_delete_backup_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -9771,7 +9793,7 @@ async def test_delete_backup_field_headers_async(): def test_delete_backup_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -9795,7 +9817,7 @@ def test_delete_backup_flattened(): def test_delete_backup_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -9810,7 +9832,7 @@ def test_delete_backup_flattened_error(): @pytest.mark.asyncio async def test_delete_backup_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -9837,7 +9859,7 @@ async def test_delete_backup_flattened_async(): @pytest.mark.asyncio async def test_delete_backup_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -9858,7 +9880,7 @@ async def test_delete_backup_flattened_error_async(): ], ) def test_list_backups(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -9889,7 +9911,7 @@ def test_list_backups(request_type, transport: str = "grpc"): def test_list_backups_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -9924,7 +9946,7 @@ def test_list_backups_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -9962,7 +9984,7 @@ async def test_list_backups_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -10002,7 +10024,7 @@ async def test_list_backups_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.ListBackupsRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -10038,7 +10060,7 @@ async def test_list_backups_async_from_dict(): def test_list_backups_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -10068,7 +10090,7 @@ def test_list_backups_field_headers(): @pytest.mark.asyncio async def test_list_backups_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -10099,7 +10121,7 @@ async def test_list_backups_field_headers_async(): def test_list_backups_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -10123,7 +10145,7 @@ def test_list_backups_flattened(): def test_list_backups_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -10138,7 +10160,7 @@ def test_list_backups_flattened_error(): @pytest.mark.asyncio async def test_list_backups_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -10167,7 +10189,7 @@ async def test_list_backups_flattened_async(): @pytest.mark.asyncio async def test_list_backups_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -10181,7 +10203,7 @@ async def test_list_backups_flattened_error_async(): def test_list_backups_pager(transport_name: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -10235,7 +10257,7 @@ def test_list_backups_pager(transport_name: str = "grpc"): def test_list_backups_pages(transport_name: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport_name, ) @@ -10277,7 +10299,7 @@ def test_list_backups_pages(transport_name: str = "grpc"): @pytest.mark.asyncio async def test_list_backups_async_pager(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -10327,7 +10349,7 @@ async def test_list_backups_async_pager(): @pytest.mark.asyncio async def test_list_backups_async_pages(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -10381,8 +10403,8 @@ async def test_list_backups_async_pages(): dict, ], ) -def test_restore_table(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( +def test__restore_table(request_type, transport: str = "grpc"): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10395,7 +10417,7 @@ def test_restore_table(request_type, transport: str = "grpc"): with mock.patch.object(type(client.transport.restore_table), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = operations_pb2.Operation(name="operations/spam") - response = client.restore_table(request) + response = client._restore_table(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 @@ -10407,10 +10429,10 @@ def test_restore_table(request_type, transport: str = "grpc"): assert isinstance(response, future.Future) -def test_restore_table_non_empty_request_with_auto_populated_field(): +def test__restore_table_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -10429,7 +10451,7 @@ def test_restore_table_non_empty_request_with_auto_populated_field(): call.return_value.name = ( "foo" # operation_request.operation in compute client(s) expect a string. ) - client.restore_table(request=request) + client._restore_table(request=request) call.assert_called() _, args, _ = call.mock_calls[0] assert args[0] == bigtable_table_admin.RestoreTableRequest( @@ -10439,11 +10461,11 @@ def test_restore_table_non_empty_request_with_auto_populated_field(): ) -def test_restore_table_use_cached_wrapped_rpc(): +def test__restore_table_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -10462,7 +10484,7 @@ def test_restore_table_use_cached_wrapped_rpc(): ) client._transport._wrapped_methods[client._transport.restore_table] = mock_rpc request = {} - client.restore_table(request) + client._restore_table(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 @@ -10472,7 +10494,7 @@ def test_restore_table_use_cached_wrapped_rpc(): # Subsequent calls should use the cached wrapper wrapper_fn.reset_mock() - client.restore_table(request) + client._restore_table(request) # Establish that a new wrapper was not created for this call assert wrapper_fn.call_count == 0 @@ -10480,13 +10502,13 @@ def test_restore_table_use_cached_wrapped_rpc(): @pytest.mark.asyncio -async def test_restore_table_async_use_cached_wrapped_rpc( +async def test__restore_table_async_use_cached_wrapped_rpc( transport: str = "grpc_asyncio", ): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -10509,7 +10531,7 @@ async def test_restore_table_async_use_cached_wrapped_rpc( ] = mock_rpc request = {} - await client.restore_table(request) + await client._restore_table(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 @@ -10519,7 +10541,7 @@ async def test_restore_table_async_use_cached_wrapped_rpc( # Subsequent calls should use the cached wrapper wrapper_fn.reset_mock() - await client.restore_table(request) + await client._restore_table(request) # Establish that a new wrapper was not created for this call assert wrapper_fn.call_count == 0 @@ -10527,11 +10549,11 @@ async def test_restore_table_async_use_cached_wrapped_rpc( @pytest.mark.asyncio -async def test_restore_table_async( +async def test__restore_table_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.RestoreTableRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -10546,7 +10568,7 @@ async def test_restore_table_async( call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/spam") ) - response = await client.restore_table(request) + response = await client._restore_table(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) @@ -10559,12 +10581,12 @@ async def test_restore_table_async( @pytest.mark.asyncio -async def test_restore_table_async_from_dict(): - await test_restore_table_async(request_type=dict) +async def test__restore_table_async_from_dict(): + await test__restore_table_async(request_type=dict) -def test_restore_table_field_headers(): - client = BigtableTableAdminClient( +def test__restore_table_field_headers(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -10577,7 +10599,7 @@ def test_restore_table_field_headers(): # Mock the actual call within the gRPC stub, and fake the request. with mock.patch.object(type(client.transport.restore_table), "__call__") as call: call.return_value = operations_pb2.Operation(name="operations/op") - client.restore_table(request) + client._restore_table(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) == 1 @@ -10593,8 +10615,8 @@ def test_restore_table_field_headers(): @pytest.mark.asyncio -async def test_restore_table_field_headers_async(): - client = BigtableTableAdminAsyncClient( +async def test__restore_table_field_headers_async(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -10609,7 +10631,7 @@ async def test_restore_table_field_headers_async(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/op") ) - await client.restore_table(request) + await client._restore_table(request) # Establish that the underlying gRPC stub method was called. assert len(call.mock_calls) @@ -10632,7 +10654,7 @@ async def test_restore_table_field_headers_async(): ], ) def test_copy_backup(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -10660,7 +10682,7 @@ def test_copy_backup(request_type, transport: str = "grpc"): def test_copy_backup_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -10693,7 +10715,7 @@ def test_copy_backup_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -10736,7 +10758,7 @@ async def test_copy_backup_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -10780,7 +10802,7 @@ async def test_copy_backup_async_use_cached_wrapped_rpc( async def test_copy_backup_async( transport: str = "grpc_asyncio", request_type=bigtable_table_admin.CopyBackupRequest ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -10813,7 +10835,7 @@ async def test_copy_backup_async_from_dict(): def test_copy_backup_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -10843,7 +10865,7 @@ def test_copy_backup_field_headers(): @pytest.mark.asyncio async def test_copy_backup_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -10874,7 +10896,7 @@ async def test_copy_backup_field_headers_async(): def test_copy_backup_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -10910,7 +10932,7 @@ def test_copy_backup_flattened(): def test_copy_backup_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -10928,7 +10950,7 @@ def test_copy_backup_flattened_error(): @pytest.mark.asyncio async def test_copy_backup_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -10969,7 +10991,7 @@ async def test_copy_backup_flattened_async(): @pytest.mark.asyncio async def test_copy_backup_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -10993,7 +11015,7 @@ async def test_copy_backup_flattened_error_async(): ], ) def test_get_iam_policy(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11026,7 +11048,7 @@ def test_get_iam_policy(request_type, transport: str = "grpc"): def test_get_iam_policy_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -11055,7 +11077,7 @@ def test_get_iam_policy_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -11093,7 +11115,7 @@ async def test_get_iam_policy_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -11132,7 +11154,7 @@ async def test_get_iam_policy_async_use_cached_wrapped_rpc( async def test_get_iam_policy_async( transport: str = "grpc_asyncio", request_type=iam_policy_pb2.GetIamPolicyRequest ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -11170,7 +11192,7 @@ async def test_get_iam_policy_async_from_dict(): def test_get_iam_policy_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -11200,7 +11222,7 @@ def test_get_iam_policy_field_headers(): @pytest.mark.asyncio async def test_get_iam_policy_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -11229,7 +11251,7 @@ async def test_get_iam_policy_field_headers_async(): def test_get_iam_policy_from_dict_foreign(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11246,7 +11268,7 @@ def test_get_iam_policy_from_dict_foreign(): def test_get_iam_policy_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -11270,7 +11292,7 @@ def test_get_iam_policy_flattened(): def test_get_iam_policy_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -11285,7 +11307,7 @@ def test_get_iam_policy_flattened_error(): @pytest.mark.asyncio async def test_get_iam_policy_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -11312,7 +11334,7 @@ async def test_get_iam_policy_flattened_async(): @pytest.mark.asyncio async def test_get_iam_policy_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -11333,7 +11355,7 @@ async def test_get_iam_policy_flattened_error_async(): ], ) def test_set_iam_policy(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11366,7 +11388,7 @@ def test_set_iam_policy(request_type, transport: str = "grpc"): def test_set_iam_policy_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -11395,7 +11417,7 @@ def test_set_iam_policy_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -11433,7 +11455,7 @@ async def test_set_iam_policy_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -11472,7 +11494,7 @@ async def test_set_iam_policy_async_use_cached_wrapped_rpc( async def test_set_iam_policy_async( transport: str = "grpc_asyncio", request_type=iam_policy_pb2.SetIamPolicyRequest ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -11510,7 +11532,7 @@ async def test_set_iam_policy_async_from_dict(): def test_set_iam_policy_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -11540,7 +11562,7 @@ def test_set_iam_policy_field_headers(): @pytest.mark.asyncio async def test_set_iam_policy_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -11569,7 +11591,7 @@ async def test_set_iam_policy_field_headers_async(): def test_set_iam_policy_from_dict_foreign(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11587,7 +11609,7 @@ def test_set_iam_policy_from_dict_foreign(): def test_set_iam_policy_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -11611,7 +11633,7 @@ def test_set_iam_policy_flattened(): def test_set_iam_policy_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -11626,7 +11648,7 @@ def test_set_iam_policy_flattened_error(): @pytest.mark.asyncio async def test_set_iam_policy_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -11653,7 +11675,7 @@ async def test_set_iam_policy_flattened_async(): @pytest.mark.asyncio async def test_set_iam_policy_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -11674,7 +11696,7 @@ async def test_set_iam_policy_flattened_error_async(): ], ) def test_test_iam_permissions(request_type, transport: str = "grpc"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -11707,7 +11729,7 @@ def test_test_iam_permissions(request_type, transport: str = "grpc"): def test_test_iam_permissions_non_empty_request_with_auto_populated_field(): # This test is a coverage failsafe to make sure that UUID4 fields are # automatically populated, according to AIP-4235, with non-empty requests. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -11738,7 +11760,7 @@ def test_test_iam_permissions_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -11780,7 +11802,7 @@ async def test_test_iam_permissions_async_use_cached_wrapped_rpc( # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method_async.wrap_method") as wrapper_fn: - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -11820,7 +11842,7 @@ async def test_test_iam_permissions_async( transport: str = "grpc_asyncio", request_type=iam_policy_pb2.TestIamPermissionsRequest, ): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport=transport, ) @@ -11858,7 +11880,7 @@ async def test_test_iam_permissions_async_from_dict(): def test_test_iam_permissions_field_headers(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -11890,7 +11912,7 @@ def test_test_iam_permissions_field_headers(): @pytest.mark.asyncio async def test_test_iam_permissions_field_headers_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -11923,7 +11945,7 @@ async def test_test_iam_permissions_field_headers_async(): def test_test_iam_permissions_from_dict_foreign(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) # Mock the actual call within the gRPC stub, and fake the request. @@ -11942,7 +11964,7 @@ def test_test_iam_permissions_from_dict_foreign(): def test_test_iam_permissions_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -11972,7 +11994,7 @@ def test_test_iam_permissions_flattened(): def test_test_iam_permissions_flattened_error(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) @@ -11988,7 +12010,7 @@ def test_test_iam_permissions_flattened_error(): @pytest.mark.asyncio async def test_test_iam_permissions_flattened_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -12023,7 +12045,7 @@ async def test_test_iam_permissions_flattened_async(): @pytest.mark.asyncio async def test_test_iam_permissions_flattened_error_async(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), ) @@ -12041,7 +12063,7 @@ def test_create_table_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12110,7 +12132,7 @@ def test_create_table_rest_required_fields( assert "tableId" in jsonified_request assert jsonified_request["tableId"] == "table_id_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12172,7 +12194,7 @@ def test_create_table_rest_unset_required_fields(): def test_create_table_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12216,7 +12238,7 @@ def test_create_table_rest_flattened(): def test_create_table_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12236,7 +12258,7 @@ def test_create_table_from_snapshot_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12318,7 +12340,7 @@ def test_create_table_from_snapshot_rest_required_fields( assert "sourceSnapshot" in jsonified_request assert jsonified_request["sourceSnapshot"] == "source_snapshot_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12377,7 +12399,7 @@ def test_create_table_from_snapshot_rest_unset_required_fields(): def test_create_table_from_snapshot_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12420,7 +12442,7 @@ def test_create_table_from_snapshot_rest_flattened(): def test_create_table_from_snapshot_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12440,7 +12462,7 @@ def test_list_tables_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12513,7 +12535,7 @@ def test_list_tables_rest_required_fields( assert "parent" in jsonified_request assert jsonified_request["parent"] == "parent_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12574,7 +12596,7 @@ def test_list_tables_rest_unset_required_fields(): def test_list_tables_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12616,7 +12638,7 @@ def test_list_tables_rest_flattened(): def test_list_tables_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12631,7 +12653,7 @@ def test_list_tables_rest_flattened_error(transport: str = "rest"): def test_list_tables_rest_pager(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12697,7 +12719,7 @@ def test_get_table_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12764,7 +12786,7 @@ def test_get_table_rest_required_fields( assert "name" in jsonified_request assert jsonified_request["name"] == "name_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12816,7 +12838,7 @@ def test_get_table_rest_unset_required_fields(): def test_get_table_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12858,7 +12880,7 @@ def test_get_table_rest_flattened(): def test_get_table_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -12876,7 +12898,7 @@ def test_update_table_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -12947,7 +12969,7 @@ def test_update_table_rest_required_fields( # verify required fields with non-default values are left alone - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -13010,7 +13032,7 @@ def test_update_table_rest_unset_required_fields(): def test_update_table_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -13054,7 +13076,7 @@ def test_update_table_rest_flattened(): def test_update_table_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13073,7 +13095,7 @@ def test_delete_table_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -13138,7 +13160,7 @@ def test_delete_table_rest_required_fields( assert "name" in jsonified_request assert jsonified_request["name"] == "name_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -13187,7 +13209,7 @@ def test_delete_table_rest_unset_required_fields(): def test_delete_table_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -13227,7 +13249,7 @@ def test_delete_table_rest_flattened(): def test_delete_table_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13245,7 +13267,7 @@ def test_undelete_table_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -13314,7 +13336,7 @@ def test_undelete_table_rest_required_fields( assert "name" in jsonified_request assert jsonified_request["name"] == "name_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -13364,7 +13386,7 @@ def test_undelete_table_rest_unset_required_fields(): def test_undelete_table_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -13405,7 +13427,7 @@ def test_undelete_table_rest_flattened(): def test_undelete_table_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13423,7 +13445,7 @@ def test_create_authorized_view_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -13506,7 +13528,7 @@ def test_create_authorized_view_rest_required_fields( assert "authorizedViewId" in jsonified_request assert jsonified_request["authorizedViewId"] == "authorized_view_id_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -13571,7 +13593,7 @@ def test_create_authorized_view_rest_unset_required_fields(): def test_create_authorized_view_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -13614,7 +13636,7 @@ def test_create_authorized_view_rest_flattened(): def test_create_authorized_view_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13634,7 +13656,7 @@ def test_list_authorized_views_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -13712,7 +13734,7 @@ def test_list_authorized_views_rest_required_fields( assert "parent" in jsonified_request assert jsonified_request["parent"] == "parent_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -13775,7 +13797,7 @@ def test_list_authorized_views_rest_unset_required_fields(): def test_list_authorized_views_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -13818,7 +13840,7 @@ def test_list_authorized_views_rest_flattened(): def test_list_authorized_views_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13833,7 +13855,7 @@ def test_list_authorized_views_rest_flattened_error(transport: str = "rest"): def test_list_authorized_views_rest_pager(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -13900,7 +13922,7 @@ def test_get_authorized_view_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -13971,7 +13993,7 @@ def test_get_authorized_view_rest_required_fields( assert "name" in jsonified_request assert jsonified_request["name"] == "name_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14023,7 +14045,7 @@ def test_get_authorized_view_rest_unset_required_fields(): def test_get_authorized_view_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14068,7 +14090,7 @@ def test_get_authorized_view_rest_flattened(): def test_get_authorized_view_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14086,7 +14108,7 @@ def test_update_authorized_view_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14162,7 +14184,7 @@ def test_update_authorized_view_rest_required_fields( # verify required fields with non-default values are left alone - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14220,7 +14242,7 @@ def test_update_authorized_view_rest_unset_required_fields(): def test_update_authorized_view_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14266,7 +14288,7 @@ def test_update_authorized_view_rest_flattened(): def test_update_authorized_view_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14285,7 +14307,7 @@ def test_delete_authorized_view_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14357,7 +14379,7 @@ def test_delete_authorized_view_rest_required_fields( assert "name" in jsonified_request assert jsonified_request["name"] == "name_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14406,7 +14428,7 @@ def test_delete_authorized_view_rest_unset_required_fields(): def test_delete_authorized_view_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14449,7 +14471,7 @@ def test_delete_authorized_view_rest_flattened(): def test_delete_authorized_view_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14463,11 +14485,11 @@ def test_delete_authorized_view_rest_flattened_error(transport: str = "rest"): ) -def test_modify_column_families_rest_use_cached_wrapped_rpc(): +def test__modify_column_families_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14492,19 +14514,19 @@ def test_modify_column_families_rest_use_cached_wrapped_rpc(): ] = mock_rpc request = {} - client.modify_column_families(request) + client._modify_column_families(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 - client.modify_column_families(request) + client._modify_column_families(request) # Establish that a new wrapper was not created for this call assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -def test_modify_column_families_rest_required_fields( +def test__modify_column_families_rest_required_fields( request_type=bigtable_table_admin.ModifyColumnFamiliesRequest, ): transport_class = transports.BigtableTableAdminRestTransport @@ -14537,7 +14559,7 @@ def test_modify_column_families_rest_required_fields( assert "name" in jsonified_request assert jsonified_request["name"] == "name_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14573,14 +14595,14 @@ def test_modify_column_families_rest_required_fields( req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - response = client.modify_column_families(request) + response = client._modify_column_families(request) expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] assert expected_params == actual_params -def test_modify_column_families_rest_unset_required_fields(): +def test__modify_column_families_rest_unset_required_fields(): transport = transports.BigtableTableAdminRestTransport( credentials=ga_credentials.AnonymousCredentials ) @@ -14597,8 +14619,8 @@ def test_modify_column_families_rest_unset_required_fields(): ) -def test_modify_column_families_rest_flattened(): - client = BigtableTableAdminClient( +def test__modify_column_families_rest_flattened(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14632,7 +14654,7 @@ def test_modify_column_families_rest_flattened(): req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - client.modify_column_families(**mock_args) + client._modify_column_families(**mock_args) # Establish that the underlying call was made with the expected # request object values. @@ -14645,8 +14667,8 @@ def test_modify_column_families_rest_flattened(): ) -def test_modify_column_families_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( +def test__modify_column_families_rest_flattened_error(transport: str = "rest"): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14654,7 +14676,7 @@ def test_modify_column_families_rest_flattened_error(transport: str = "rest"): # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - client.modify_column_families( + client._modify_column_families( bigtable_table_admin.ModifyColumnFamiliesRequest(), name="name_value", modifications=[ @@ -14669,7 +14691,7 @@ def test_drop_row_range_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14734,7 +14756,7 @@ def test_drop_row_range_rest_required_fields( assert "name" in jsonified_request assert jsonified_request["name"] == "name_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14787,7 +14809,7 @@ def test_generate_consistency_token_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14857,7 +14879,7 @@ def test_generate_consistency_token_rest_required_fields( assert "name" in jsonified_request assert jsonified_request["name"] == "name_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14912,7 +14934,7 @@ def test_generate_consistency_token_rest_unset_required_fields(): def test_generate_consistency_token_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -14957,7 +14979,7 @@ def test_generate_consistency_token_rest_flattened(): def test_generate_consistency_token_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -14975,7 +14997,7 @@ def test_check_consistency_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15046,7 +15068,7 @@ def test_check_consistency_rest_required_fields( assert "consistencyToken" in jsonified_request assert jsonified_request["consistencyToken"] == "consistency_token_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15109,7 +15131,7 @@ def test_check_consistency_rest_unset_required_fields(): def test_check_consistency_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15153,7 +15175,7 @@ def test_check_consistency_rest_flattened(): def test_check_consistency_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15168,11 +15190,11 @@ def test_check_consistency_rest_flattened_error(transport: str = "rest"): ) -def test_snapshot_table_rest_use_cached_wrapped_rpc(): +def test__snapshot_table_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15192,7 +15214,7 @@ def test_snapshot_table_rest_use_cached_wrapped_rpc(): client._transport._wrapped_methods[client._transport.snapshot_table] = mock_rpc request = {} - client.snapshot_table(request) + client._snapshot_table(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 @@ -15201,14 +15223,14 @@ def test_snapshot_table_rest_use_cached_wrapped_rpc(): # subsequent calls should use the cached wrapper wrapper_fn.reset_mock() - client.snapshot_table(request) + client._snapshot_table(request) # Establish that a new wrapper was not created for this call assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -def test_snapshot_table_rest_required_fields( +def test__snapshot_table_rest_required_fields( request_type=bigtable_table_admin.SnapshotTableRequest, ): transport_class = transports.BigtableTableAdminRestTransport @@ -15249,7 +15271,7 @@ def test_snapshot_table_rest_required_fields( assert "snapshotId" in jsonified_request assert jsonified_request["snapshotId"] == "snapshot_id_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15282,14 +15304,14 @@ def test_snapshot_table_rest_required_fields( req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - response = client.snapshot_table(request) + response = client._snapshot_table(request) expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] assert expected_params == actual_params -def test_snapshot_table_rest_unset_required_fields(): +def test__snapshot_table_rest_unset_required_fields(): transport = transports.BigtableTableAdminRestTransport( credentials=ga_credentials.AnonymousCredentials ) @@ -15307,8 +15329,8 @@ def test_snapshot_table_rest_unset_required_fields(): ) -def test_snapshot_table_rest_flattened(): - client = BigtableTableAdminClient( +def test__snapshot_table_rest_flattened(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15338,7 +15360,7 @@ def test_snapshot_table_rest_flattened(): req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - client.snapshot_table(**mock_args) + client._snapshot_table(**mock_args) # Establish that the underlying call was made with the expected # request object values. @@ -15351,8 +15373,8 @@ def test_snapshot_table_rest_flattened(): ) -def test_snapshot_table_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( +def test__snapshot_table_rest_flattened_error(transport: str = "rest"): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15360,7 +15382,7 @@ def test_snapshot_table_rest_flattened_error(transport: str = "rest"): # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - client.snapshot_table( + client._snapshot_table( bigtable_table_admin.SnapshotTableRequest(), name="name_value", cluster="cluster_value", @@ -15369,11 +15391,11 @@ def test_snapshot_table_rest_flattened_error(transport: str = "rest"): ) -def test_get_snapshot_rest_use_cached_wrapped_rpc(): +def test__get_snapshot_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15393,19 +15415,19 @@ def test_get_snapshot_rest_use_cached_wrapped_rpc(): client._transport._wrapped_methods[client._transport.get_snapshot] = mock_rpc request = {} - client.get_snapshot(request) + client._get_snapshot(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 - client.get_snapshot(request) + client._get_snapshot(request) # Establish that a new wrapper was not created for this call assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -def test_get_snapshot_rest_required_fields( +def test__get_snapshot_rest_required_fields( request_type=bigtable_table_admin.GetSnapshotRequest, ): transport_class = transports.BigtableTableAdminRestTransport @@ -15438,7 +15460,7 @@ def test_get_snapshot_rest_required_fields( assert "name" in jsonified_request assert jsonified_request["name"] == "name_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15473,14 +15495,14 @@ def test_get_snapshot_rest_required_fields( req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - response = client.get_snapshot(request) + response = client._get_snapshot(request) expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] assert expected_params == actual_params -def test_get_snapshot_rest_unset_required_fields(): +def test__get_snapshot_rest_unset_required_fields(): transport = transports.BigtableTableAdminRestTransport( credentials=ga_credentials.AnonymousCredentials ) @@ -15489,8 +15511,8 @@ def test_get_snapshot_rest_unset_required_fields(): assert set(unset_fields) == (set(()) & set(("name",))) -def test_get_snapshot_rest_flattened(): - client = BigtableTableAdminClient( +def test__get_snapshot_rest_flattened(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15521,7 +15543,7 @@ def test_get_snapshot_rest_flattened(): req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - client.get_snapshot(**mock_args) + client._get_snapshot(**mock_args) # Establish that the underlying call was made with the expected # request object values. @@ -15534,8 +15556,8 @@ def test_get_snapshot_rest_flattened(): ) -def test_get_snapshot_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( +def test__get_snapshot_rest_flattened_error(transport: str = "rest"): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15543,17 +15565,17 @@ def test_get_snapshot_rest_flattened_error(transport: str = "rest"): # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - client.get_snapshot( + client._get_snapshot( bigtable_table_admin.GetSnapshotRequest(), name="name_value", ) -def test_list_snapshots_rest_use_cached_wrapped_rpc(): +def test__list_snapshots_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15573,19 +15595,19 @@ def test_list_snapshots_rest_use_cached_wrapped_rpc(): client._transport._wrapped_methods[client._transport.list_snapshots] = mock_rpc request = {} - client.list_snapshots(request) + client._list_snapshots(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 - client.list_snapshots(request) + client._list_snapshots(request) # Establish that a new wrapper was not created for this call assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -def test_list_snapshots_rest_required_fields( +def test__list_snapshots_rest_required_fields( request_type=bigtable_table_admin.ListSnapshotsRequest, ): transport_class = transports.BigtableTableAdminRestTransport @@ -15625,7 +15647,7 @@ def test_list_snapshots_rest_required_fields( assert "parent" in jsonified_request assert jsonified_request["parent"] == "parent_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15660,14 +15682,14 @@ def test_list_snapshots_rest_required_fields( req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - response = client.list_snapshots(request) + response = client._list_snapshots(request) expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] assert expected_params == actual_params -def test_list_snapshots_rest_unset_required_fields(): +def test__list_snapshots_rest_unset_required_fields(): transport = transports.BigtableTableAdminRestTransport( credentials=ga_credentials.AnonymousCredentials ) @@ -15684,8 +15706,8 @@ def test_list_snapshots_rest_unset_required_fields(): ) -def test_list_snapshots_rest_flattened(): - client = BigtableTableAdminClient( +def test__list_snapshots_rest_flattened(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15716,7 +15738,7 @@ def test_list_snapshots_rest_flattened(): req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - client.list_snapshots(**mock_args) + client._list_snapshots(**mock_args) # Establish that the underlying call was made with the expected # request object values. @@ -15729,8 +15751,8 @@ def test_list_snapshots_rest_flattened(): ) -def test_list_snapshots_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( +def test__list_snapshots_rest_flattened_error(transport: str = "rest"): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15738,14 +15760,14 @@ def test_list_snapshots_rest_flattened_error(transport: str = "rest"): # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - client.list_snapshots( + client._list_snapshots( bigtable_table_admin.ListSnapshotsRequest(), parent="parent_value", ) -def test_list_snapshots_rest_pager(transport: str = "rest"): - client = BigtableTableAdminClient( +def test__list_snapshots_rest_pager(transport: str = "rest"): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15798,22 +15820,22 @@ def test_list_snapshots_rest_pager(transport: str = "rest"): "parent": "projects/sample1/instances/sample2/clusters/sample3" } - pager = client.list_snapshots(request=sample_request) + pager = client._list_snapshots(request=sample_request) results = list(pager) assert len(results) == 6 assert all(isinstance(i, table.Snapshot) for i in results) - pages = list(client.list_snapshots(request=sample_request).pages) + pages = list(client._list_snapshots(request=sample_request).pages) for page_, token in zip(pages, ["abc", "def", "ghi", ""]): assert page_.raw_page.next_page_token == token -def test_delete_snapshot_rest_use_cached_wrapped_rpc(): +def test__delete_snapshot_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15833,19 +15855,19 @@ def test_delete_snapshot_rest_use_cached_wrapped_rpc(): client._transport._wrapped_methods[client._transport.delete_snapshot] = mock_rpc request = {} - client.delete_snapshot(request) + client._delete_snapshot(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 - client.delete_snapshot(request) + client._delete_snapshot(request) # Establish that a new wrapper was not created for this call assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -def test_delete_snapshot_rest_required_fields( +def test__delete_snapshot_rest_required_fields( request_type=bigtable_table_admin.DeleteSnapshotRequest, ): transport_class = transports.BigtableTableAdminRestTransport @@ -15878,7 +15900,7 @@ def test_delete_snapshot_rest_required_fields( assert "name" in jsonified_request assert jsonified_request["name"] == "name_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15910,14 +15932,14 @@ def test_delete_snapshot_rest_required_fields( req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - response = client.delete_snapshot(request) + response = client._delete_snapshot(request) expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] assert expected_params == actual_params -def test_delete_snapshot_rest_unset_required_fields(): +def test__delete_snapshot_rest_unset_required_fields(): transport = transports.BigtableTableAdminRestTransport( credentials=ga_credentials.AnonymousCredentials ) @@ -15926,8 +15948,8 @@ def test_delete_snapshot_rest_unset_required_fields(): assert set(unset_fields) == (set(()) & set(("name",))) -def test_delete_snapshot_rest_flattened(): - client = BigtableTableAdminClient( +def test__delete_snapshot_rest_flattened(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -15956,7 +15978,7 @@ def test_delete_snapshot_rest_flattened(): req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - client.delete_snapshot(**mock_args) + client._delete_snapshot(**mock_args) # Establish that the underlying call was made with the expected # request object values. @@ -15969,8 +15991,8 @@ def test_delete_snapshot_rest_flattened(): ) -def test_delete_snapshot_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( +def test__delete_snapshot_rest_flattened_error(transport: str = "rest"): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -15978,7 +16000,7 @@ def test_delete_snapshot_rest_flattened_error(transport: str = "rest"): # Attempting to call a method with both a request object and flattened # fields is an error. with pytest.raises(ValueError): - client.delete_snapshot( + client._delete_snapshot( bigtable_table_admin.DeleteSnapshotRequest(), name="name_value", ) @@ -15988,7 +16010,7 @@ def test_create_backup_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16066,7 +16088,7 @@ def test_create_backup_rest_required_fields( assert "backupId" in jsonified_request assert jsonified_request["backupId"] == "backup_id_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16131,7 +16153,7 @@ def test_create_backup_rest_unset_required_fields(): def test_create_backup_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16176,7 +16198,7 @@ def test_create_backup_rest_flattened(): def test_create_backup_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16196,7 +16218,7 @@ def test_get_backup_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16261,7 +16283,7 @@ def test_get_backup_rest_required_fields( assert "name" in jsonified_request assert jsonified_request["name"] == "name_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16313,7 +16335,7 @@ def test_get_backup_rest_unset_required_fields(): def test_get_backup_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16358,7 +16380,7 @@ def test_get_backup_rest_flattened(): def test_get_backup_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16376,7 +16398,7 @@ def test_update_backup_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16438,7 +16460,7 @@ def test_update_backup_rest_required_fields( # verify required fields with non-default values are left alone - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16499,7 +16521,7 @@ def test_update_backup_rest_unset_required_fields(): def test_update_backup_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16547,7 +16569,7 @@ def test_update_backup_rest_flattened(): def test_update_backup_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16566,7 +16588,7 @@ def test_delete_backup_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16631,7 +16653,7 @@ def test_delete_backup_rest_required_fields( assert "name" in jsonified_request assert jsonified_request["name"] == "name_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16680,7 +16702,7 @@ def test_delete_backup_rest_unset_required_fields(): def test_delete_backup_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16723,7 +16745,7 @@ def test_delete_backup_rest_flattened(): def test_delete_backup_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16741,7 +16763,7 @@ def test_list_backups_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16815,7 +16837,7 @@ def test_list_backups_rest_required_fields( assert "parent" in jsonified_request assert jsonified_request["parent"] == "parent_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16877,7 +16899,7 @@ def test_list_backups_rest_unset_required_fields(): def test_list_backups_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -16922,7 +16944,7 @@ def test_list_backups_rest_flattened(): def test_list_backups_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -16937,7 +16959,7 @@ def test_list_backups_rest_flattened_error(transport: str = "rest"): def test_list_backups_rest_pager(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17001,11 +17023,11 @@ def test_list_backups_rest_pager(transport: str = "rest"): assert page_.raw_page.next_page_token == token -def test_restore_table_rest_use_cached_wrapped_rpc(): +def test__restore_table_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17025,7 +17047,7 @@ def test_restore_table_rest_use_cached_wrapped_rpc(): client._transport._wrapped_methods[client._transport.restore_table] = mock_rpc request = {} - client.restore_table(request) + client._restore_table(request) # Establish that the underlying gRPC stub method was called. assert mock_rpc.call_count == 1 @@ -17034,14 +17056,14 @@ def test_restore_table_rest_use_cached_wrapped_rpc(): # subsequent calls should use the cached wrapper wrapper_fn.reset_mock() - client.restore_table(request) + client._restore_table(request) # Establish that a new wrapper was not created for this call assert wrapper_fn.call_count == 0 assert mock_rpc.call_count == 2 -def test_restore_table_rest_required_fields( +def test__restore_table_rest_required_fields( request_type=bigtable_table_admin.RestoreTableRequest, ): transport_class = transports.BigtableTableAdminRestTransport @@ -17078,7 +17100,7 @@ def test_restore_table_rest_required_fields( assert "tableId" in jsonified_request assert jsonified_request["tableId"] == "table_id_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17111,14 +17133,14 @@ def test_restore_table_rest_required_fields( req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - response = client.restore_table(request) + response = client._restore_table(request) expected_params = [("$alt", "json;enum-encoding=int")] actual_params = req.call_args.kwargs["params"] assert expected_params == actual_params -def test_restore_table_rest_unset_required_fields(): +def test__restore_table_rest_unset_required_fields(): transport = transports.BigtableTableAdminRestTransport( credentials=ga_credentials.AnonymousCredentials ) @@ -17139,7 +17161,7 @@ def test_copy_backup_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17216,7 +17238,7 @@ def test_copy_backup_rest_required_fields( assert "sourceBackup" in jsonified_request assert jsonified_request["sourceBackup"] == "source_backup_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17276,7 +17298,7 @@ def test_copy_backup_rest_unset_required_fields(): def test_copy_backup_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17322,7 +17344,7 @@ def test_copy_backup_rest_flattened(): def test_copy_backup_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17343,7 +17365,7 @@ def test_get_iam_policy_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17408,7 +17430,7 @@ def test_get_iam_policy_rest_required_fields( assert "resource" in jsonified_request assert jsonified_request["resource"] == "resource_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17459,7 +17481,7 @@ def test_get_iam_policy_rest_unset_required_fields(): def test_get_iam_policy_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17502,7 +17524,7 @@ def test_get_iam_policy_rest_flattened(): def test_get_iam_policy_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17520,7 +17542,7 @@ def test_set_iam_policy_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17585,7 +17607,7 @@ def test_set_iam_policy_rest_required_fields( assert "resource" in jsonified_request assert jsonified_request["resource"] == "resource_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17644,7 +17666,7 @@ def test_set_iam_policy_rest_unset_required_fields(): def test_set_iam_policy_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17687,7 +17709,7 @@ def test_set_iam_policy_rest_flattened(): def test_set_iam_policy_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17705,7 +17727,7 @@ def test_test_iam_permissions_rest_use_cached_wrapped_rpc(): # Clients should use _prep_wrapped_messages to create cached wrapped rpcs, # instead of constructing them on each call with mock.patch("google.api_core.gapic_v1.method.wrap_method") as wrapper_fn: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17778,7 +17800,7 @@ def test_test_iam_permissions_rest_required_fields( assert "permissions" in jsonified_request assert jsonified_request["permissions"] == "permissions_value" - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17837,7 +17859,7 @@ def test_test_iam_permissions_rest_unset_required_fields(): def test_test_iam_permissions_rest_flattened(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -17881,7 +17903,7 @@ def test_test_iam_permissions_rest_flattened(): def test_test_iam_permissions_rest_flattened_error(transport: str = "rest"): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17902,7 +17924,7 @@ def test_credentials_transport_error(): credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport, ) @@ -17912,7 +17934,7 @@ def test_credentials_transport_error(): credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( client_options={"credentials_file": "credentials.json"}, transport=transport, ) @@ -17924,7 +17946,7 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( client_options=options, transport=transport, ) @@ -17933,7 +17955,7 @@ def test_credentials_transport_error(): options = client_options.ClientOptions() options.api_key = "api_key" with pytest.raises(ValueError): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( client_options=options, credentials=ga_credentials.AnonymousCredentials() ) @@ -17942,7 +17964,7 @@ def test_credentials_transport_error(): credentials=ga_credentials.AnonymousCredentials(), ) with pytest.raises(ValueError): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( client_options={"scopes": ["1", "2"]}, transport=transport, ) @@ -17953,7 +17975,7 @@ def test_transport_instance(): transport = transports.BigtableTableAdminGrpcTransport( credentials=ga_credentials.AnonymousCredentials(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) assert client.transport is transport @@ -17989,14 +18011,14 @@ def test_transport_adc(transport_class): def test_transport_kind_grpc(): - transport = BigtableTableAdminClient.get_transport_class("grpc")( + transport = BaseBigtableTableAdminClient.get_transport_class("grpc")( credentials=ga_credentials.AnonymousCredentials() ) assert transport.kind == "grpc" def test_initialize_client_w_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc" ) assert client is not None @@ -18005,7 +18027,7 @@ def test_initialize_client_w_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_table_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18026,7 +18048,7 @@ def test_create_table_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_table_from_snapshot_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18049,7 +18071,7 @@ def test_create_table_from_snapshot_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_list_tables_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18070,7 +18092,7 @@ def test_list_tables_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_table_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18091,7 +18113,7 @@ def test_get_table_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_update_table_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18112,7 +18134,7 @@ def test_update_table_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_delete_table_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18133,7 +18155,7 @@ def test_delete_table_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_undelete_table_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18154,7 +18176,7 @@ def test_undelete_table_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_authorized_view_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18177,7 +18199,7 @@ def test_create_authorized_view_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_list_authorized_views_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18200,7 +18222,7 @@ def test_list_authorized_views_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_authorized_view_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18223,7 +18245,7 @@ def test_get_authorized_view_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_update_authorized_view_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18246,7 +18268,7 @@ def test_update_authorized_view_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_delete_authorized_view_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18268,8 +18290,8 @@ def test_delete_authorized_view_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. -def test_modify_column_families_empty_call_grpc(): - client = BigtableTableAdminClient( +def test__modify_column_families_empty_call_grpc(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18279,7 +18301,7 @@ def test_modify_column_families_empty_call_grpc(): type(client.transport.modify_column_families), "__call__" ) as call: call.return_value = table.Table() - client.modify_column_families(request=None) + client._modify_column_families(request=None) # Establish that the underlying stub method was called. call.assert_called() @@ -18292,7 +18314,7 @@ def test_modify_column_families_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_drop_row_range_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18313,7 +18335,7 @@ def test_drop_row_range_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_generate_consistency_token_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18336,7 +18358,7 @@ def test_generate_consistency_token_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_check_consistency_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18358,8 +18380,8 @@ def test_check_consistency_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. -def test_snapshot_table_empty_call_grpc(): - client = BigtableTableAdminClient( +def test__snapshot_table_empty_call_grpc(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18367,7 +18389,7 @@ def test_snapshot_table_empty_call_grpc(): # Mock the actual call, and fake the request. with mock.patch.object(type(client.transport.snapshot_table), "__call__") as call: call.return_value = operations_pb2.Operation(name="operations/op") - client.snapshot_table(request=None) + client._snapshot_table(request=None) # Establish that the underlying stub method was called. call.assert_called() @@ -18379,8 +18401,8 @@ def test_snapshot_table_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. -def test_get_snapshot_empty_call_grpc(): - client = BigtableTableAdminClient( +def test__get_snapshot_empty_call_grpc(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18388,7 +18410,7 @@ def test_get_snapshot_empty_call_grpc(): # Mock the actual call, and fake the request. with mock.patch.object(type(client.transport.get_snapshot), "__call__") as call: call.return_value = table.Snapshot() - client.get_snapshot(request=None) + client._get_snapshot(request=None) # Establish that the underlying stub method was called. call.assert_called() @@ -18400,8 +18422,8 @@ def test_get_snapshot_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. -def test_list_snapshots_empty_call_grpc(): - client = BigtableTableAdminClient( +def test__list_snapshots_empty_call_grpc(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18409,7 +18431,7 @@ def test_list_snapshots_empty_call_grpc(): # Mock the actual call, and fake the request. with mock.patch.object(type(client.transport.list_snapshots), "__call__") as call: call.return_value = bigtable_table_admin.ListSnapshotsResponse() - client.list_snapshots(request=None) + client._list_snapshots(request=None) # Establish that the underlying stub method was called. call.assert_called() @@ -18421,8 +18443,8 @@ def test_list_snapshots_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. -def test_delete_snapshot_empty_call_grpc(): - client = BigtableTableAdminClient( +def test__delete_snapshot_empty_call_grpc(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18430,7 +18452,7 @@ def test_delete_snapshot_empty_call_grpc(): # Mock the actual call, and fake the request. with mock.patch.object(type(client.transport.delete_snapshot), "__call__") as call: call.return_value = None - client.delete_snapshot(request=None) + client._delete_snapshot(request=None) # Establish that the underlying stub method was called. call.assert_called() @@ -18443,7 +18465,7 @@ def test_delete_snapshot_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_backup_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18464,7 +18486,7 @@ def test_create_backup_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_backup_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18485,7 +18507,7 @@ def test_get_backup_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_update_backup_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18506,7 +18528,7 @@ def test_update_backup_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_delete_backup_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18527,7 +18549,7 @@ def test_delete_backup_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_list_backups_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18547,8 +18569,8 @@ def test_list_backups_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. -def test_restore_table_empty_call_grpc(): - client = BigtableTableAdminClient( +def test__restore_table_empty_call_grpc(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18556,7 +18578,7 @@ def test_restore_table_empty_call_grpc(): # Mock the actual call, and fake the request. with mock.patch.object(type(client.transport.restore_table), "__call__") as call: call.return_value = operations_pb2.Operation(name="operations/op") - client.restore_table(request=None) + client._restore_table(request=None) # Establish that the underlying stub method was called. call.assert_called() @@ -18569,7 +18591,7 @@ def test_restore_table_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_copy_backup_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18590,7 +18612,7 @@ def test_copy_backup_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_iam_policy_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18611,7 +18633,7 @@ def test_get_iam_policy_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_set_iam_policy_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18632,7 +18654,7 @@ def test_set_iam_policy_empty_call_grpc(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_test_iam_permissions_empty_call_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -18653,14 +18675,14 @@ def test_test_iam_permissions_empty_call_grpc(): def test_transport_kind_grpc_asyncio(): - transport = BigtableTableAdminAsyncClient.get_transport_class("grpc_asyncio")( + transport = BaseBigtableTableAdminAsyncClient.get_transport_class("grpc_asyncio")( credentials=async_anonymous_credentials() ) assert transport.kind == "grpc_asyncio" def test_initialize_client_w_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio" ) assert client is not None @@ -18670,7 +18692,7 @@ def test_initialize_client_w_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_create_table_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -18699,7 +18721,7 @@ async def test_create_table_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_create_table_from_snapshot_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -18726,7 +18748,7 @@ async def test_create_table_from_snapshot_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_list_tables_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -18753,7 +18775,7 @@ async def test_list_tables_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_table_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -18782,7 +18804,7 @@ async def test_get_table_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_update_table_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -18807,7 +18829,7 @@ async def test_update_table_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_delete_table_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -18830,7 +18852,7 @@ async def test_delete_table_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_undelete_table_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -18855,7 +18877,7 @@ async def test_undelete_table_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_create_authorized_view_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -18882,7 +18904,7 @@ async def test_create_authorized_view_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_list_authorized_views_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -18911,7 +18933,7 @@ async def test_list_authorized_views_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_authorized_view_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -18942,7 +18964,7 @@ async def test_get_authorized_view_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_update_authorized_view_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -18969,7 +18991,7 @@ async def test_update_authorized_view_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_delete_authorized_view_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -18993,8 +19015,8 @@ async def test_delete_authorized_view_empty_call_grpc_asyncio(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio -async def test_modify_column_families_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( +async def test__modify_column_families_empty_call_grpc_asyncio(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -19011,7 +19033,7 @@ async def test_modify_column_families_empty_call_grpc_asyncio(): deletion_protection=True, ) ) - await client.modify_column_families(request=None) + await client._modify_column_families(request=None) # Establish that the underlying stub method was called. call.assert_called() @@ -19025,7 +19047,7 @@ async def test_modify_column_families_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_drop_row_range_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -19048,7 +19070,7 @@ async def test_drop_row_range_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_generate_consistency_token_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -19077,7 +19099,7 @@ async def test_generate_consistency_token_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_check_consistency_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -19105,8 +19127,8 @@ async def test_check_consistency_empty_call_grpc_asyncio(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio -async def test_snapshot_table_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( +async def test__snapshot_table_empty_call_grpc_asyncio(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -19117,7 +19139,7 @@ async def test_snapshot_table_empty_call_grpc_asyncio(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/spam") ) - await client.snapshot_table(request=None) + await client._snapshot_table(request=None) # Establish that the underlying stub method was called. call.assert_called() @@ -19130,8 +19152,8 @@ async def test_snapshot_table_empty_call_grpc_asyncio(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio -async def test_get_snapshot_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( +async def test__get_snapshot_empty_call_grpc_asyncio(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -19147,7 +19169,7 @@ async def test_get_snapshot_empty_call_grpc_asyncio(): description="description_value", ) ) - await client.get_snapshot(request=None) + await client._get_snapshot(request=None) # Establish that the underlying stub method was called. call.assert_called() @@ -19160,8 +19182,8 @@ async def test_get_snapshot_empty_call_grpc_asyncio(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio -async def test_list_snapshots_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( +async def test__list_snapshots_empty_call_grpc_asyncio(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -19174,7 +19196,7 @@ async def test_list_snapshots_empty_call_grpc_asyncio(): next_page_token="next_page_token_value", ) ) - await client.list_snapshots(request=None) + await client._list_snapshots(request=None) # Establish that the underlying stub method was called. call.assert_called() @@ -19187,8 +19209,8 @@ async def test_list_snapshots_empty_call_grpc_asyncio(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio -async def test_delete_snapshot_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( +async def test__delete_snapshot_empty_call_grpc_asyncio(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -19197,7 +19219,7 @@ async def test_delete_snapshot_empty_call_grpc_asyncio(): with mock.patch.object(type(client.transport.delete_snapshot), "__call__") as call: # Designate an appropriate return value for the call. call.return_value = grpc_helpers_async.FakeUnaryUnaryCall(None) - await client.delete_snapshot(request=None) + await client._delete_snapshot(request=None) # Establish that the underlying stub method was called. call.assert_called() @@ -19211,7 +19233,7 @@ async def test_delete_snapshot_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_create_backup_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -19236,7 +19258,7 @@ async def test_create_backup_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_backup_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -19268,7 +19290,7 @@ async def test_get_backup_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_update_backup_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -19300,7 +19322,7 @@ async def test_update_backup_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_delete_backup_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -19323,7 +19345,7 @@ async def test_delete_backup_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_list_backups_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -19349,8 +19371,8 @@ async def test_list_backups_empty_call_grpc_asyncio(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio -async def test_restore_table_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( +async def test__restore_table_empty_call_grpc_asyncio(): + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -19361,7 +19383,7 @@ async def test_restore_table_empty_call_grpc_asyncio(): call.return_value = grpc_helpers_async.FakeUnaryUnaryCall( operations_pb2.Operation(name="operations/spam") ) - await client.restore_table(request=None) + await client._restore_table(request=None) # Establish that the underlying stub method was called. call.assert_called() @@ -19375,7 +19397,7 @@ async def test_restore_table_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_copy_backup_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -19400,7 +19422,7 @@ async def test_copy_backup_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_get_iam_policy_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -19428,7 +19450,7 @@ async def test_get_iam_policy_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_set_iam_policy_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -19456,7 +19478,7 @@ async def test_set_iam_policy_empty_call_grpc_asyncio(): # i.e. request == None and no flattened fields passed, work. @pytest.mark.asyncio async def test_test_iam_permissions_empty_call_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio", ) @@ -19482,7 +19504,7 @@ async def test_test_iam_permissions_empty_call_grpc_asyncio(): def test_transport_kind_rest(): - transport = BigtableTableAdminClient.get_transport_class("rest")( + transport = BaseBigtableTableAdminClient.get_transport_class("rest")( credentials=ga_credentials.AnonymousCredentials() ) assert transport.kind == "rest" @@ -19491,7 +19513,7 @@ def test_transport_kind_rest(): def test_create_table_rest_bad_request( request_type=bigtable_table_admin.CreateTableRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -19521,7 +19543,7 @@ def test_create_table_rest_bad_request( ], ) def test_create_table_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -19565,7 +19587,7 @@ def test_create_table_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -19622,7 +19644,7 @@ def test_create_table_rest_interceptors(null_interceptor): def test_create_table_from_snapshot_rest_bad_request( request_type=bigtable_table_admin.CreateTableFromSnapshotRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -19652,7 +19674,7 @@ def test_create_table_from_snapshot_rest_bad_request( ], ) def test_create_table_from_snapshot_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -19686,7 +19708,7 @@ def test_create_table_from_snapshot_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -19746,7 +19768,7 @@ def test_create_table_from_snapshot_rest_interceptors(null_interceptor): def test_list_tables_rest_bad_request( request_type=bigtable_table_admin.ListTablesRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -19776,7 +19798,7 @@ def test_list_tables_rest_bad_request( ], ) def test_list_tables_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -19816,7 +19838,7 @@ def test_list_tables_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -19876,7 +19898,7 @@ def test_list_tables_rest_interceptors(null_interceptor): def test_get_table_rest_bad_request(request_type=bigtable_table_admin.GetTableRequest): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -19906,7 +19928,7 @@ def test_get_table_rest_bad_request(request_type=bigtable_table_admin.GetTableRe ], ) def test_get_table_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -19950,7 +19972,7 @@ def test_get_table_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -20007,7 +20029,7 @@ def test_get_table_rest_interceptors(null_interceptor): def test_update_table_rest_bad_request( request_type=bigtable_table_admin.UpdateTableRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -20039,7 +20061,7 @@ def test_update_table_rest_bad_request( ], ) def test_update_table_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -20199,7 +20221,7 @@ def test_update_table_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -20258,7 +20280,7 @@ def test_update_table_rest_interceptors(null_interceptor): def test_delete_table_rest_bad_request( request_type=bigtable_table_admin.DeleteTableRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -20288,7 +20310,7 @@ def test_delete_table_rest_bad_request( ], ) def test_delete_table_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -20322,7 +20344,7 @@ def test_delete_table_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -20367,7 +20389,7 @@ def test_delete_table_rest_interceptors(null_interceptor): def test_undelete_table_rest_bad_request( request_type=bigtable_table_admin.UndeleteTableRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -20397,7 +20419,7 @@ def test_undelete_table_rest_bad_request( ], ) def test_undelete_table_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -20431,7 +20453,7 @@ def test_undelete_table_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -20491,7 +20513,7 @@ def test_undelete_table_rest_interceptors(null_interceptor): def test_create_authorized_view_rest_bad_request( request_type=bigtable_table_admin.CreateAuthorizedViewRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -20521,7 +20543,7 @@ def test_create_authorized_view_rest_bad_request( ], ) def test_create_authorized_view_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -20633,7 +20655,7 @@ def test_create_authorized_view_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -20693,7 +20715,7 @@ def test_create_authorized_view_rest_interceptors(null_interceptor): def test_list_authorized_views_rest_bad_request( request_type=bigtable_table_admin.ListAuthorizedViewsRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -20723,7 +20745,7 @@ def test_list_authorized_views_rest_bad_request( ], ) def test_list_authorized_views_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -20763,7 +20785,7 @@ def test_list_authorized_views_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -20826,7 +20848,7 @@ def test_list_authorized_views_rest_interceptors(null_interceptor): def test_get_authorized_view_rest_bad_request( request_type=bigtable_table_admin.GetAuthorizedViewRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -20858,7 +20880,7 @@ def test_get_authorized_view_rest_bad_request( ], ) def test_get_authorized_view_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -20904,7 +20926,7 @@ def test_get_authorized_view_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -20962,7 +20984,7 @@ def test_get_authorized_view_rest_interceptors(null_interceptor): def test_update_authorized_view_rest_bad_request( request_type=bigtable_table_admin.UpdateAuthorizedViewRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -20996,7 +21018,7 @@ def test_update_authorized_view_rest_bad_request( ], ) def test_update_authorized_view_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -21112,7 +21134,7 @@ def test_update_authorized_view_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -21172,7 +21194,7 @@ def test_update_authorized_view_rest_interceptors(null_interceptor): def test_delete_authorized_view_rest_bad_request( request_type=bigtable_table_admin.DeleteAuthorizedViewRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -21204,7 +21226,7 @@ def test_delete_authorized_view_rest_bad_request( ], ) def test_delete_authorized_view_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -21240,7 +21262,7 @@ def test_delete_authorized_view_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -21282,10 +21304,10 @@ def test_delete_authorized_view_rest_interceptors(null_interceptor): pre.assert_called_once() -def test_modify_column_families_rest_bad_request( +def test__modify_column_families_rest_bad_request( request_type=bigtable_table_admin.ModifyColumnFamiliesRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -21304,7 +21326,7 @@ def test_modify_column_families_rest_bad_request( response_value.request = mock.Mock() req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - client.modify_column_families(request) + client._modify_column_families(request) @pytest.mark.parametrize( @@ -21314,8 +21336,8 @@ def test_modify_column_families_rest_bad_request( dict, ], ) -def test_modify_column_families_rest_call_success(request_type): - client = BigtableTableAdminClient( +def test__modify_column_families_rest_call_success(request_type): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -21342,7 +21364,7 @@ def test_modify_column_families_rest_call_success(request_type): response_value.content = json_return_value.encode("UTF-8") req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - response = client.modify_column_families(request) + response = client._modify_column_families(request) # Establish that the response is the type that we expect. assert isinstance(response, table.Table) @@ -21352,14 +21374,14 @@ def test_modify_column_families_rest_call_success(request_type): @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_modify_column_families_rest_interceptors(null_interceptor): +def test__modify_column_families_rest_interceptors(null_interceptor): transport = transports.BigtableTableAdminRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -21401,7 +21423,7 @@ def test_modify_column_families_rest_interceptors(null_interceptor): post.return_value = table.Table() post_with_metadata.return_value = table.Table(), metadata - client.modify_column_families( + client._modify_column_families( request, metadata=[ ("key", "val"), @@ -21417,7 +21439,7 @@ def test_modify_column_families_rest_interceptors(null_interceptor): def test_drop_row_range_rest_bad_request( request_type=bigtable_table_admin.DropRowRangeRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -21447,7 +21469,7 @@ def test_drop_row_range_rest_bad_request( ], ) def test_drop_row_range_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -21481,7 +21503,7 @@ def test_drop_row_range_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -21526,7 +21548,7 @@ def test_drop_row_range_rest_interceptors(null_interceptor): def test_generate_consistency_token_rest_bad_request( request_type=bigtable_table_admin.GenerateConsistencyTokenRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -21556,7 +21578,7 @@ def test_generate_consistency_token_rest_bad_request( ], ) def test_generate_consistency_token_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -21598,7 +21620,7 @@ def test_generate_consistency_token_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -21661,7 +21683,7 @@ def test_generate_consistency_token_rest_interceptors(null_interceptor): def test_check_consistency_rest_bad_request( request_type=bigtable_table_admin.CheckConsistencyRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -21691,7 +21713,7 @@ def test_check_consistency_rest_bad_request( ], ) def test_check_consistency_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -21731,7 +21753,7 @@ def test_check_consistency_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -21791,10 +21813,10 @@ def test_check_consistency_rest_interceptors(null_interceptor): post_with_metadata.assert_called_once() -def test_snapshot_table_rest_bad_request( +def test__snapshot_table_rest_bad_request( request_type=bigtable_table_admin.SnapshotTableRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -21813,7 +21835,7 @@ def test_snapshot_table_rest_bad_request( response_value.request = mock.Mock() req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - client.snapshot_table(request) + client._snapshot_table(request) @pytest.mark.parametrize( @@ -21823,8 +21845,8 @@ def test_snapshot_table_rest_bad_request( dict, ], ) -def test_snapshot_table_rest_call_success(request_type): - client = BigtableTableAdminClient( +def test__snapshot_table_rest_call_success(request_type): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -21844,21 +21866,21 @@ def test_snapshot_table_rest_call_success(request_type): response_value.content = json_return_value.encode("UTF-8") req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - response = client.snapshot_table(request) + response = client._snapshot_table(request) # Establish that the response is the type that we expect. json_return_value = json_format.MessageToJson(return_value) @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_snapshot_table_rest_interceptors(null_interceptor): +def test__snapshot_table_rest_interceptors(null_interceptor): transport = transports.BigtableTableAdminRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -21902,7 +21924,7 @@ def test_snapshot_table_rest_interceptors(null_interceptor): post.return_value = operations_pb2.Operation() post_with_metadata.return_value = operations_pb2.Operation(), metadata - client.snapshot_table( + client._snapshot_table( request, metadata=[ ("key", "val"), @@ -21915,10 +21937,10 @@ def test_snapshot_table_rest_interceptors(null_interceptor): post_with_metadata.assert_called_once() -def test_get_snapshot_rest_bad_request( +def test__get_snapshot_rest_bad_request( request_type=bigtable_table_admin.GetSnapshotRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -21939,7 +21961,7 @@ def test_get_snapshot_rest_bad_request( response_value.request = mock.Mock() req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - client.get_snapshot(request) + client._get_snapshot(request) @pytest.mark.parametrize( @@ -21949,8 +21971,8 @@ def test_get_snapshot_rest_bad_request( dict, ], ) -def test_get_snapshot_rest_call_success(request_type): - client = BigtableTableAdminClient( +def test__get_snapshot_rest_call_success(request_type): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -21980,7 +22002,7 @@ def test_get_snapshot_rest_call_success(request_type): response_value.content = json_return_value.encode("UTF-8") req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - response = client.get_snapshot(request) + response = client._get_snapshot(request) # Establish that the response is the type that we expect. assert isinstance(response, table.Snapshot) @@ -21991,14 +22013,14 @@ def test_get_snapshot_rest_call_success(request_type): @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_get_snapshot_rest_interceptors(null_interceptor): +def test__get_snapshot_rest_interceptors(null_interceptor): transport = transports.BigtableTableAdminRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -22039,7 +22061,7 @@ def test_get_snapshot_rest_interceptors(null_interceptor): post.return_value = table.Snapshot() post_with_metadata.return_value = table.Snapshot(), metadata - client.get_snapshot( + client._get_snapshot( request, metadata=[ ("key", "val"), @@ -22052,10 +22074,10 @@ def test_get_snapshot_rest_interceptors(null_interceptor): post_with_metadata.assert_called_once() -def test_list_snapshots_rest_bad_request( +def test__list_snapshots_rest_bad_request( request_type=bigtable_table_admin.ListSnapshotsRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -22074,7 +22096,7 @@ def test_list_snapshots_rest_bad_request( response_value.request = mock.Mock() req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - client.list_snapshots(request) + client._list_snapshots(request) @pytest.mark.parametrize( @@ -22084,8 +22106,8 @@ def test_list_snapshots_rest_bad_request( dict, ], ) -def test_list_snapshots_rest_call_success(request_type): - client = BigtableTableAdminClient( +def test__list_snapshots_rest_call_success(request_type): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -22110,7 +22132,7 @@ def test_list_snapshots_rest_call_success(request_type): response_value.content = json_return_value.encode("UTF-8") req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - response = client.list_snapshots(request) + response = client._list_snapshots(request) # Establish that the response is the type that we expect. assert isinstance(response, pagers.ListSnapshotsPager) @@ -22118,14 +22140,14 @@ def test_list_snapshots_rest_call_success(request_type): @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_list_snapshots_rest_interceptors(null_interceptor): +def test__list_snapshots_rest_interceptors(null_interceptor): transport = transports.BigtableTableAdminRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -22172,7 +22194,7 @@ def test_list_snapshots_rest_interceptors(null_interceptor): metadata, ) - client.list_snapshots( + client._list_snapshots( request, metadata=[ ("key", "val"), @@ -22185,10 +22207,10 @@ def test_list_snapshots_rest_interceptors(null_interceptor): post_with_metadata.assert_called_once() -def test_delete_snapshot_rest_bad_request( +def test__delete_snapshot_rest_bad_request( request_type=bigtable_table_admin.DeleteSnapshotRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -22209,7 +22231,7 @@ def test_delete_snapshot_rest_bad_request( response_value.request = mock.Mock() req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - client.delete_snapshot(request) + client._delete_snapshot(request) @pytest.mark.parametrize( @@ -22219,8 +22241,8 @@ def test_delete_snapshot_rest_bad_request( dict, ], ) -def test_delete_snapshot_rest_call_success(request_type): - client = BigtableTableAdminClient( +def test__delete_snapshot_rest_call_success(request_type): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -22242,21 +22264,21 @@ def test_delete_snapshot_rest_call_success(request_type): response_value.content = json_return_value.encode("UTF-8") req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - response = client.delete_snapshot(request) + response = client._delete_snapshot(request) # Establish that the response is the type that we expect. assert response is None @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_delete_snapshot_rest_interceptors(null_interceptor): +def test__delete_snapshot_rest_interceptors(null_interceptor): transport = transports.BigtableTableAdminRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -22287,7 +22309,7 @@ def test_delete_snapshot_rest_interceptors(null_interceptor): ] pre.return_value = request, metadata - client.delete_snapshot( + client._delete_snapshot( request, metadata=[ ("key", "val"), @@ -22301,7 +22323,7 @@ def test_delete_snapshot_rest_interceptors(null_interceptor): def test_create_backup_rest_bad_request( request_type=bigtable_table_admin.CreateBackupRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -22331,7 +22353,7 @@ def test_create_backup_rest_bad_request( ], ) def test_create_backup_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -22458,7 +22480,7 @@ def test_create_backup_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -22517,7 +22539,7 @@ def test_create_backup_rest_interceptors(null_interceptor): def test_get_backup_rest_bad_request( request_type=bigtable_table_admin.GetBackupRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -22549,7 +22571,7 @@ def test_get_backup_rest_bad_request( ], ) def test_get_backup_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -22601,7 +22623,7 @@ def test_get_backup_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -22658,7 +22680,7 @@ def test_get_backup_rest_interceptors(null_interceptor): def test_update_backup_rest_bad_request( request_type=bigtable_table_admin.UpdateBackupRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -22692,7 +22714,7 @@ def test_update_backup_rest_bad_request( ], ) def test_update_backup_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -22839,7 +22861,7 @@ def test_update_backup_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -22896,7 +22918,7 @@ def test_update_backup_rest_interceptors(null_interceptor): def test_delete_backup_rest_bad_request( request_type=bigtable_table_admin.DeleteBackupRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -22928,7 +22950,7 @@ def test_delete_backup_rest_bad_request( ], ) def test_delete_backup_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -22964,7 +22986,7 @@ def test_delete_backup_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -23009,7 +23031,7 @@ def test_delete_backup_rest_interceptors(null_interceptor): def test_list_backups_rest_bad_request( request_type=bigtable_table_admin.ListBackupsRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -23039,7 +23061,7 @@ def test_list_backups_rest_bad_request( ], ) def test_list_backups_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -23079,7 +23101,7 @@ def test_list_backups_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -23138,10 +23160,10 @@ def test_list_backups_rest_interceptors(null_interceptor): post_with_metadata.assert_called_once() -def test_restore_table_rest_bad_request( +def test__restore_table_rest_bad_request( request_type=bigtable_table_admin.RestoreTableRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -23160,7 +23182,7 @@ def test_restore_table_rest_bad_request( response_value.request = mock.Mock() req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - client.restore_table(request) + client._restore_table(request) @pytest.mark.parametrize( @@ -23170,8 +23192,8 @@ def test_restore_table_rest_bad_request( dict, ], ) -def test_restore_table_rest_call_success(request_type): - client = BigtableTableAdminClient( +def test__restore_table_rest_call_success(request_type): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -23191,21 +23213,21 @@ def test_restore_table_rest_call_success(request_type): response_value.content = json_return_value.encode("UTF-8") req.return_value = response_value req.return_value.headers = {"header-1": "value-1", "header-2": "value-2"} - response = client.restore_table(request) + response = client._restore_table(request) # Establish that the response is the type that we expect. json_return_value = json_format.MessageToJson(return_value) @pytest.mark.parametrize("null_interceptor", [True, False]) -def test_restore_table_rest_interceptors(null_interceptor): +def test__restore_table_rest_interceptors(null_interceptor): transport = transports.BigtableTableAdminRestTransport( credentials=ga_credentials.AnonymousCredentials(), interceptor=None if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -23248,7 +23270,7 @@ def test_restore_table_rest_interceptors(null_interceptor): post.return_value = operations_pb2.Operation() post_with_metadata.return_value = operations_pb2.Operation(), metadata - client.restore_table( + client._restore_table( request, metadata=[ ("key", "val"), @@ -23264,7 +23286,7 @@ def test_restore_table_rest_interceptors(null_interceptor): def test_copy_backup_rest_bad_request( request_type=bigtable_table_admin.CopyBackupRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -23294,7 +23316,7 @@ def test_copy_backup_rest_bad_request( ], ) def test_copy_backup_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -23328,7 +23350,7 @@ def test_copy_backup_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -23387,7 +23409,7 @@ def test_copy_backup_rest_interceptors(null_interceptor): def test_get_iam_policy_rest_bad_request( request_type=iam_policy_pb2.GetIamPolicyRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -23417,7 +23439,7 @@ def test_get_iam_policy_rest_bad_request( ], ) def test_get_iam_policy_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -23456,7 +23478,7 @@ def test_get_iam_policy_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -23512,7 +23534,7 @@ def test_get_iam_policy_rest_interceptors(null_interceptor): def test_set_iam_policy_rest_bad_request( request_type=iam_policy_pb2.SetIamPolicyRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -23542,7 +23564,7 @@ def test_set_iam_policy_rest_bad_request( ], ) def test_set_iam_policy_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -23581,7 +23603,7 @@ def test_set_iam_policy_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -23637,7 +23659,7 @@ def test_set_iam_policy_rest_interceptors(null_interceptor): def test_test_iam_permissions_rest_bad_request( request_type=iam_policy_pb2.TestIamPermissionsRequest, ): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) # send a request that will satisfy transcoding @@ -23667,7 +23689,7 @@ def test_test_iam_permissions_rest_bad_request( ], ) def test_test_iam_permissions_rest_call_success(request_type): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) @@ -23704,7 +23726,7 @@ def test_test_iam_permissions_rest_interceptors(null_interceptor): if null_interceptor else transports.BigtableTableAdminRestInterceptor(), ) - client = BigtableTableAdminClient(transport=transport) + client = BaseBigtableTableAdminClient(transport=transport) with mock.patch.object( type(client.transport._session), "request" @@ -23763,7 +23785,7 @@ def test_test_iam_permissions_rest_interceptors(null_interceptor): def test_initialize_client_w_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) assert client is not None @@ -23772,7 +23794,7 @@ def test_initialize_client_w_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_table_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23792,7 +23814,7 @@ def test_create_table_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_table_from_snapshot_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23814,7 +23836,7 @@ def test_create_table_from_snapshot_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_list_tables_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23834,7 +23856,7 @@ def test_list_tables_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_table_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23854,7 +23876,7 @@ def test_get_table_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_update_table_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23874,7 +23896,7 @@ def test_update_table_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_delete_table_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23894,7 +23916,7 @@ def test_delete_table_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_undelete_table_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23914,7 +23936,7 @@ def test_undelete_table_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_authorized_view_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23936,7 +23958,7 @@ def test_create_authorized_view_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_list_authorized_views_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23958,7 +23980,7 @@ def test_list_authorized_views_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_authorized_view_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -23980,7 +24002,7 @@ def test_get_authorized_view_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_update_authorized_view_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24002,7 +24024,7 @@ def test_update_authorized_view_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_delete_authorized_view_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24023,8 +24045,8 @@ def test_delete_authorized_view_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. -def test_modify_column_families_empty_call_rest(): - client = BigtableTableAdminClient( +def test__modify_column_families_empty_call_rest(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24033,7 +24055,7 @@ def test_modify_column_families_empty_call_rest(): with mock.patch.object( type(client.transport.modify_column_families), "__call__" ) as call: - client.modify_column_families(request=None) + client._modify_column_families(request=None) # Establish that the underlying stub method was called. call.assert_called() @@ -24046,7 +24068,7 @@ def test_modify_column_families_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_drop_row_range_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24066,7 +24088,7 @@ def test_drop_row_range_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_generate_consistency_token_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24088,7 +24110,7 @@ def test_generate_consistency_token_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_check_consistency_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24109,15 +24131,15 @@ def test_check_consistency_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. -def test_snapshot_table_empty_call_rest(): - client = BigtableTableAdminClient( +def test__snapshot_table_empty_call_rest(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) # Mock the actual call, and fake the request. with mock.patch.object(type(client.transport.snapshot_table), "__call__") as call: - client.snapshot_table(request=None) + client._snapshot_table(request=None) # Establish that the underlying stub method was called. call.assert_called() @@ -24129,15 +24151,15 @@ def test_snapshot_table_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. -def test_get_snapshot_empty_call_rest(): - client = BigtableTableAdminClient( +def test__get_snapshot_empty_call_rest(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) # Mock the actual call, and fake the request. with mock.patch.object(type(client.transport.get_snapshot), "__call__") as call: - client.get_snapshot(request=None) + client._get_snapshot(request=None) # Establish that the underlying stub method was called. call.assert_called() @@ -24149,15 +24171,15 @@ def test_get_snapshot_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. -def test_list_snapshots_empty_call_rest(): - client = BigtableTableAdminClient( +def test__list_snapshots_empty_call_rest(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) # Mock the actual call, and fake the request. with mock.patch.object(type(client.transport.list_snapshots), "__call__") as call: - client.list_snapshots(request=None) + client._list_snapshots(request=None) # Establish that the underlying stub method was called. call.assert_called() @@ -24169,15 +24191,15 @@ def test_list_snapshots_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. -def test_delete_snapshot_empty_call_rest(): - client = BigtableTableAdminClient( +def test__delete_snapshot_empty_call_rest(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) # Mock the actual call, and fake the request. with mock.patch.object(type(client.transport.delete_snapshot), "__call__") as call: - client.delete_snapshot(request=None) + client._delete_snapshot(request=None) # Establish that the underlying stub method was called. call.assert_called() @@ -24190,7 +24212,7 @@ def test_delete_snapshot_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_create_backup_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24210,7 +24232,7 @@ def test_create_backup_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_backup_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24230,7 +24252,7 @@ def test_get_backup_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_update_backup_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24250,7 +24272,7 @@ def test_update_backup_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_delete_backup_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24270,7 +24292,7 @@ def test_delete_backup_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_list_backups_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24289,15 +24311,15 @@ def test_list_backups_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. -def test_restore_table_empty_call_rest(): - client = BigtableTableAdminClient( +def test__restore_table_empty_call_rest(): + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) # Mock the actual call, and fake the request. with mock.patch.object(type(client.transport.restore_table), "__call__") as call: - client.restore_table(request=None) + client._restore_table(request=None) # Establish that the underlying stub method was called. call.assert_called() @@ -24310,7 +24332,7 @@ def test_restore_table_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_copy_backup_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24330,7 +24352,7 @@ def test_copy_backup_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_get_iam_policy_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24350,7 +24372,7 @@ def test_get_iam_policy_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_set_iam_policy_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24370,7 +24392,7 @@ def test_set_iam_policy_empty_call_rest(): # This test is a coverage failsafe to make sure that totally empty calls, # i.e. request == None and no flattened fields passed, work. def test_test_iam_permissions_empty_call_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24390,7 +24412,7 @@ def test_test_iam_permissions_empty_call_rest(): def test_bigtable_table_admin_rest_lro_client(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest", ) @@ -24408,7 +24430,7 @@ def test_bigtable_table_admin_rest_lro_client(): def test_transport_grpc_default(): # A client should use the gRPC transport by default. - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), ) assert isinstance( @@ -24429,7 +24451,7 @@ def test_bigtable_table_admin_base_transport_error(): def test_bigtable_table_admin_base_transport(): # Instantiate the base transport. with mock.patch( - "google.cloud.bigtable_admin_v2.services.bigtable_table_admin.transports.BigtableTableAdminTransport.__init__" + "google.cloud.bigtable.admin_v2.services.bigtable_table_admin.transports.BigtableTableAdminTransport.__init__" ) as Transport: Transport.return_value = None transport = transports.BigtableTableAdminTransport( @@ -24496,7 +24518,7 @@ def test_bigtable_table_admin_base_transport_with_credentials_file(): with mock.patch.object( google.auth, "load_credentials_from_file", autospec=True ) as load_creds, mock.patch( - "google.cloud.bigtable_admin_v2.services.bigtable_table_admin.transports.BigtableTableAdminTransport._prep_wrapped_messages" + "google.cloud.bigtable.admin_v2.services.bigtable_table_admin.transports.BigtableTableAdminTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None load_creds.return_value = (ga_credentials.AnonymousCredentials(), None) @@ -24522,7 +24544,7 @@ def test_bigtable_table_admin_base_transport_with_credentials_file(): def test_bigtable_table_admin_base_transport_with_adc(): # Test the default credentials are used if credentials and credentials_file are None. with mock.patch.object(google.auth, "default", autospec=True) as adc, mock.patch( - "google.cloud.bigtable_admin_v2.services.bigtable_table_admin.transports.BigtableTableAdminTransport._prep_wrapped_messages" + "google.cloud.bigtable.admin_v2.services.bigtable_table_admin.transports.BigtableTableAdminTransport._prep_wrapped_messages" ) as Transport: Transport.return_value = None adc.return_value = (ga_credentials.AnonymousCredentials(), None) @@ -24534,7 +24556,7 @@ def test_bigtable_table_admin_auth_adc(): # If no credentials are provided, we should use ADC credentials. with mock.patch.object(google.auth, "default", autospec=True) as adc: adc.return_value = (ga_credentials.AnonymousCredentials(), None) - BigtableTableAdminClient() + BaseBigtableTableAdminClient() adc.assert_called_once_with( scopes=None, default_scopes=( @@ -24708,7 +24730,7 @@ def test_bigtable_table_admin_http_transport_client_cert_source_for_mtls(): ], ) def test_bigtable_table_admin_host_no_port(transport_name): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="bigtableadmin.googleapis.com" @@ -24731,7 +24753,7 @@ def test_bigtable_table_admin_host_no_port(transport_name): ], ) def test_bigtable_table_admin_host_with_port(transport_name): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), client_options=client_options.ClientOptions( api_endpoint="bigtableadmin.googleapis.com:8000" @@ -24754,11 +24776,11 @@ def test_bigtable_table_admin_host_with_port(transport_name): def test_bigtable_table_admin_client_transport_session_collision(transport_name): creds1 = ga_credentials.AnonymousCredentials() creds2 = ga_credentials.AnonymousCredentials() - client1 = BigtableTableAdminClient( + client1 = BaseBigtableTableAdminClient( credentials=creds1, transport=transport_name, ) - client2 = BigtableTableAdminClient( + client2 = BaseBigtableTableAdminClient( credentials=creds2, transport=transport_name, ) @@ -24981,7 +25003,7 @@ def test_bigtable_table_admin_transport_channel_mtls_with_adc(transport_class): def test_bigtable_table_admin_grpc_lro_client(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc", ) @@ -24998,7 +25020,7 @@ def test_bigtable_table_admin_grpc_lro_client(): def test_bigtable_table_admin_grpc_lro_async_client(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc_asyncio", ) @@ -25025,7 +25047,7 @@ def test_authorized_view_path(): table=table, authorized_view=authorized_view, ) - actual = BigtableTableAdminClient.authorized_view_path( + actual = BaseBigtableTableAdminClient.authorized_view_path( project, instance, table, authorized_view ) assert expected == actual @@ -25038,10 +25060,10 @@ def test_parse_authorized_view_path(): "table": "cuttlefish", "authorized_view": "mussel", } - path = BigtableTableAdminClient.authorized_view_path(**expected) + path = BaseBigtableTableAdminClient.authorized_view_path(**expected) # Check that the path construction is reversible. - actual = BigtableTableAdminClient.parse_authorized_view_path(path) + actual = BaseBigtableTableAdminClient.parse_authorized_view_path(path) assert expected == actual @@ -25056,7 +25078,9 @@ def test_backup_path(): cluster=cluster, backup=backup, ) - actual = BigtableTableAdminClient.backup_path(project, instance, cluster, backup) + actual = BaseBigtableTableAdminClient.backup_path( + project, instance, cluster, backup + ) assert expected == actual @@ -25067,10 +25091,10 @@ def test_parse_backup_path(): "cluster": "whelk", "backup": "octopus", } - path = BigtableTableAdminClient.backup_path(**expected) + path = BaseBigtableTableAdminClient.backup_path(**expected) # Check that the path construction is reversible. - actual = BigtableTableAdminClient.parse_backup_path(path) + actual = BaseBigtableTableAdminClient.parse_backup_path(path) assert expected == actual @@ -25083,7 +25107,7 @@ def test_cluster_path(): instance=instance, cluster=cluster, ) - actual = BigtableTableAdminClient.cluster_path(project, instance, cluster) + actual = BaseBigtableTableAdminClient.cluster_path(project, instance, cluster) assert expected == actual @@ -25093,10 +25117,10 @@ def test_parse_cluster_path(): "instance": "winkle", "cluster": "nautilus", } - path = BigtableTableAdminClient.cluster_path(**expected) + path = BaseBigtableTableAdminClient.cluster_path(**expected) # Check that the path construction is reversible. - actual = BigtableTableAdminClient.parse_cluster_path(path) + actual = BaseBigtableTableAdminClient.parse_cluster_path(path) assert expected == actual @@ -25113,7 +25137,7 @@ def test_crypto_key_version_path(): crypto_key=crypto_key, crypto_key_version=crypto_key_version, ) - actual = BigtableTableAdminClient.crypto_key_version_path( + actual = BaseBigtableTableAdminClient.crypto_key_version_path( project, location, key_ring, crypto_key, crypto_key_version ) assert expected == actual @@ -25127,10 +25151,10 @@ def test_parse_crypto_key_version_path(): "crypto_key": "cuttlefish", "crypto_key_version": "mussel", } - path = BigtableTableAdminClient.crypto_key_version_path(**expected) + path = BaseBigtableTableAdminClient.crypto_key_version_path(**expected) # Check that the path construction is reversible. - actual = BigtableTableAdminClient.parse_crypto_key_version_path(path) + actual = BaseBigtableTableAdminClient.parse_crypto_key_version_path(path) assert expected == actual @@ -25141,7 +25165,7 @@ def test_instance_path(): project=project, instance=instance, ) - actual = BigtableTableAdminClient.instance_path(project, instance) + actual = BaseBigtableTableAdminClient.instance_path(project, instance) assert expected == actual @@ -25150,10 +25174,10 @@ def test_parse_instance_path(): "project": "scallop", "instance": "abalone", } - path = BigtableTableAdminClient.instance_path(**expected) + path = BaseBigtableTableAdminClient.instance_path(**expected) # Check that the path construction is reversible. - actual = BigtableTableAdminClient.parse_instance_path(path) + actual = BaseBigtableTableAdminClient.parse_instance_path(path) assert expected == actual @@ -25168,7 +25192,7 @@ def test_snapshot_path(): cluster=cluster, snapshot=snapshot, ) - actual = BigtableTableAdminClient.snapshot_path( + actual = BaseBigtableTableAdminClient.snapshot_path( project, instance, cluster, snapshot ) assert expected == actual @@ -25181,10 +25205,10 @@ def test_parse_snapshot_path(): "cluster": "cuttlefish", "snapshot": "mussel", } - path = BigtableTableAdminClient.snapshot_path(**expected) + path = BaseBigtableTableAdminClient.snapshot_path(**expected) # Check that the path construction is reversible. - actual = BigtableTableAdminClient.parse_snapshot_path(path) + actual = BaseBigtableTableAdminClient.parse_snapshot_path(path) assert expected == actual @@ -25197,7 +25221,7 @@ def test_table_path(): instance=instance, table=table, ) - actual = BigtableTableAdminClient.table_path(project, instance, table) + actual = BaseBigtableTableAdminClient.table_path(project, instance, table) assert expected == actual @@ -25207,10 +25231,10 @@ def test_parse_table_path(): "instance": "squid", "table": "clam", } - path = BigtableTableAdminClient.table_path(**expected) + path = BaseBigtableTableAdminClient.table_path(**expected) # Check that the path construction is reversible. - actual = BigtableTableAdminClient.parse_table_path(path) + actual = BaseBigtableTableAdminClient.parse_table_path(path) assert expected == actual @@ -25219,7 +25243,7 @@ def test_common_billing_account_path(): expected = "billingAccounts/{billing_account}".format( billing_account=billing_account, ) - actual = BigtableTableAdminClient.common_billing_account_path(billing_account) + actual = BaseBigtableTableAdminClient.common_billing_account_path(billing_account) assert expected == actual @@ -25227,10 +25251,10 @@ def test_parse_common_billing_account_path(): expected = { "billing_account": "octopus", } - path = BigtableTableAdminClient.common_billing_account_path(**expected) + path = BaseBigtableTableAdminClient.common_billing_account_path(**expected) # Check that the path construction is reversible. - actual = BigtableTableAdminClient.parse_common_billing_account_path(path) + actual = BaseBigtableTableAdminClient.parse_common_billing_account_path(path) assert expected == actual @@ -25239,7 +25263,7 @@ def test_common_folder_path(): expected = "folders/{folder}".format( folder=folder, ) - actual = BigtableTableAdminClient.common_folder_path(folder) + actual = BaseBigtableTableAdminClient.common_folder_path(folder) assert expected == actual @@ -25247,10 +25271,10 @@ def test_parse_common_folder_path(): expected = { "folder": "nudibranch", } - path = BigtableTableAdminClient.common_folder_path(**expected) + path = BaseBigtableTableAdminClient.common_folder_path(**expected) # Check that the path construction is reversible. - actual = BigtableTableAdminClient.parse_common_folder_path(path) + actual = BaseBigtableTableAdminClient.parse_common_folder_path(path) assert expected == actual @@ -25259,7 +25283,7 @@ def test_common_organization_path(): expected = "organizations/{organization}".format( organization=organization, ) - actual = BigtableTableAdminClient.common_organization_path(organization) + actual = BaseBigtableTableAdminClient.common_organization_path(organization) assert expected == actual @@ -25267,10 +25291,10 @@ def test_parse_common_organization_path(): expected = { "organization": "mussel", } - path = BigtableTableAdminClient.common_organization_path(**expected) + path = BaseBigtableTableAdminClient.common_organization_path(**expected) # Check that the path construction is reversible. - actual = BigtableTableAdminClient.parse_common_organization_path(path) + actual = BaseBigtableTableAdminClient.parse_common_organization_path(path) assert expected == actual @@ -25279,7 +25303,7 @@ def test_common_project_path(): expected = "projects/{project}".format( project=project, ) - actual = BigtableTableAdminClient.common_project_path(project) + actual = BaseBigtableTableAdminClient.common_project_path(project) assert expected == actual @@ -25287,10 +25311,10 @@ def test_parse_common_project_path(): expected = { "project": "nautilus", } - path = BigtableTableAdminClient.common_project_path(**expected) + path = BaseBigtableTableAdminClient.common_project_path(**expected) # Check that the path construction is reversible. - actual = BigtableTableAdminClient.parse_common_project_path(path) + actual = BaseBigtableTableAdminClient.parse_common_project_path(path) assert expected == actual @@ -25301,7 +25325,7 @@ def test_common_location_path(): project=project, location=location, ) - actual = BigtableTableAdminClient.common_location_path(project, location) + actual = BaseBigtableTableAdminClient.common_location_path(project, location) assert expected == actual @@ -25310,10 +25334,10 @@ def test_parse_common_location_path(): "project": "squid", "location": "clam", } - path = BigtableTableAdminClient.common_location_path(**expected) + path = BaseBigtableTableAdminClient.common_location_path(**expected) # Check that the path construction is reversible. - actual = BigtableTableAdminClient.parse_common_location_path(path) + actual = BaseBigtableTableAdminClient.parse_common_location_path(path) assert expected == actual @@ -25323,7 +25347,7 @@ def test_client_with_default_client_info(): with mock.patch.object( transports.BigtableTableAdminTransport, "_prep_wrapped_messages" ) as prep: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, ) @@ -25332,7 +25356,7 @@ def test_client_with_default_client_info(): with mock.patch.object( transports.BigtableTableAdminTransport, "_prep_wrapped_messages" ) as prep: - transport_class = BigtableTableAdminClient.get_transport_class() + transport_class = BaseBigtableTableAdminClient.get_transport_class() transport = transport_class( credentials=ga_credentials.AnonymousCredentials(), client_info=client_info, @@ -25341,7 +25365,7 @@ def test_client_with_default_client_info(): def test_transport_close_grpc(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="grpc" ) with mock.patch.object( @@ -25354,7 +25378,7 @@ def test_transport_close_grpc(): @pytest.mark.asyncio async def test_transport_close_grpc_asyncio(): - client = BigtableTableAdminAsyncClient( + client = BaseBigtableTableAdminAsyncClient( credentials=async_anonymous_credentials(), transport="grpc_asyncio" ) with mock.patch.object( @@ -25366,7 +25390,7 @@ async def test_transport_close_grpc_asyncio(): def test_transport_close_rest(): - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport="rest" ) with mock.patch.object( @@ -25383,7 +25407,7 @@ def test_client_ctx(): "grpc", ] for transport in transports: - client = BigtableTableAdminClient( + client = BaseBigtableTableAdminClient( credentials=ga_credentials.AnonymousCredentials(), transport=transport ) # Test client calls underlying transport. @@ -25397,9 +25421,9 @@ def test_client_ctx(): @pytest.mark.parametrize( "client_class,transport_class", [ - (BigtableTableAdminClient, transports.BigtableTableAdminGrpcTransport), + (BaseBigtableTableAdminClient, transports.BigtableTableAdminGrpcTransport), ( - BigtableTableAdminAsyncClient, + BaseBigtableTableAdminAsyncClient, transports.BigtableTableAdminGrpcAsyncIOTransport, ), ], diff --git a/tests/unit/v2_client/test_app_profile.py b/tests/unit/v2_client/test_app_profile.py index 660ee7899..dda84d14b 100644 --- a/tests/unit/v2_client/test_app_profile.py +++ b/tests/unit/v2_client/test_app_profile.py @@ -165,7 +165,7 @@ def test_app_profile___ne__(): def test_app_profile_from_pb_success_w_routing_any(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable.app_profile import AppProfile from google.cloud.bigtable.enums import RoutingPolicyType @@ -194,7 +194,7 @@ def test_app_profile_from_pb_success_w_routing_any(): def test_app_profile_from_pb_success_w_routing_any_multi_cluster_ids(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable.app_profile import AppProfile from google.cloud.bigtable.enums import RoutingPolicyType @@ -225,7 +225,7 @@ def test_app_profile_from_pb_success_w_routing_any_multi_cluster_ids(): def test_app_profile_from_pb_success_w_routing_single(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable.app_profile import AppProfile from google.cloud.bigtable.enums import RoutingPolicyType @@ -258,7 +258,7 @@ def test_app_profile_from_pb_success_w_routing_single(): def test_app_profile_from_pb_w_bad_app_profile_name(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable.app_profile import AppProfile bad_app_profile_name = "BAD_NAME" @@ -270,7 +270,7 @@ def test_app_profile_from_pb_w_bad_app_profile_name(): def test_app_profile_from_pb_w_instance_id_mistmatch(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable.app_profile import AppProfile ALT_INSTANCE_ID = "ALT_INSTANCE_ID" @@ -285,7 +285,7 @@ def test_app_profile_from_pb_w_instance_id_mistmatch(): def test_app_profile_from_pb_w_project_mistmatch(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable.app_profile import AppProfile ALT_PROJECT = "ALT_PROJECT" @@ -300,10 +300,10 @@ def test_app_profile_from_pb_w_project_mistmatch(): def test_app_profile_reload_w_routing_any(): - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable.enums import RoutingPolicyType api = mock.create_autospec(BigtableInstanceAdminClient) @@ -362,10 +362,10 @@ def test_app_profile_reload_w_routing_any(): def test_app_profile_exists(): - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.api_core import exceptions instance_api = mock.create_autospec(BigtableInstanceAdminClient) @@ -397,7 +397,7 @@ def test_app_profile_exists(): def test_app_profile_create_w_routing_any(): - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) from google.cloud.bigtable.app_profile import AppProfile @@ -458,7 +458,7 @@ def test_app_profile_create_w_routing_any(): def test_app_profile_create_w_routing_single(): - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) from google.cloud.bigtable.app_profile import AppProfile @@ -530,11 +530,11 @@ def test_app_profile_create_w_wrong_routing_policy(): def test_app_profile_update_w_routing_any(): from google.longrunning import operations_pb2 from google.protobuf.any_pb2 import Any - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud.bigtable.enums import RoutingPolicyType - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) from google.protobuf import field_mask_pb2 @@ -605,11 +605,11 @@ def test_app_profile_update_w_routing_any(): def test_app_profile_update_w_routing_any_multi_cluster_ids(): from google.longrunning import operations_pb2 from google.protobuf.any_pb2 import Any - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud.bigtable.enums import RoutingPolicyType - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) from google.protobuf import field_mask_pb2 @@ -681,11 +681,11 @@ def test_app_profile_update_w_routing_any_multi_cluster_ids(): def test_app_profile_update_w_routing_single(): from google.longrunning import operations_pb2 from google.protobuf.any_pb2 import Any - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud.bigtable.enums import RoutingPolicyType - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) from google.protobuf import field_mask_pb2 @@ -752,7 +752,7 @@ def test_app_profile_update_w_wrong_routing_policy(): def test_app_profile_delete(): from google.protobuf import empty_pb2 - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) diff --git a/tests/unit/v2_client/test_backup.py b/tests/unit/v2_client/test_backup.py index 9882ca339..a4a65f55b 100644 --- a/tests/unit/v2_client/test_backup.py +++ b/tests/unit/v2_client/test_backup.py @@ -42,9 +42,9 @@ def _make_timestamp(): def _make_table_admin_client(): - from google.cloud.bigtable_admin_v2 import BigtableTableAdminClient + from google.cloud.bigtable.admin_v2 import BaseBigtableTableAdminClient - return mock.create_autospec(BigtableTableAdminClient, instance=True) + return mock.create_autospec(BaseBigtableTableAdminClient, instance=True) def _make_backup(*args, **kwargs): @@ -101,7 +101,7 @@ def test_backup_constructor_explicit(): def test_backup_from_pb_w_project_mismatch(): - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin_v2.types import table from google.cloud.bigtable.backup import Backup alt_project_id = "alt-project-id" @@ -114,7 +114,7 @@ def test_backup_from_pb_w_project_mismatch(): def test_backup_from_pb_w_instance_mismatch(): - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin_v2.types import table from google.cloud.bigtable.backup import Backup alt_instance = "/projects/%s/instances/alt-instance" % PROJECT_ID @@ -127,7 +127,7 @@ def test_backup_from_pb_w_instance_mismatch(): def test_backup_from_pb_w_bad_name(): - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin_v2.types import table from google.cloud.bigtable.backup import Backup client = _Client() @@ -141,7 +141,7 @@ def test_backup_from_pb_w_bad_name(): def test_backup_from_pb_success(): from google.cloud.bigtable.encryption_info import EncryptionInfo from google.cloud.bigtable.error import Status - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin_v2.types import table from google.cloud.bigtable.backup import Backup from google.cloud._helpers import _datetime_to_pb_timestamp from google.rpc.code_pb2 import Code @@ -191,7 +191,7 @@ def test_backup_from_pb_success(): def test_backup_name(): from google.cloud.bigtable.client import Client - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) @@ -226,7 +226,7 @@ def test_backup_parent_none(): def test_backup_parent_w_cluster(): from google.cloud.bigtable.client import Client - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) @@ -243,7 +243,7 @@ def test_backup_parent_w_cluster(): def test_backup_source_table_none(): from google.cloud.bigtable.client import Client - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) @@ -259,7 +259,7 @@ def test_backup_source_table_none(): def test_backup_source_table_valid(): from google.cloud.bigtable.client import Client - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) @@ -310,7 +310,7 @@ def test_backup_size(): def test_backup_state(): - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin_v2.types import table instance = _Instance(INSTANCE_NAME) backup = _make_backup(BACKUP_ID, instance) @@ -349,7 +349,7 @@ def test_backup_create_w_grpc_error(): from google.api_core.exceptions import GoogleAPICallError from google.api_core.exceptions import Unknown from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin_v2.types import table client = _Client() api = client.table_admin_client = _make_table_admin_client() @@ -378,7 +378,7 @@ def test_backup_create_w_grpc_error(): def test_backup_create_w_already_exists(): from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin_v2.types import table from google.cloud.exceptions import Conflict client = _Client() @@ -408,7 +408,7 @@ def test_backup_create_w_already_exists(): def test_backup_create_w_instance_not_found(): from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin_v2.types import table from google.cloud.exceptions import NotFound client = _Client() @@ -472,7 +472,7 @@ def test_backup_create_w_expire_time_not_set(): def test_backup_create_success(): from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin_v2.types import table from google.cloud.bigtable import Client op_future = object() @@ -504,7 +504,7 @@ def test_backup_create_success(): def test_backup_get(): - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin_v2.types import table from google.cloud._helpers import _datetime_to_pb_timestamp timestamp = _datetime_to_pb_timestamp(_make_timestamp()) @@ -530,7 +530,7 @@ def test_backup_get(): def test_backup_reload(): - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin_v2.types import table from google.cloud._helpers import _datetime_to_pb_timestamp timestamp = _datetime_to_pb_timestamp(_make_timestamp()) @@ -594,7 +594,7 @@ def test_backup_exists_w_not_found(): def test_backup_exists_success(): - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin_v2.types import table client = _Client() backup_pb = table.Backup(name=BACKUP_NAME) @@ -656,7 +656,7 @@ def test_backup_delete_success(): def test_backup_update_expire_time_w_grpc_error(): from google.api_core.exceptions import Unknown from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin_v2.types import table from google.protobuf import field_mask_pb2 client = _Client() @@ -682,7 +682,7 @@ def test_backup_update_expire_time_w_grpc_error(): def test_backup_update_expire_time_w_not_found(): from google.api_core.exceptions import NotFound from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin_v2.types import table from google.protobuf import field_mask_pb2 client = _Client() @@ -707,7 +707,7 @@ def test_backup_update_expire_time_w_not_found(): def test_backup_update_expire_time_success(): from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import table + from google.cloud.bigtable.admin_v2.types import table from google.protobuf import field_mask_pb2 client = _Client() @@ -735,7 +735,7 @@ def test_backup_restore_w_grpc_error(): client = _Client() api = client.table_admin_client = _make_table_admin_client() - api.restore_table.side_effect = Unknown("testing") + api._restore_table.side_effect = Unknown("testing") timestamp = _make_timestamp() backup = _make_backup( @@ -749,7 +749,7 @@ def test_backup_restore_w_grpc_error(): with pytest.raises(GoogleAPICallError): backup.restore(TABLE_ID) - api.restore_table.assert_called_once_with( + api._restore_table.assert_called_once_with( request={"parent": INSTANCE_NAME, "table_id": TABLE_ID, "backup": BACKUP_NAME} ) @@ -772,7 +772,7 @@ def _restore_helper(instance_id=None, instance_name=None): op_future = object() client = _Client() api = client.table_admin_client = _make_table_admin_client() - api.restore_table.return_value = op_future + api._restore_table.return_value = op_future timestamp = _make_timestamp() backup = _make_backup( @@ -787,14 +787,14 @@ def _restore_helper(instance_id=None, instance_name=None): assert backup._cluster == CLUSTER_ID assert future is op_future - api.restore_table.assert_called_once_with( + api._restore_table.assert_called_once_with( request={ "parent": instance_name or INSTANCE_NAME, "table_id": TABLE_ID, "backup": BACKUP_NAME, } ) - api.restore_table.reset_mock() + api._restore_table.reset_mock() def test_backup_restore_default(): @@ -807,8 +807,8 @@ def test_backup_restore_to_another_instance(): def test_backup_get_iam_policy(): from google.cloud.bigtable.client import Client - from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( - BigtableTableAdminClient, + from google.cloud.bigtable.admin_v2.services.bigtable_table_admin import ( + BaseBigtableTableAdminClient, ) from google.iam.v1 import policy_pb2 from google.cloud.bigtable.policy import BIGTABLE_ADMIN_ROLE @@ -825,7 +825,7 @@ def test_backup_get_iam_policy(): bindings = [{"role": BIGTABLE_ADMIN_ROLE, "members": members}] iam_policy = policy_pb2.Policy(version=version, etag=etag, bindings=bindings) - table_api = mock.create_autospec(BigtableTableAdminClient) + table_api = mock.create_autospec(BaseBigtableTableAdminClient) client._table_admin_client = table_api table_api.get_iam_policy.return_value = iam_policy @@ -843,8 +843,8 @@ def test_backup_get_iam_policy(): def test_backup_set_iam_policy(): from google.cloud.bigtable.client import Client - from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( - BigtableTableAdminClient, + from google.cloud.bigtable.admin_v2.services.bigtable_table_admin import ( + BaseBigtableTableAdminClient, ) from google.iam.v1 import policy_pb2 from google.cloud.bigtable.policy import Policy @@ -862,7 +862,7 @@ def test_backup_set_iam_policy(): bindings = [{"role": BIGTABLE_ADMIN_ROLE, "members": sorted(members)}] iam_policy_pb = policy_pb2.Policy(version=version, etag=etag, bindings=bindings) - table_api = mock.create_autospec(BigtableTableAdminClient) + table_api = mock.create_autospec(BaseBigtableTableAdminClient) client._table_admin_client = table_api table_api.set_iam_policy.return_value = iam_policy_pb @@ -888,8 +888,8 @@ def test_backup_set_iam_policy(): def test_backup_test_iam_permissions(): from google.cloud.bigtable.client import Client - from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( - BigtableTableAdminClient, + from google.cloud.bigtable.admin_v2.services.bigtable_table_admin import ( + BaseBigtableTableAdminClient, ) from google.iam.v1 import iam_policy_pb2 @@ -903,7 +903,7 @@ def test_backup_test_iam_permissions(): response = iam_policy_pb2.TestIamPermissionsResponse(permissions=permissions) - table_api = mock.create_autospec(BigtableTableAdminClient) + table_api = mock.create_autospec(BaseBigtableTableAdminClient) table_api.test_iam_permissions.return_value = response client._table_admin_client = table_api diff --git a/tests/unit/v2_client/test_client.py b/tests/unit/v2_client/test_client.py index 4338f8553..d15a2edc5 100644 --- a/tests/unit/v2_client/test_client.py +++ b/tests/unit/v2_client/test_client.py @@ -449,18 +449,18 @@ def test_client_table_admin_client_not_initialized_no_admin_flag(): def test_client_table_admin_client_not_initialized_w_admin_flag(): - from google.cloud.bigtable_admin_v2 import BigtableTableAdminClient + from google.cloud.bigtable.admin_v2 import BaseBigtableTableAdminClient credentials = _make_credentials() client = _make_client(project=PROJECT, credentials=credentials, admin=True) table_admin_client = client.table_admin_client - assert isinstance(table_admin_client, BigtableTableAdminClient) + assert isinstance(table_admin_client, BaseBigtableTableAdminClient) assert client._table_admin_client is table_admin_client def test_client_table_admin_client_not_initialized_w_client_info(): - from google.cloud.bigtable_admin_v2 import BigtableTableAdminClient + from google.cloud.bigtable.admin_v2 import BaseBigtableTableAdminClient credentials = _make_credentials() client_info = mock.Mock() @@ -472,7 +472,7 @@ def test_client_table_admin_client_not_initialized_w_client_info(): ) table_admin_client = client.table_admin_client - assert isinstance(table_admin_client, BigtableTableAdminClient) + assert isinstance(table_admin_client, BaseBigtableTableAdminClient) assert client._client_info is client_info assert client._table_admin_client is table_admin_client @@ -488,7 +488,7 @@ def test_client_table_admin_client_not_initialized_w_client_options(): ) client._create_gapic_client_channel = mock.Mock() - patch = mock.patch("google.cloud.bigtable_admin_v2.BigtableTableAdminClient") + patch = mock.patch("google.cloud.bigtable.admin_v2.BaseBigtableTableAdminClient") with patch as mocked: table_admin_client = client.table_admin_client @@ -519,7 +519,7 @@ def test_client_instance_admin_client_not_initialized_no_admin_flag(): def test_client_instance_admin_client_not_initialized_w_admin_flag(): - from google.cloud.bigtable_admin_v2 import BigtableInstanceAdminClient + from google.cloud.bigtable.admin_v2 import BigtableInstanceAdminClient credentials = _make_credentials() client = _make_client(project=PROJECT, credentials=credentials, admin=True) @@ -530,7 +530,7 @@ def test_client_instance_admin_client_not_initialized_w_admin_flag(): def test_client_instance_admin_client_not_initialized_w_client_info(): - from google.cloud.bigtable_admin_v2 import BigtableInstanceAdminClient + from google.cloud.bigtable.admin_v2 import BigtableInstanceAdminClient credentials = _make_credentials() client_info = mock.Mock() @@ -558,7 +558,7 @@ def test_client_instance_admin_client_not_initialized_w_client_options(): ) client._create_gapic_client_channel = mock.Mock() - patch = mock.patch("google.cloud.bigtable_admin_v2.BigtableInstanceAdminClient") + patch = mock.patch("google.cloud.bigtable.admin_v2.BigtableInstanceAdminClient") with patch as mocked: instance_admin_client = client.instance_admin_client @@ -621,11 +621,11 @@ def test_client_instance_factory_non_defaults(): def test_client_list_instances(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import ( bigtable_instance_admin as messages_v2_pb2, ) - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) from google.cloud.bigtable.instance import Instance @@ -673,13 +673,13 @@ def test_client_list_instances(): def test_client_list_clusters(): - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import ( bigtable_instance_admin as messages_v2_pb2, ) - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable.instance import Cluster instance_api = mock.create_autospec(BigtableInstanceAdminClient) diff --git a/tests/unit/v2_client/test_cluster.py b/tests/unit/v2_client/test_cluster.py index 65ed47437..5f239732f 100644 --- a/tests/unit/v2_client/test_cluster.py +++ b/tests/unit/v2_client/test_cluster.py @@ -125,7 +125,7 @@ def test_cluster_kms_key_name_setter(): def test_cluster_from_pb_success(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable.cluster import Cluster from google.cloud.bigtable import enums @@ -161,7 +161,7 @@ def test_cluster_from_pb_success(): def test_cluster_from_pb_w_bad_cluster_name(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable.cluster import Cluster bad_cluster_name = "BAD_NAME" @@ -173,7 +173,7 @@ def test_cluster_from_pb_w_bad_cluster_name(): def test_cluster_from_pb_w_instance_id_mistmatch(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable.cluster import Cluster ALT_INSTANCE_ID = "ALT_INSTANCE_ID" @@ -188,7 +188,7 @@ def test_cluster_from_pb_w_instance_id_mistmatch(): def test_cluster_from_pb_w_project_mistmatch(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable.cluster import Cluster ALT_PROJECT = "ALT_PROJECT" @@ -203,7 +203,7 @@ def test_cluster_from_pb_w_project_mistmatch(): def test_cluster_from_pb_w_autoscaling(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable.cluster import Cluster from google.cloud.bigtable import enums @@ -283,7 +283,7 @@ def test_cluster___ne__(): def _make_instance_admin_client(): - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) @@ -291,7 +291,7 @@ def _make_instance_admin_client(): def test_cluster_reload(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable.enums import StorageType from google.cloud.bigtable.enums import Cluster @@ -348,7 +348,7 @@ def test_cluster_reload(): def test_cluster_exists_hit(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable.instance import Instance credentials = _make_credentials() @@ -412,12 +412,12 @@ def test_cluster_create(): import datetime from google.longrunning import operations_pb2 from google.protobuf.any_pb2 import Any - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud._helpers import _datetime_to_pb_timestamp from google.cloud.bigtable.instance import Instance - from google.cloud.bigtable_admin_v2.types import instance as instance_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as instance_v2_pb2 from google.cloud.bigtable.enums import StorageType NOW = datetime.datetime.utcnow() @@ -467,12 +467,12 @@ def test_cluster_create_w_cmek(): import datetime from google.longrunning import operations_pb2 from google.protobuf.any_pb2 import Any - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud._helpers import _datetime_to_pb_timestamp from google.cloud.bigtable.instance import Instance - from google.cloud.bigtable_admin_v2.types import instance as instance_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as instance_v2_pb2 from google.cloud.bigtable.enums import StorageType NOW = datetime.datetime.utcnow() @@ -527,12 +527,12 @@ def test_cluster_create_w_autoscaling(): import datetime from google.longrunning import operations_pb2 from google.protobuf.any_pb2 import Any - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud._helpers import _datetime_to_pb_timestamp from google.cloud.bigtable.instance import Instance - from google.cloud.bigtable_admin_v2.types import instance as instance_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as instance_v2_pb2 from google.cloud.bigtable.enums import StorageType NOW = datetime.datetime.utcnow() @@ -597,7 +597,7 @@ def test_cluster_update(): from google.protobuf import field_mask_pb2 from google.protobuf.any_pb2 import Any from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud.bigtable.enums import StorageType @@ -664,7 +664,7 @@ def test_cluster_update_w_autoscaling(): from google.protobuf import field_mask_pb2 from google.protobuf.any_pb2 import Any from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud.bigtable.enums import StorageType @@ -723,7 +723,7 @@ def test_cluster_update_w_partial_autoscaling_config(): from google.protobuf import field_mask_pb2 from google.protobuf.any_pb2 import Any from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud.bigtable.enums import StorageType @@ -807,7 +807,7 @@ def test_cluster_update_w_both_manual_and_autoscaling(): from google.protobuf import field_mask_pb2 from google.protobuf.any_pb2 import Any from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud.bigtable.enums import StorageType @@ -866,7 +866,7 @@ def test_cluster_disable_autoscaling(): from google.longrunning import operations_pb2 from google.protobuf import field_mask_pb2 from google.protobuf.any_pb2 import Any - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import ( bigtable_instance_admin as messages_v2_pb2, ) from google.cloud._helpers import _datetime_to_pb_timestamp diff --git a/tests/unit/v2_client/test_column_family.py b/tests/unit/v2_client/test_column_family.py index e4f74e264..5088e55da 100644 --- a/tests/unit/v2_client/test_column_family.py +++ b/tests/unit/v2_client/test_column_family.py @@ -333,12 +333,12 @@ def test_column_family_to_pb_with_rule(): def _create_test_helper(gc_rule=None): - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import ( bigtable_table_admin as table_admin_v2_pb2, ) from ._testing import _FakeStub - from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( - BigtableTableAdminClient, + from google.cloud.bigtable.admin_v2.services.bigtable_table_admin import ( + BaseBigtableTableAdminClient, ) project_id = "project-id" @@ -357,7 +357,7 @@ def _create_test_helper(gc_rule=None): + table_id ) - api = mock.create_autospec(BigtableTableAdminClient) + api = mock.create_autospec(BaseBigtableTableAdminClient) credentials = _make_credentials() client = _make_client(project=project_id, credentials=credentials, admin=True) @@ -405,11 +405,11 @@ def test_column_family_create_with_gc_rule(): def _update_test_helper(gc_rule=None): from ._testing import _FakeStub - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import ( bigtable_table_admin as table_admin_v2_pb2, ) - from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( - BigtableTableAdminClient, + from google.cloud.bigtable.admin_v2.services.bigtable_table_admin import ( + BaseBigtableTableAdminClient, ) project_id = "project-id" @@ -428,7 +428,7 @@ def _update_test_helper(gc_rule=None): + table_id ) - api = mock.create_autospec(BigtableTableAdminClient) + api = mock.create_autospec(BaseBigtableTableAdminClient) credentials = _make_credentials() client = _make_client(project=project_id, credentials=credentials, admin=True) table = _Table(table_name, client=client) @@ -475,12 +475,12 @@ def test_column_family_update_with_gc_rule(): def test_column_family_delete(): from google.protobuf import empty_pb2 - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import ( bigtable_table_admin as table_admin_v2_pb2, ) from ._testing import _FakeStub - from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( - BigtableTableAdminClient, + from google.cloud.bigtable.admin_v2.services.bigtable_table_admin import ( + BaseBigtableTableAdminClient, ) project_id = "project-id" @@ -499,7 +499,7 @@ def test_column_family_delete(): + table_id ) - api = mock.create_autospec(BigtableTableAdminClient) + api = mock.create_autospec(BaseBigtableTableAdminClient) credentials = _make_credentials() client = _make_client(project=project_id, credentials=credentials, admin=True) table = _Table(table_name, client=client) @@ -615,25 +615,25 @@ def WhichOneof(cls, name): def _GcRulePB(*args, **kw): - from google.cloud.bigtable_admin_v2.types import table as table_v2_pb2 + from google.cloud.bigtable.admin_v2.types import table as table_v2_pb2 return table_v2_pb2.GcRule(*args, **kw) def _GcRuleIntersectionPB(*args, **kw): - from google.cloud.bigtable_admin_v2.types import table as table_v2_pb2 + from google.cloud.bigtable.admin_v2.types import table as table_v2_pb2 return table_v2_pb2.GcRule.Intersection(*args, **kw) def _GcRuleUnionPB(*args, **kw): - from google.cloud.bigtable_admin_v2.types import table as table_v2_pb2 + from google.cloud.bigtable.admin_v2.types import table as table_v2_pb2 return table_v2_pb2.GcRule.Union(*args, **kw) def _ColumnFamilyPB(*args, **kw): - from google.cloud.bigtable_admin_v2.types import table as table_v2_pb2 + from google.cloud.bigtable.admin_v2.types import table as table_v2_pb2 return table_v2_pb2.ColumnFamily(*args, **kw) diff --git a/tests/unit/v2_client/test_instance.py b/tests/unit/v2_client/test_instance.py index de6844a16..1210d7e28 100644 --- a/tests/unit/v2_client/test_instance.py +++ b/tests/unit/v2_client/test_instance.py @@ -54,7 +54,7 @@ def _make_client(*args, **kwargs): def _make_instance_admin_api(): - from google.cloud.bigtable_admin_v2.services.bigtable_instance_admin import ( + from google.cloud.bigtable.admin_v2.services.bigtable_instance_admin import ( BigtableInstanceAdminClient, ) @@ -103,7 +103,7 @@ def test_instance_constructor_non_default(): def test_instance__update_from_pb_success(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable import enums instance_type = data_v2_pb2.Instance.Type.PRODUCTION @@ -128,7 +128,7 @@ def test_instance__update_from_pb_success(): def test_instance__update_from_pb_success_defaults(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable import enums instance_pb = data_v2_pb2.Instance(display_name=DISPLAY_NAME) @@ -144,7 +144,7 @@ def test_instance__update_from_pb_success_defaults(): def test_instance__update_from_pb_wo_display_name(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 instance_pb = data_v2_pb2.Instance() instance = _make_instance(None, None) @@ -155,7 +155,7 @@ def test_instance__update_from_pb_wo_display_name(): def test_instance_from_pb_success(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable import enums from google.cloud.bigtable.instance import Instance @@ -183,7 +183,7 @@ def test_instance_from_pb_success(): def test_instance_from_pb_bad_instance_name(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable.instance import Instance instance_name = "INCORRECT_FORMAT" @@ -194,7 +194,7 @@ def test_instance_from_pb_bad_instance_name(): def test_instance_from_pb_project_mistmatch(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable.instance import Instance ALT_PROJECT = "ALT_PROJECT" @@ -272,10 +272,10 @@ def _instance_api_response_for_create(): from google.longrunning import operations_pb2 from google.protobuf.any_pb2 import Any from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import ( bigtable_instance_admin as messages_v2_pb2, ) - from google.cloud.bigtable_admin_v2.types import instance + from google.cloud.bigtable.admin_v2.types import instance NOW = datetime.datetime.utcnow() NOW_PB = _datetime_to_pb_timestamp(NOW) @@ -305,8 +305,8 @@ def _instance_api_response_for_create(): def test_instance_create(): from google.cloud.bigtable import enums - from google.cloud.bigtable_admin_v2.types import Instance - from google.cloud.bigtable_admin_v2.types import Cluster + from google.cloud.bigtable.admin_v2.types import Instance + from google.cloud.bigtable.admin_v2.types import Cluster import warnings credentials = _make_credentials() @@ -355,8 +355,8 @@ def test_instance_create(): def test_instance_create_w_clusters(): from google.cloud.bigtable import enums from google.cloud.bigtable.cluster import Cluster - from google.cloud.bigtable_admin_v2.types import Cluster as cluster_pb - from google.cloud.bigtable_admin_v2.types import Instance as instance_pb + from google.cloud.bigtable.admin_v2.types import Cluster as cluster_pb + from google.cloud.bigtable.admin_v2.types import Instance as instance_pb credentials = _make_credentials() client = _make_client(project=PROJECT, credentials=credentials, admin=True) @@ -421,7 +421,7 @@ def test_instance_create_w_clusters(): def test_instance_exists_hit(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 credentials = _make_credentials() client = _make_client(project=PROJECT, credentials=credentials, admin=True) @@ -472,7 +472,7 @@ def test_instance_exists_w_error(): def test_instance_reload(): - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable import enums DISPLAY_NAME = "hey-hi-hello" @@ -498,10 +498,10 @@ def _instance_api_response_for_update(): from google.longrunning import operations_pb2 from google.protobuf.any_pb2 import Any from google.cloud._helpers import _datetime_to_pb_timestamp - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import ( bigtable_instance_admin as messages_v2_pb2, ) - from google.cloud.bigtable_admin_v2.types import instance + from google.cloud.bigtable.admin_v2.types import instance NOW = datetime.datetime.utcnow() NOW_PB = _datetime_to_pb_timestamp(NOW) @@ -529,7 +529,7 @@ def _instance_api_response_for_update(): def test_instance_update(): from google.cloud.bigtable import enums from google.protobuf import field_mask_pb2 - from google.cloud.bigtable_admin_v2.types import Instance + from google.cloud.bigtable.admin_v2.types import Instance credentials = _make_credentials() client = _make_client(project=PROJECT, credentials=credentials, admin=True) @@ -562,7 +562,7 @@ def test_instance_update(): def test_instance_update_empty(): from google.protobuf import field_mask_pb2 - from google.cloud.bigtable_admin_v2.types import Instance + from google.cloud.bigtable.admin_v2.types import Instance credentials = _make_credentials() client = _make_client(project=PROJECT, credentials=credentials, admin=True) @@ -745,10 +745,10 @@ def test_instance_cluster_factory(): def test_instance_list_clusters(): - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import ( bigtable_instance_admin as messages_v2_pb2, ) - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable.instance import Instance from google.cloud.bigtable.instance import Cluster @@ -801,12 +801,12 @@ def test_instance_table_factory(): def _list_tables_helper(table_name=None): - from google.cloud.bigtable_admin_v2.types import table as table_data_v2_pb2 - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import table as table_data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import ( bigtable_table_admin as table_messages_v1_pb2, ) - from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( - BigtableTableAdminClient, + from google.cloud.bigtable.admin_v2.services.bigtable_table_admin import ( + BaseBigtableTableAdminClient, ) credentials = _make_credentials() @@ -816,7 +816,7 @@ def _list_tables_helper(table_name=None): instance_api = client._instance_admin_client = _make_instance_admin_api() instance_api.instance_path.return_value = "projects/project/instances/instance-id" table_api = client._table_admin_client = mock.create_autospec( - BigtableTableAdminClient + BaseBigtableTableAdminClient ) if table_name is None: table_name = TABLE_NAME @@ -889,7 +889,7 @@ def test_instance_app_profile_factory(): def test_instance_list_app_profiles(): from google.api_core.page_iterator import Iterator from google.api_core.page_iterator import Page - from google.cloud.bigtable_admin_v2.types import instance as data_v2_pb2 + from google.cloud.bigtable.admin_v2.types import instance as data_v2_pb2 from google.cloud.bigtable.app_profile import AppProfile class _Iterator(Iterator): diff --git a/tests/unit/v2_client/test_table.py b/tests/unit/v2_client/test_table.py index 032363bd7..9c7120d28 100644 --- a/tests/unit/v2_client/test_table.py +++ b/tests/unit/v2_client/test_table.py @@ -345,16 +345,16 @@ def test_table___ne__(): def _make_table_api(): - from google.cloud.bigtable_admin_v2.services.bigtable_table_admin import ( + from google.cloud.bigtable.admin_v2.services.bigtable_table_admin import ( client as bigtable_table_admin, ) - return mock.create_autospec(bigtable_table_admin.BigtableTableAdminClient) + return mock.create_autospec(bigtable_table_admin.BaseBigtableTableAdminClient) def _create_table_helper(split_keys=[], column_families={}): - from google.cloud.bigtable_admin_v2.types import table as table_pb2 - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import table as table_pb2 + from google.cloud.bigtable.admin_v2.types import ( bigtable_table_admin as table_admin_messages_v2_pb2, ) from google.cloud.bigtable.column_family import ColumnFamily @@ -402,8 +402,8 @@ def test_table_create_with_split_keys(): def test_table_exists_hit(): - from google.cloud.bigtable_admin_v2.types import ListTablesResponse - from google.cloud.bigtable_admin_v2.types import Table + from google.cloud.bigtable.admin_v2.types import ListTablesResponse + from google.cloud.bigtable.admin_v2.types import Table from google.cloud.bigtable import enums credentials = _make_credentials() @@ -1406,7 +1406,7 @@ def test_table_backup_factory_non_defaults(): def _table_list_backups_helper(cluster_id=None, filter_=None, **kwargs): - from google.cloud.bigtable_admin_v2.types import ( + from google.cloud.bigtable.admin_v2.types import ( Backup as backup_pb, bigtable_table_admin, ) @@ -1482,7 +1482,7 @@ def _table_restore_helper(backup_name=None): table = _make_table(TABLE_ID, instance) table_api = client._table_admin_client = _make_table_api() - table_api.restore_table.return_value = op_future + table_api._restore_table.return_value = op_future if backup_name: future = table.restore(TABLE_ID, backup_name=BACKUP_NAME) @@ -1496,7 +1496,7 @@ def _table_restore_helper(backup_name=None): "table_id": TABLE_ID, "backup": BACKUP_NAME, } - table_api.restore_table.assert_called_once_with(request=expected_request) + table_api._restore_table.assert_called_once_with(request=expected_request) def test_table_restore_table_w_backup_id(): @@ -2273,19 +2273,19 @@ def _ReadRowsResponseV2(chunks, last_scanned_row_key=b""): def _TablePB(*args, **kw): - from google.cloud.bigtable_admin_v2.types import table as table_v2_pb2 + from google.cloud.bigtable.admin_v2.types import table as table_v2_pb2 return table_v2_pb2.Table(*args, **kw) def _ColumnFamilyPB(*args, **kw): - from google.cloud.bigtable_admin_v2.types import table as table_v2_pb2 + from google.cloud.bigtable.admin_v2.types import table as table_v2_pb2 return table_v2_pb2.ColumnFamily(*args, **kw) def _ClusterStatePB(replication_state): - from google.cloud.bigtable_admin_v2.types import table as table_v2_pb2 + from google.cloud.bigtable.admin_v2.types import table as table_v2_pb2 return table_v2_pb2.Table.ClusterState(replication_state=replication_state) @@ -2293,7 +2293,7 @@ def _ClusterStatePB(replication_state): def _ClusterStateEncryptionInfoPB( encryption_type, encryption_status=None, kms_key_version=None ): - from google.cloud.bigtable_admin_v2.types import table as table_v2_pb2 + from google.cloud.bigtable.admin_v2.types import table as table_v2_pb2 return table_v2_pb2.Table.ClusterState( encryption_info=(