google-cloud-sql 0.1.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- google/cloud/sqladmin/__init__.py +605 -0
- google/cloud/sqladmin/gapic_version.py +16 -0
- google/cloud/sqladmin/py.typed +2 -0
- google/cloud/sqladmin_v1/__init__.py +616 -0
- google/cloud/sqladmin_v1/_compat.py +262 -0
- google/cloud/sqladmin_v1/gapic_metadata.json +959 -0
- google/cloud/sqladmin_v1/gapic_version.py +16 -0
- google/cloud/sqladmin_v1/py.typed +2 -0
- google/cloud/sqladmin_v1/services/__init__.py +15 -0
- google/cloud/sqladmin_v1/services/sql_available_database_versions_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_available_database_versions_service/async_client.py +336 -0
- google/cloud/sqladmin_v1/services/sql_available_database_versions_service/client.py +613 -0
- google/cloud/sqladmin_v1/services/sql_available_database_versions_service/transports/__init__.py +34 -0
- google/cloud/sqladmin_v1/services/sql_available_database_versions_service/transports/base.py +159 -0
- google/cloud/sqladmin_v1/services/sql_available_database_versions_service/transports/grpc.py +339 -0
- google/cloud/sqladmin_v1/services/sql_available_database_versions_service/transports/grpc_asyncio.py +356 -0
- google/cloud/sqladmin_v1/services/sql_backup_runs_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_backup_runs_service/async_client.py +697 -0
- google/cloud/sqladmin_v1/services/sql_backup_runs_service/client.py +977 -0
- google/cloud/sqladmin_v1/services/sql_backup_runs_service/pagers.py +199 -0
- google/cloud/sqladmin_v1/services/sql_backup_runs_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_backup_runs_service/transports/base.py +225 -0
- google/cloud/sqladmin_v1/services/sql_backup_runs_service/transports/grpc.py +456 -0
- google/cloud/sqladmin_v1/services/sql_backup_runs_service/transports/grpc_asyncio.py +495 -0
- google/cloud/sqladmin_v1/services/sql_backups_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_backups_service/async_client.py +946 -0
- google/cloud/sqladmin_v1/services/sql_backups_service/client.py +1244 -0
- google/cloud/sqladmin_v1/services/sql_backups_service/pagers.py +197 -0
- google/cloud/sqladmin_v1/services/sql_backups_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_backups_service/transports/base.py +237 -0
- google/cloud/sqladmin_v1/services/sql_backups_service/transports/grpc.py +478 -0
- google/cloud/sqladmin_v1/services/sql_backups_service/transports/grpc_asyncio.py +527 -0
- google/cloud/sqladmin_v1/services/sql_connect_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_connect_service/async_client.py +591 -0
- google/cloud/sqladmin_v1/services/sql_connect_service/client.py +867 -0
- google/cloud/sqladmin_v1/services/sql_connect_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_connect_service/transports/base.py +215 -0
- google/cloud/sqladmin_v1/services/sql_connect_service/transports/grpc.py +430 -0
- google/cloud/sqladmin_v1/services/sql_connect_service/transports/grpc_asyncio.py +464 -0
- google/cloud/sqladmin_v1/services/sql_databases_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_databases_service/async_client.py +872 -0
- google/cloud/sqladmin_v1/services/sql_databases_service/client.py +1152 -0
- google/cloud/sqladmin_v1/services/sql_databases_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_databases_service/transports/base.py +251 -0
- google/cloud/sqladmin_v1/services/sql_databases_service/transports/grpc.py +515 -0
- google/cloud/sqladmin_v1/services/sql_databases_service/transports/grpc_asyncio.py +568 -0
- google/cloud/sqladmin_v1/services/sql_events_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_events_service/async_client.py +311 -0
- google/cloud/sqladmin_v1/services/sql_events_service/client.py +593 -0
- google/cloud/sqladmin_v1/services/sql_events_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_events_service/transports/base.py +159 -0
- google/cloud/sqladmin_v1/services/sql_events_service/transports/grpc.py +337 -0
- google/cloud/sqladmin_v1/services/sql_events_service/transports/grpc_asyncio.py +354 -0
- google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/async_client.py +327 -0
- google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/client.py +605 -0
- google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/transports/base.py +159 -0
- google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/transports/grpc.py +337 -0
- google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/transports/grpc_asyncio.py +356 -0
- google/cloud/sqladmin_v1/services/sql_flags_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_flags_service/async_client.py +386 -0
- google/cloud/sqladmin_v1/services/sql_flags_service/client.py +667 -0
- google/cloud/sqladmin_v1/services/sql_flags_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_flags_service/transports/base.py +181 -0
- google/cloud/sqladmin_v1/services/sql_flags_service/transports/grpc.py +367 -0
- google/cloud/sqladmin_v1/services/sql_flags_service/transports/grpc_asyncio.py +391 -0
- google/cloud/sqladmin_v1/services/sql_iam_policies_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_iam_policies_service/async_client.py +315 -0
- google/cloud/sqladmin_v1/services/sql_iam_policies_service/client.py +593 -0
- google/cloud/sqladmin_v1/services/sql_iam_policies_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_iam_policies_service/transports/base.py +159 -0
- google/cloud/sqladmin_v1/services/sql_iam_policies_service/transports/grpc.py +336 -0
- google/cloud/sqladmin_v1/services/sql_iam_policies_service/transports/grpc_asyncio.py +353 -0
- google/cloud/sqladmin_v1/services/sql_instance_names_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_instance_names_service/async_client.py +321 -0
- google/cloud/sqladmin_v1/services/sql_instance_names_service/client.py +595 -0
- google/cloud/sqladmin_v1/services/sql_instance_names_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_instance_names_service/transports/base.py +159 -0
- google/cloud/sqladmin_v1/services/sql_instance_names_service/transports/grpc.py +336 -0
- google/cloud/sqladmin_v1/services/sql_instance_names_service/transports/grpc_asyncio.py +353 -0
- google/cloud/sqladmin_v1/services/sql_instances_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_instances_service/async_client.py +4519 -0
- google/cloud/sqladmin_v1/services/sql_instances_service/client.py +4833 -0
- google/cloud/sqladmin_v1/services/sql_instances_service/pagers.py +197 -0
- google/cloud/sqladmin_v1/services/sql_instances_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_instances_service/transports/base.py +801 -0
- google/cloud/sqladmin_v1/services/sql_instances_service/transports/grpc.py +1661 -0
- google/cloud/sqladmin_v1/services/sql_instances_service/transports/grpc_asyncio.py +1904 -0
- google/cloud/sqladmin_v1/services/sql_operations_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_operations_service/async_client.py +591 -0
- google/cloud/sqladmin_v1/services/sql_operations_service/client.py +871 -0
- google/cloud/sqladmin_v1/services/sql_operations_service/pagers.py +197 -0
- google/cloud/sqladmin_v1/services/sql_operations_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_operations_service/transports/base.py +210 -0
- google/cloud/sqladmin_v1/services/sql_operations_service/transports/grpc.py +426 -0
- google/cloud/sqladmin_v1/services/sql_operations_service/transports/grpc_asyncio.py +462 -0
- google/cloud/sqladmin_v1/services/sql_regions_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_regions_service/async_client.py +314 -0
- google/cloud/sqladmin_v1/services/sql_regions_service/client.py +596 -0
- google/cloud/sqladmin_v1/services/sql_regions_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_regions_service/transports/base.py +159 -0
- google/cloud/sqladmin_v1/services/sql_regions_service/transports/grpc.py +338 -0
- google/cloud/sqladmin_v1/services/sql_regions_service/transports/grpc_asyncio.py +355 -0
- google/cloud/sqladmin_v1/services/sql_ssl_certs_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_ssl_certs_service/async_client.py +680 -0
- google/cloud/sqladmin_v1/services/sql_ssl_certs_service/client.py +960 -0
- google/cloud/sqladmin_v1/services/sql_ssl_certs_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_ssl_certs_service/transports/base.py +226 -0
- google/cloud/sqladmin_v1/services/sql_ssl_certs_service/transports/grpc.py +461 -0
- google/cloud/sqladmin_v1/services/sql_ssl_certs_service/transports/grpc_asyncio.py +501 -0
- google/cloud/sqladmin_v1/services/sql_tiers_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_tiers_service/async_client.py +395 -0
- google/cloud/sqladmin_v1/services/sql_tiers_service/client.py +676 -0
- google/cloud/sqladmin_v1/services/sql_tiers_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_tiers_service/transports/base.py +181 -0
- google/cloud/sqladmin_v1/services/sql_tiers_service/transports/grpc.py +369 -0
- google/cloud/sqladmin_v1/services/sql_tiers_service/transports/grpc_asyncio.py +393 -0
- google/cloud/sqladmin_v1/services/sql_users_service/__init__.py +22 -0
- google/cloud/sqladmin_v1/services/sql_users_service/async_client.py +754 -0
- google/cloud/sqladmin_v1/services/sql_users_service/client.py +1035 -0
- google/cloud/sqladmin_v1/services/sql_users_service/transports/__init__.py +32 -0
- google/cloud/sqladmin_v1/services/sql_users_service/transports/base.py +237 -0
- google/cloud/sqladmin_v1/services/sql_users_service/transports/grpc.py +477 -0
- google/cloud/sqladmin_v1/services/sql_users_service/transports/grpc_asyncio.py +526 -0
- google/cloud/sqladmin_v1/types/__init__.py +472 -0
- google/cloud/sqladmin_v1/types/cloud_sql_available_database_versions.py +24 -0
- google/cloud/sqladmin_v1/types/cloud_sql_backup_runs.py +438 -0
- google/cloud/sqladmin_v1/types/cloud_sql_backups.py +467 -0
- google/cloud/sqladmin_v1/types/cloud_sql_connect.py +385 -0
- google/cloud/sqladmin_v1/types/cloud_sql_databases.py +202 -0
- google/cloud/sqladmin_v1/types/cloud_sql_events.py +24 -0
- google/cloud/sqladmin_v1/types/cloud_sql_feature_eligibility.py +24 -0
- google/cloud/sqladmin_v1/types/cloud_sql_flags.py +272 -0
- google/cloud/sqladmin_v1/types/cloud_sql_iam_policies.py +24 -0
- google/cloud/sqladmin_v1/types/cloud_sql_instance_names.py +24 -0
- google/cloud/sqladmin_v1/types/cloud_sql_instances.py +4514 -0
- google/cloud/sqladmin_v1/types/cloud_sql_operations.py +164 -0
- google/cloud/sqladmin_v1/types/cloud_sql_regions.py +24 -0
- google/cloud/sqladmin_v1/types/cloud_sql_resources.py +4678 -0
- google/cloud/sqladmin_v1/types/cloud_sql_ssl_certs.py +220 -0
- google/cloud/sqladmin_v1/types/cloud_sql_tiers.py +108 -0
- google/cloud/sqladmin_v1/types/cloud_sql_users.py +571 -0
- google/cloud/sqladmin_v1beta4/__init__.py +583 -0
- google/cloud/sqladmin_v1beta4/_compat.py +262 -0
- google/cloud/sqladmin_v1beta4/gapic_metadata.json +1371 -0
- google/cloud/sqladmin_v1beta4/gapic_version.py +16 -0
- google/cloud/sqladmin_v1beta4/py.typed +2 -0
- google/cloud/sqladmin_v1beta4/services/__init__.py +15 -0
- google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/async_client.py +689 -0
- google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/client.py +971 -0
- google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/pagers.py +197 -0
- google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/transports/base.py +223 -0
- google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/transports/grpc.py +449 -0
- google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/transports/grpc_asyncio.py +490 -0
- google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/transports/rest.py +1038 -0
- google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/transports/rest_base.py +150 -0
- google/cloud/sqladmin_v1beta4/services/sql_backups_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_backups_service/async_client.py +941 -0
- google/cloud/sqladmin_v1beta4/services/sql_backups_service/client.py +1241 -0
- google/cloud/sqladmin_v1beta4/services/sql_backups_service/pagers.py +197 -0
- google/cloud/sqladmin_v1beta4/services/sql_backups_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_backups_service/transports/base.py +234 -0
- google/cloud/sqladmin_v1beta4/services/sql_backups_service/transports/grpc.py +470 -0
- google/cloud/sqladmin_v1beta4/services/sql_backups_service/transports/grpc_asyncio.py +521 -0
- google/cloud/sqladmin_v1beta4/services/sql_backups_service/transports/rest.py +1238 -0
- google/cloud/sqladmin_v1beta4/services/sql_backups_service/transports/rest_base.py +175 -0
- google/cloud/sqladmin_v1beta4/services/sql_connect_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_connect_service/async_client.py +591 -0
- google/cloud/sqladmin_v1beta4/services/sql_connect_service/client.py +869 -0
- google/cloud/sqladmin_v1beta4/services/sql_connect_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_connect_service/transports/base.py +215 -0
- google/cloud/sqladmin_v1beta4/services/sql_connect_service/transports/grpc.py +430 -0
- google/cloud/sqladmin_v1beta4/services/sql_connect_service/transports/grpc_asyncio.py +464 -0
- google/cloud/sqladmin_v1beta4/services/sql_connect_service/transports/rest.py +852 -0
- google/cloud/sqladmin_v1beta4/services/sql_connect_service/transports/rest_base.py +138 -0
- google/cloud/sqladmin_v1beta4/services/sql_data_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_data_service/async_client.py +444 -0
- google/cloud/sqladmin_v1beta4/services/sql_data_service/client.py +739 -0
- google/cloud/sqladmin_v1beta4/services/sql_data_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_data_service/transports/base.py +181 -0
- google/cloud/sqladmin_v1beta4/services/sql_data_service/transports/grpc.py +407 -0
- google/cloud/sqladmin_v1beta4/services/sql_data_service/transports/grpc_asyncio.py +431 -0
- google/cloud/sqladmin_v1beta4/services/sql_data_service/transports/rest.py +213 -0
- google/cloud/sqladmin_v1beta4/services/sql_data_service/transports/rest_base.py +97 -0
- google/cloud/sqladmin_v1beta4/services/sql_databases_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_databases_service/async_client.py +860 -0
- google/cloud/sqladmin_v1beta4/services/sql_databases_service/client.py +1142 -0
- google/cloud/sqladmin_v1beta4/services/sql_databases_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_databases_service/transports/base.py +251 -0
- google/cloud/sqladmin_v1beta4/services/sql_databases_service/transports/grpc.py +502 -0
- google/cloud/sqladmin_v1beta4/services/sql_databases_service/transports/grpc_asyncio.py +561 -0
- google/cloud/sqladmin_v1beta4/services/sql_databases_service/transports/rest.py +1468 -0
- google/cloud/sqladmin_v1beta4/services/sql_databases_service/transports/rest_base.py +180 -0
- google/cloud/sqladmin_v1beta4/services/sql_flags_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_flags_service/async_client.py +386 -0
- google/cloud/sqladmin_v1beta4/services/sql_flags_service/client.py +669 -0
- google/cloud/sqladmin_v1beta4/services/sql_flags_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_flags_service/transports/base.py +181 -0
- google/cloud/sqladmin_v1beta4/services/sql_flags_service/transports/grpc.py +365 -0
- google/cloud/sqladmin_v1beta4/services/sql_flags_service/transports/grpc_asyncio.py +389 -0
- google/cloud/sqladmin_v1beta4/services/sql_flags_service/transports/rest.py +392 -0
- google/cloud/sqladmin_v1beta4/services/sql_flags_service/transports/rest_base.py +107 -0
- google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/async_client.py +315 -0
- google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/client.py +595 -0
- google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/transports/__init__.py +39 -0
- google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/transports/base.py +159 -0
- google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/transports/grpc.py +336 -0
- google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/transports/grpc_asyncio.py +353 -0
- google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/transports/rest.py +184 -0
- google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/transports/rest_base.py +91 -0
- google/cloud/sqladmin_v1beta4/services/sql_instances_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_instances_service/async_client.py +4399 -0
- google/cloud/sqladmin_v1beta4/services/sql_instances_service/client.py +4715 -0
- google/cloud/sqladmin_v1beta4/services/sql_instances_service/pagers.py +197 -0
- google/cloud/sqladmin_v1beta4/services/sql_instances_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_instances_service/transports/base.py +801 -0
- google/cloud/sqladmin_v1beta4/services/sql_instances_service/transports/grpc.py +1627 -0
- google/cloud/sqladmin_v1beta4/services/sql_instances_service/transports/grpc_asyncio.py +1895 -0
- google/cloud/sqladmin_v1beta4/services/sql_instances_service/transports/rest.py +9625 -0
- google/cloud/sqladmin_v1beta4/services/sql_instances_service/transports/rest_base.py +744 -0
- google/cloud/sqladmin_v1beta4/services/sql_operations_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_operations_service/async_client.py +585 -0
- google/cloud/sqladmin_v1beta4/services/sql_operations_service/client.py +867 -0
- google/cloud/sqladmin_v1beta4/services/sql_operations_service/pagers.py +197 -0
- google/cloud/sqladmin_v1beta4/services/sql_operations_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_operations_service/transports/base.py +210 -0
- google/cloud/sqladmin_v1beta4/services/sql_operations_service/transports/grpc.py +422 -0
- google/cloud/sqladmin_v1beta4/services/sql_operations_service/transports/grpc_asyncio.py +458 -0
- google/cloud/sqladmin_v1beta4/services/sql_operations_service/transports/rest.py +744 -0
- google/cloud/sqladmin_v1beta4/services/sql_operations_service/transports/rest_base.py +136 -0
- google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/async_client.py +672 -0
- google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/client.py +954 -0
- google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/transports/base.py +226 -0
- google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/transports/grpc.py +453 -0
- google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/transports/grpc_asyncio.py +497 -0
- google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/transports/rest.py +1036 -0
- google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/transports/rest_base.py +150 -0
- google/cloud/sqladmin_v1beta4/services/sql_tiers_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_tiers_service/async_client.py +393 -0
- google/cloud/sqladmin_v1beta4/services/sql_tiers_service/client.py +676 -0
- google/cloud/sqladmin_v1beta4/services/sql_tiers_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_tiers_service/transports/base.py +181 -0
- google/cloud/sqladmin_v1beta4/services/sql_tiers_service/transports/grpc.py +368 -0
- google/cloud/sqladmin_v1beta4/services/sql_tiers_service/transports/grpc_asyncio.py +392 -0
- google/cloud/sqladmin_v1beta4/services/sql_tiers_service/transports/rest.py +396 -0
- google/cloud/sqladmin_v1beta4/services/sql_tiers_service/transports/rest_base.py +107 -0
- google/cloud/sqladmin_v1beta4/services/sql_users_service/__init__.py +22 -0
- google/cloud/sqladmin_v1beta4/services/sql_users_service/async_client.py +754 -0
- google/cloud/sqladmin_v1beta4/services/sql_users_service/client.py +1037 -0
- google/cloud/sqladmin_v1beta4/services/sql_users_service/transports/__init__.py +36 -0
- google/cloud/sqladmin_v1beta4/services/sql_users_service/transports/base.py +237 -0
- google/cloud/sqladmin_v1beta4/services/sql_users_service/transports/grpc.py +475 -0
- google/cloud/sqladmin_v1beta4/services/sql_users_service/transports/grpc_asyncio.py +524 -0
- google/cloud/sqladmin_v1beta4/services/sql_users_service/transports/rest.py +1249 -0
- google/cloud/sqladmin_v1beta4/services/sql_users_service/transports/rest_base.py +165 -0
- google/cloud/sqladmin_v1beta4/types/__init__.py +480 -0
- google/cloud/sqladmin_v1beta4/types/cloud_sql.py +2666 -0
- google/cloud/sqladmin_v1beta4/types/cloud_sql_connect.py +386 -0
- google/cloud/sqladmin_v1beta4/types/cloud_sql_data.py +339 -0
- google/cloud/sqladmin_v1beta4/types/cloud_sql_iam_policies.py +24 -0
- google/cloud/sqladmin_v1beta4/types/cloud_sql_resources.py +8111 -0
- google/cloud/sqladmin_v1beta4/types/cloud_sql_tiers.py +108 -0
- google/cloud/sqladmin_v1beta4/types/cloud_sql_users.py +573 -0
- google_cloud_sql-0.1.1.dist-info/METADATA +239 -0
- google_cloud_sql-0.1.1.dist-info/RECORD +274 -0
- google_cloud_sql-0.1.1.dist-info/WHEEL +5 -0
- google_cloud_sql-0.1.1.dist-info/licenses/LICENSE +202 -0
- google_cloud_sql-0.1.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,946 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Copyright 2026 Google LLC
|
|
3
|
+
#
|
|
4
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
# you may not use this file except in compliance with the License.
|
|
6
|
+
# You may obtain a copy of the License at
|
|
7
|
+
#
|
|
8
|
+
# http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
#
|
|
10
|
+
# Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
# See the License for the specific language governing permissions and
|
|
14
|
+
# limitations under the License.
|
|
15
|
+
#
|
|
16
|
+
import logging as std_logging
|
|
17
|
+
import re
|
|
18
|
+
from collections import OrderedDict
|
|
19
|
+
from typing import (
|
|
20
|
+
Callable,
|
|
21
|
+
Dict,
|
|
22
|
+
Mapping,
|
|
23
|
+
MutableMapping,
|
|
24
|
+
MutableSequence,
|
|
25
|
+
Optional,
|
|
26
|
+
Sequence,
|
|
27
|
+
Tuple,
|
|
28
|
+
Type,
|
|
29
|
+
Union,
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
import google.protobuf
|
|
33
|
+
from google.api_core import exceptions as core_exceptions
|
|
34
|
+
from google.api_core import gapic_v1
|
|
35
|
+
from google.api_core import retry_async as retries
|
|
36
|
+
from google.api_core.client_options import ClientOptions
|
|
37
|
+
from google.auth import credentials as ga_credentials # type: ignore
|
|
38
|
+
from google.oauth2 import service_account # type: ignore
|
|
39
|
+
|
|
40
|
+
from google.cloud.sqladmin_v1 import gapic_version as package_version
|
|
41
|
+
|
|
42
|
+
try:
|
|
43
|
+
OptionalRetry = Union[retries.AsyncRetry, gapic_v1.method._MethodDefault, None]
|
|
44
|
+
except AttributeError: # pragma: NO COVER
|
|
45
|
+
OptionalRetry = Union[retries.AsyncRetry, object, None] # type: ignore
|
|
46
|
+
|
|
47
|
+
import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
|
|
48
|
+
import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore
|
|
49
|
+
import google.protobuf.wrappers_pb2 as wrappers_pb2 # type: ignore
|
|
50
|
+
import google.type.interval_pb2 as interval_pb2 # type: ignore
|
|
51
|
+
from google.cloud.location import locations_pb2 # type: ignore
|
|
52
|
+
from google.longrunning import operations_pb2 # type: ignore
|
|
53
|
+
|
|
54
|
+
from google.cloud.sqladmin_v1.services.sql_backups_service import pagers
|
|
55
|
+
from google.cloud.sqladmin_v1.types import (
|
|
56
|
+
cloud_sql_backup_runs,
|
|
57
|
+
cloud_sql_backups,
|
|
58
|
+
cloud_sql_instances,
|
|
59
|
+
cloud_sql_resources,
|
|
60
|
+
)
|
|
61
|
+
|
|
62
|
+
from .client import SqlBackupsServiceClient
|
|
63
|
+
from .transports.base import DEFAULT_CLIENT_INFO, SqlBackupsServiceTransport
|
|
64
|
+
from .transports.grpc_asyncio import SqlBackupsServiceGrpcAsyncIOTransport
|
|
65
|
+
|
|
66
|
+
try:
|
|
67
|
+
from google.api_core import client_logging # type: ignore
|
|
68
|
+
|
|
69
|
+
CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER
|
|
70
|
+
except ImportError: # pragma: NO COVER
|
|
71
|
+
CLIENT_LOGGING_SUPPORTED = False
|
|
72
|
+
|
|
73
|
+
_LOGGER = std_logging.getLogger(__name__)
|
|
74
|
+
|
|
75
|
+
|
|
76
|
+
class SqlBackupsServiceAsyncClient:
|
|
77
|
+
""""""
|
|
78
|
+
|
|
79
|
+
_client: SqlBackupsServiceClient
|
|
80
|
+
|
|
81
|
+
# Copy defaults from the synchronous client for use here.
|
|
82
|
+
# Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead.
|
|
83
|
+
DEFAULT_ENDPOINT = SqlBackupsServiceClient.DEFAULT_ENDPOINT
|
|
84
|
+
DEFAULT_MTLS_ENDPOINT = SqlBackupsServiceClient.DEFAULT_MTLS_ENDPOINT
|
|
85
|
+
_DEFAULT_ENDPOINT_TEMPLATE = SqlBackupsServiceClient._DEFAULT_ENDPOINT_TEMPLATE
|
|
86
|
+
_DEFAULT_UNIVERSE = SqlBackupsServiceClient._DEFAULT_UNIVERSE
|
|
87
|
+
|
|
88
|
+
backup_path = staticmethod(SqlBackupsServiceClient.backup_path)
|
|
89
|
+
parse_backup_path = staticmethod(SqlBackupsServiceClient.parse_backup_path)
|
|
90
|
+
service_connection_policy_path = staticmethod(
|
|
91
|
+
SqlBackupsServiceClient.service_connection_policy_path
|
|
92
|
+
)
|
|
93
|
+
parse_service_connection_policy_path = staticmethod(
|
|
94
|
+
SqlBackupsServiceClient.parse_service_connection_policy_path
|
|
95
|
+
)
|
|
96
|
+
common_billing_account_path = staticmethod(
|
|
97
|
+
SqlBackupsServiceClient.common_billing_account_path
|
|
98
|
+
)
|
|
99
|
+
parse_common_billing_account_path = staticmethod(
|
|
100
|
+
SqlBackupsServiceClient.parse_common_billing_account_path
|
|
101
|
+
)
|
|
102
|
+
common_folder_path = staticmethod(SqlBackupsServiceClient.common_folder_path)
|
|
103
|
+
parse_common_folder_path = staticmethod(
|
|
104
|
+
SqlBackupsServiceClient.parse_common_folder_path
|
|
105
|
+
)
|
|
106
|
+
common_organization_path = staticmethod(
|
|
107
|
+
SqlBackupsServiceClient.common_organization_path
|
|
108
|
+
)
|
|
109
|
+
parse_common_organization_path = staticmethod(
|
|
110
|
+
SqlBackupsServiceClient.parse_common_organization_path
|
|
111
|
+
)
|
|
112
|
+
common_project_path = staticmethod(SqlBackupsServiceClient.common_project_path)
|
|
113
|
+
parse_common_project_path = staticmethod(
|
|
114
|
+
SqlBackupsServiceClient.parse_common_project_path
|
|
115
|
+
)
|
|
116
|
+
common_location_path = staticmethod(SqlBackupsServiceClient.common_location_path)
|
|
117
|
+
parse_common_location_path = staticmethod(
|
|
118
|
+
SqlBackupsServiceClient.parse_common_location_path
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
@classmethod
|
|
122
|
+
def from_service_account_info(cls, info: dict, *args, **kwargs):
|
|
123
|
+
"""Creates an instance of this client using the provided credentials
|
|
124
|
+
info.
|
|
125
|
+
|
|
126
|
+
Args:
|
|
127
|
+
info (dict): The service account private key info.
|
|
128
|
+
args: Additional arguments to pass to the constructor.
|
|
129
|
+
kwargs: Additional arguments to pass to the constructor.
|
|
130
|
+
|
|
131
|
+
Returns:
|
|
132
|
+
SqlBackupsServiceAsyncClient: The constructed client.
|
|
133
|
+
"""
|
|
134
|
+
sa_info_func = (
|
|
135
|
+
SqlBackupsServiceClient.from_service_account_info.__func__ # type: ignore
|
|
136
|
+
)
|
|
137
|
+
return sa_info_func(SqlBackupsServiceAsyncClient, info, *args, **kwargs)
|
|
138
|
+
|
|
139
|
+
@classmethod
|
|
140
|
+
def from_service_account_file(cls, filename: str, *args, **kwargs):
|
|
141
|
+
"""Creates an instance of this client using the provided credentials
|
|
142
|
+
file.
|
|
143
|
+
|
|
144
|
+
Args:
|
|
145
|
+
filename (str): The path to the service account private key json
|
|
146
|
+
file.
|
|
147
|
+
args: Additional arguments to pass to the constructor.
|
|
148
|
+
kwargs: Additional arguments to pass to the constructor.
|
|
149
|
+
|
|
150
|
+
Returns:
|
|
151
|
+
SqlBackupsServiceAsyncClient: The constructed client.
|
|
152
|
+
"""
|
|
153
|
+
sa_file_func = (
|
|
154
|
+
SqlBackupsServiceClient.from_service_account_file.__func__ # type: ignore
|
|
155
|
+
)
|
|
156
|
+
return sa_file_func(SqlBackupsServiceAsyncClient, filename, *args, **kwargs)
|
|
157
|
+
|
|
158
|
+
from_service_account_json = from_service_account_file
|
|
159
|
+
|
|
160
|
+
@classmethod
|
|
161
|
+
def get_mtls_endpoint_and_cert_source(
|
|
162
|
+
cls, client_options: Optional[ClientOptions] = None
|
|
163
|
+
):
|
|
164
|
+
"""Return the API endpoint and client cert source for mutual TLS.
|
|
165
|
+
|
|
166
|
+
The client cert source is determined in the following order:
|
|
167
|
+
(1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the
|
|
168
|
+
client cert source is None.
|
|
169
|
+
(2) if `client_options.client_cert_source` is provided, use the provided one; if the
|
|
170
|
+
default client cert source exists, use the default one; otherwise the client cert
|
|
171
|
+
source is None.
|
|
172
|
+
|
|
173
|
+
The API endpoint is determined in the following order:
|
|
174
|
+
(1) if `client_options.api_endpoint` if provided, use the provided one.
|
|
175
|
+
(2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the
|
|
176
|
+
default mTLS endpoint; if the environment variable is "never", use the default API
|
|
177
|
+
endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise
|
|
178
|
+
use the default API endpoint.
|
|
179
|
+
|
|
180
|
+
More details can be found at https://google.aip.dev/auth/4114.
|
|
181
|
+
|
|
182
|
+
Args:
|
|
183
|
+
client_options (google.api_core.client_options.ClientOptions): Custom options for the
|
|
184
|
+
client. Only the `api_endpoint` and `client_cert_source` properties may be used
|
|
185
|
+
in this method.
|
|
186
|
+
|
|
187
|
+
Returns:
|
|
188
|
+
Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the
|
|
189
|
+
client cert source to use.
|
|
190
|
+
|
|
191
|
+
Raises:
|
|
192
|
+
google.auth.exceptions.MutualTLSChannelError: If any errors happen.
|
|
193
|
+
"""
|
|
194
|
+
return SqlBackupsServiceClient.get_mtls_endpoint_and_cert_source(client_options) # type: ignore
|
|
195
|
+
|
|
196
|
+
@property
|
|
197
|
+
def transport(self) -> SqlBackupsServiceTransport:
|
|
198
|
+
"""Returns the transport used by the client instance.
|
|
199
|
+
|
|
200
|
+
Returns:
|
|
201
|
+
SqlBackupsServiceTransport: The transport used by the client instance.
|
|
202
|
+
"""
|
|
203
|
+
return self._client.transport
|
|
204
|
+
|
|
205
|
+
@property
|
|
206
|
+
def api_endpoint(self) -> str:
|
|
207
|
+
"""Return the API endpoint used by the client instance.
|
|
208
|
+
|
|
209
|
+
Returns:
|
|
210
|
+
str: The API endpoint used by the client instance.
|
|
211
|
+
"""
|
|
212
|
+
return self._client._api_endpoint
|
|
213
|
+
|
|
214
|
+
@property
|
|
215
|
+
def universe_domain(self) -> str:
|
|
216
|
+
"""Return the universe domain used by the client instance.
|
|
217
|
+
|
|
218
|
+
Returns:
|
|
219
|
+
str: The universe domain used
|
|
220
|
+
by the client instance.
|
|
221
|
+
"""
|
|
222
|
+
return self._client._universe_domain
|
|
223
|
+
|
|
224
|
+
get_transport_class = SqlBackupsServiceClient.get_transport_class
|
|
225
|
+
|
|
226
|
+
def __init__(
|
|
227
|
+
self,
|
|
228
|
+
*,
|
|
229
|
+
credentials: Optional[ga_credentials.Credentials] = None,
|
|
230
|
+
transport: Optional[
|
|
231
|
+
Union[
|
|
232
|
+
str,
|
|
233
|
+
SqlBackupsServiceTransport,
|
|
234
|
+
Callable[..., SqlBackupsServiceTransport],
|
|
235
|
+
]
|
|
236
|
+
] = "grpc_asyncio",
|
|
237
|
+
client_options: Optional[ClientOptions] = None,
|
|
238
|
+
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
|
|
239
|
+
) -> None:
|
|
240
|
+
"""Instantiates the sql backups service async client.
|
|
241
|
+
|
|
242
|
+
Args:
|
|
243
|
+
credentials (Optional[google.auth.credentials.Credentials]): The
|
|
244
|
+
authorization credentials to attach to requests. These
|
|
245
|
+
credentials identify the application to the service; if none
|
|
246
|
+
are specified, the client will attempt to ascertain the
|
|
247
|
+
credentials from the environment.
|
|
248
|
+
transport (Optional[Union[str,SqlBackupsServiceTransport,Callable[..., SqlBackupsServiceTransport]]]):
|
|
249
|
+
The transport to use, or a Callable that constructs and returns a new transport to use.
|
|
250
|
+
If a Callable is given, it will be called with the same set of initialization
|
|
251
|
+
arguments as used in the SqlBackupsServiceTransport constructor.
|
|
252
|
+
If set to None, a transport is chosen automatically.
|
|
253
|
+
client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]):
|
|
254
|
+
Custom options for the client.
|
|
255
|
+
|
|
256
|
+
1. The ``api_endpoint`` property can be used to override the
|
|
257
|
+
default endpoint provided by the client when ``transport`` is
|
|
258
|
+
not explicitly provided. Only if this property is not set and
|
|
259
|
+
``transport`` was not explicitly provided, the endpoint is
|
|
260
|
+
determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment
|
|
261
|
+
variable, which have one of the following values:
|
|
262
|
+
"always" (always use the default mTLS endpoint), "never" (always
|
|
263
|
+
use the default regular endpoint) and "auto" (auto-switch to the
|
|
264
|
+
default mTLS endpoint if client certificate is present; this is
|
|
265
|
+
the default value).
|
|
266
|
+
|
|
267
|
+
2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
|
|
268
|
+
is "true", then the ``client_cert_source`` property can be used
|
|
269
|
+
to provide a client certificate for mTLS transport. If
|
|
270
|
+
not provided, the default SSL client certificate will be used if
|
|
271
|
+
present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not
|
|
272
|
+
set, no client certificate will be used.
|
|
273
|
+
|
|
274
|
+
3. The ``universe_domain`` property can be used to override the
|
|
275
|
+
default "googleapis.com" universe. Note that ``api_endpoint``
|
|
276
|
+
property still takes precedence; and ``universe_domain`` is
|
|
277
|
+
currently not supported for mTLS.
|
|
278
|
+
|
|
279
|
+
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
|
|
280
|
+
The client info used to send a user-agent string along with
|
|
281
|
+
API requests. If ``None``, then default info will be used.
|
|
282
|
+
Generally, you only need to set this if you're developing
|
|
283
|
+
your own client library.
|
|
284
|
+
|
|
285
|
+
Raises:
|
|
286
|
+
google.auth.exceptions.MutualTlsChannelError: If mutual TLS transport
|
|
287
|
+
creation failed for any reason.
|
|
288
|
+
"""
|
|
289
|
+
self._client = SqlBackupsServiceClient(
|
|
290
|
+
credentials=credentials,
|
|
291
|
+
transport=transport,
|
|
292
|
+
client_options=client_options,
|
|
293
|
+
client_info=client_info,
|
|
294
|
+
)
|
|
295
|
+
|
|
296
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
297
|
+
std_logging.DEBUG
|
|
298
|
+
): # pragma: NO COVER
|
|
299
|
+
_LOGGER.debug(
|
|
300
|
+
"Created client `google.cloud.sql_v1.SqlBackupsServiceAsyncClient`.",
|
|
301
|
+
extra={
|
|
302
|
+
"serviceName": "google.cloud.sql.v1.SqlBackupsService",
|
|
303
|
+
"universeDomain": getattr(
|
|
304
|
+
self._client._transport._credentials, "universe_domain", ""
|
|
305
|
+
),
|
|
306
|
+
"credentialsType": f"{type(self._client._transport._credentials).__module__}.{type(self._client._transport._credentials).__qualname__}",
|
|
307
|
+
"credentialsInfo": getattr(
|
|
308
|
+
self.transport._credentials, "get_cred_info", lambda: None
|
|
309
|
+
)(),
|
|
310
|
+
}
|
|
311
|
+
if hasattr(self._client._transport, "_credentials")
|
|
312
|
+
else {
|
|
313
|
+
"serviceName": "google.cloud.sql.v1.SqlBackupsService",
|
|
314
|
+
"credentialsType": None,
|
|
315
|
+
},
|
|
316
|
+
)
|
|
317
|
+
|
|
318
|
+
async def create_backup(
|
|
319
|
+
self,
|
|
320
|
+
request: Optional[Union[cloud_sql_backups.CreateBackupRequest, dict]] = None,
|
|
321
|
+
*,
|
|
322
|
+
parent: Optional[str] = None,
|
|
323
|
+
backup: Optional[cloud_sql_backups.Backup] = None,
|
|
324
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
325
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
326
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
327
|
+
) -> cloud_sql_resources.Operation:
|
|
328
|
+
r"""Creates a backup for a Cloud SQL instance. This API
|
|
329
|
+
can be used only to create on-demand backups.
|
|
330
|
+
|
|
331
|
+
.. code-block:: python
|
|
332
|
+
|
|
333
|
+
# This snippet has been automatically generated and should be regarded as a
|
|
334
|
+
# code template only.
|
|
335
|
+
# It will require modifications to work:
|
|
336
|
+
# - It may require correct/in-range values for request initialization.
|
|
337
|
+
# - It may require specifying regional endpoints when creating the service
|
|
338
|
+
# client as shown in:
|
|
339
|
+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
|
|
340
|
+
from google.cloud import sqladmin_v1
|
|
341
|
+
|
|
342
|
+
async def sample_create_backup():
|
|
343
|
+
# Create a client
|
|
344
|
+
client = sqladmin_v1.SqlBackupsServiceAsyncClient()
|
|
345
|
+
|
|
346
|
+
# Initialize request argument(s)
|
|
347
|
+
backup = sqladmin_v1.Backup()
|
|
348
|
+
backup.ttl_days = 868
|
|
349
|
+
|
|
350
|
+
request = sqladmin_v1.CreateBackupRequest(
|
|
351
|
+
parent="parent_value",
|
|
352
|
+
backup=backup,
|
|
353
|
+
)
|
|
354
|
+
|
|
355
|
+
# Make the request
|
|
356
|
+
response = await client.create_backup(request=request)
|
|
357
|
+
|
|
358
|
+
# Handle the response
|
|
359
|
+
print(response)
|
|
360
|
+
|
|
361
|
+
Args:
|
|
362
|
+
request (Optional[Union[google.cloud.sqladmin_v1.types.CreateBackupRequest, dict]]):
|
|
363
|
+
The request object. The request payload to create the
|
|
364
|
+
backup
|
|
365
|
+
parent (:class:`str`):
|
|
366
|
+
Required. The parent resource where
|
|
367
|
+
this backup is created. Format:
|
|
368
|
+
projects/{project}
|
|
369
|
+
|
|
370
|
+
This corresponds to the ``parent`` field
|
|
371
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
372
|
+
should not be set.
|
|
373
|
+
backup (:class:`google.cloud.sqladmin_v1.types.Backup`):
|
|
374
|
+
Required. The Backup to create.
|
|
375
|
+
This corresponds to the ``backup`` field
|
|
376
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
377
|
+
should not be set.
|
|
378
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
379
|
+
should be retried.
|
|
380
|
+
timeout (float): The timeout for this request.
|
|
381
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
382
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
383
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
384
|
+
be of type `bytes`.
|
|
385
|
+
|
|
386
|
+
Returns:
|
|
387
|
+
google.cloud.sqladmin_v1.types.Operation:
|
|
388
|
+
An Operation resource. For
|
|
389
|
+
successful operations that return an
|
|
390
|
+
Operation resource, only the fields
|
|
391
|
+
relevant to the operation are populated
|
|
392
|
+
in the resource.
|
|
393
|
+
|
|
394
|
+
"""
|
|
395
|
+
# Create or coerce a protobuf request object.
|
|
396
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
397
|
+
# gotten any keyword arguments that map to the request.
|
|
398
|
+
flattened_params = [parent, backup]
|
|
399
|
+
has_flattened_params = (
|
|
400
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
401
|
+
)
|
|
402
|
+
if request is not None and has_flattened_params:
|
|
403
|
+
raise ValueError(
|
|
404
|
+
"If the `request` argument is set, then none of "
|
|
405
|
+
"the individual field arguments should be set."
|
|
406
|
+
)
|
|
407
|
+
|
|
408
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
409
|
+
# there are no flattened fields), or create one.
|
|
410
|
+
if not isinstance(request, cloud_sql_backups.CreateBackupRequest):
|
|
411
|
+
request = cloud_sql_backups.CreateBackupRequest(request)
|
|
412
|
+
|
|
413
|
+
# If we have keyword arguments corresponding to fields on the
|
|
414
|
+
# request, apply these.
|
|
415
|
+
if parent is not None:
|
|
416
|
+
request.parent = parent
|
|
417
|
+
if backup is not None:
|
|
418
|
+
request.backup = backup
|
|
419
|
+
|
|
420
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
421
|
+
# and friendly error handling.
|
|
422
|
+
rpc = self._client._transport._wrapped_methods[
|
|
423
|
+
self._client._transport.create_backup
|
|
424
|
+
]
|
|
425
|
+
|
|
426
|
+
# Certain fields should be provided within the metadata header;
|
|
427
|
+
# add these here.
|
|
428
|
+
metadata = tuple(metadata) + (
|
|
429
|
+
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
|
|
430
|
+
)
|
|
431
|
+
|
|
432
|
+
# Validate the universe domain.
|
|
433
|
+
self._client._validate_universe_domain()
|
|
434
|
+
|
|
435
|
+
# Send the request.
|
|
436
|
+
response = await rpc(
|
|
437
|
+
request,
|
|
438
|
+
retry=retry,
|
|
439
|
+
timeout=timeout,
|
|
440
|
+
metadata=metadata,
|
|
441
|
+
)
|
|
442
|
+
|
|
443
|
+
# Done; return the response.
|
|
444
|
+
return response
|
|
445
|
+
|
|
446
|
+
async def get_backup(
|
|
447
|
+
self,
|
|
448
|
+
request: Optional[Union[cloud_sql_backups.GetBackupRequest, dict]] = None,
|
|
449
|
+
*,
|
|
450
|
+
name: Optional[str] = None,
|
|
451
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
452
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
453
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
454
|
+
) -> cloud_sql_backups.Backup:
|
|
455
|
+
r"""Retrieves a resource containing information about a
|
|
456
|
+
backup.
|
|
457
|
+
|
|
458
|
+
.. code-block:: python
|
|
459
|
+
|
|
460
|
+
# This snippet has been automatically generated and should be regarded as a
|
|
461
|
+
# code template only.
|
|
462
|
+
# It will require modifications to work:
|
|
463
|
+
# - It may require correct/in-range values for request initialization.
|
|
464
|
+
# - It may require specifying regional endpoints when creating the service
|
|
465
|
+
# client as shown in:
|
|
466
|
+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
|
|
467
|
+
from google.cloud import sqladmin_v1
|
|
468
|
+
|
|
469
|
+
async def sample_get_backup():
|
|
470
|
+
# Create a client
|
|
471
|
+
client = sqladmin_v1.SqlBackupsServiceAsyncClient()
|
|
472
|
+
|
|
473
|
+
# Initialize request argument(s)
|
|
474
|
+
request = sqladmin_v1.GetBackupRequest(
|
|
475
|
+
name="name_value",
|
|
476
|
+
)
|
|
477
|
+
|
|
478
|
+
# Make the request
|
|
479
|
+
response = await client.get_backup(request=request)
|
|
480
|
+
|
|
481
|
+
# Handle the response
|
|
482
|
+
print(response)
|
|
483
|
+
|
|
484
|
+
Args:
|
|
485
|
+
request (Optional[Union[google.cloud.sqladmin_v1.types.GetBackupRequest, dict]]):
|
|
486
|
+
The request object. The request payload to get the
|
|
487
|
+
backup.
|
|
488
|
+
name (:class:`str`):
|
|
489
|
+
Required. The name of the backup to
|
|
490
|
+
retrieve. Format:
|
|
491
|
+
projects/{project}/backups/{backup}
|
|
492
|
+
|
|
493
|
+
This corresponds to the ``name`` field
|
|
494
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
495
|
+
should not be set.
|
|
496
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
497
|
+
should be retried.
|
|
498
|
+
timeout (float): The timeout for this request.
|
|
499
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
500
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
501
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
502
|
+
be of type `bytes`.
|
|
503
|
+
|
|
504
|
+
Returns:
|
|
505
|
+
google.cloud.sqladmin_v1.types.Backup:
|
|
506
|
+
A backup resource.
|
|
507
|
+
"""
|
|
508
|
+
# Create or coerce a protobuf request object.
|
|
509
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
510
|
+
# gotten any keyword arguments that map to the request.
|
|
511
|
+
flattened_params = [name]
|
|
512
|
+
has_flattened_params = (
|
|
513
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
514
|
+
)
|
|
515
|
+
if request is not None and has_flattened_params:
|
|
516
|
+
raise ValueError(
|
|
517
|
+
"If the `request` argument is set, then none of "
|
|
518
|
+
"the individual field arguments should be set."
|
|
519
|
+
)
|
|
520
|
+
|
|
521
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
522
|
+
# there are no flattened fields), or create one.
|
|
523
|
+
if not isinstance(request, cloud_sql_backups.GetBackupRequest):
|
|
524
|
+
request = cloud_sql_backups.GetBackupRequest(request)
|
|
525
|
+
|
|
526
|
+
# If we have keyword arguments corresponding to fields on the
|
|
527
|
+
# request, apply these.
|
|
528
|
+
if name is not None:
|
|
529
|
+
request.name = name
|
|
530
|
+
|
|
531
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
532
|
+
# and friendly error handling.
|
|
533
|
+
rpc = self._client._transport._wrapped_methods[
|
|
534
|
+
self._client._transport.get_backup
|
|
535
|
+
]
|
|
536
|
+
|
|
537
|
+
# Certain fields should be provided within the metadata header;
|
|
538
|
+
# add these here.
|
|
539
|
+
metadata = tuple(metadata) + (
|
|
540
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
|
|
541
|
+
)
|
|
542
|
+
|
|
543
|
+
# Validate the universe domain.
|
|
544
|
+
self._client._validate_universe_domain()
|
|
545
|
+
|
|
546
|
+
# Send the request.
|
|
547
|
+
response = await rpc(
|
|
548
|
+
request,
|
|
549
|
+
retry=retry,
|
|
550
|
+
timeout=timeout,
|
|
551
|
+
metadata=metadata,
|
|
552
|
+
)
|
|
553
|
+
|
|
554
|
+
# Done; return the response.
|
|
555
|
+
return response
|
|
556
|
+
|
|
557
|
+
async def list_backups(
|
|
558
|
+
self,
|
|
559
|
+
request: Optional[Union[cloud_sql_backups.ListBackupsRequest, dict]] = None,
|
|
560
|
+
*,
|
|
561
|
+
parent: Optional[str] = None,
|
|
562
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
563
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
564
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
565
|
+
) -> pagers.ListBackupsAsyncPager:
|
|
566
|
+
r"""Lists all backups associated with the project.
|
|
567
|
+
|
|
568
|
+
.. code-block:: python
|
|
569
|
+
|
|
570
|
+
# This snippet has been automatically generated and should be regarded as a
|
|
571
|
+
# code template only.
|
|
572
|
+
# It will require modifications to work:
|
|
573
|
+
# - It may require correct/in-range values for request initialization.
|
|
574
|
+
# - It may require specifying regional endpoints when creating the service
|
|
575
|
+
# client as shown in:
|
|
576
|
+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
|
|
577
|
+
from google.cloud import sqladmin_v1
|
|
578
|
+
|
|
579
|
+
async def sample_list_backups():
|
|
580
|
+
# Create a client
|
|
581
|
+
client = sqladmin_v1.SqlBackupsServiceAsyncClient()
|
|
582
|
+
|
|
583
|
+
# Initialize request argument(s)
|
|
584
|
+
request = sqladmin_v1.ListBackupsRequest(
|
|
585
|
+
parent="parent_value",
|
|
586
|
+
)
|
|
587
|
+
|
|
588
|
+
# Make the request
|
|
589
|
+
page_result = client.list_backups(request=request)
|
|
590
|
+
|
|
591
|
+
# Handle the response
|
|
592
|
+
async for response in page_result:
|
|
593
|
+
print(response)
|
|
594
|
+
|
|
595
|
+
Args:
|
|
596
|
+
request (Optional[Union[google.cloud.sqladmin_v1.types.ListBackupsRequest, dict]]):
|
|
597
|
+
The request object. The request payload to list the
|
|
598
|
+
backups.
|
|
599
|
+
parent (:class:`str`):
|
|
600
|
+
Required. The parent that owns this
|
|
601
|
+
collection of backups. Format:
|
|
602
|
+
projects/{project}
|
|
603
|
+
|
|
604
|
+
This corresponds to the ``parent`` field
|
|
605
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
606
|
+
should not be set.
|
|
607
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
608
|
+
should be retried.
|
|
609
|
+
timeout (float): The timeout for this request.
|
|
610
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
611
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
612
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
613
|
+
be of type `bytes`.
|
|
614
|
+
|
|
615
|
+
Returns:
|
|
616
|
+
google.cloud.sqladmin_v1.services.sql_backups_service.pagers.ListBackupsAsyncPager:
|
|
617
|
+
The response payload containing a
|
|
618
|
+
list of the backups.
|
|
619
|
+
Iterating over this object will yield
|
|
620
|
+
results and resolve additional pages
|
|
621
|
+
automatically.
|
|
622
|
+
|
|
623
|
+
"""
|
|
624
|
+
# Create or coerce a protobuf request object.
|
|
625
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
626
|
+
# gotten any keyword arguments that map to the request.
|
|
627
|
+
flattened_params = [parent]
|
|
628
|
+
has_flattened_params = (
|
|
629
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
630
|
+
)
|
|
631
|
+
if request is not None and has_flattened_params:
|
|
632
|
+
raise ValueError(
|
|
633
|
+
"If the `request` argument is set, then none of "
|
|
634
|
+
"the individual field arguments should be set."
|
|
635
|
+
)
|
|
636
|
+
|
|
637
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
638
|
+
# there are no flattened fields), or create one.
|
|
639
|
+
if not isinstance(request, cloud_sql_backups.ListBackupsRequest):
|
|
640
|
+
request = cloud_sql_backups.ListBackupsRequest(request)
|
|
641
|
+
|
|
642
|
+
# If we have keyword arguments corresponding to fields on the
|
|
643
|
+
# request, apply these.
|
|
644
|
+
if parent is not None:
|
|
645
|
+
request.parent = parent
|
|
646
|
+
|
|
647
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
648
|
+
# and friendly error handling.
|
|
649
|
+
rpc = self._client._transport._wrapped_methods[
|
|
650
|
+
self._client._transport.list_backups
|
|
651
|
+
]
|
|
652
|
+
|
|
653
|
+
# Certain fields should be provided within the metadata header;
|
|
654
|
+
# add these here.
|
|
655
|
+
metadata = tuple(metadata) + (
|
|
656
|
+
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
|
|
657
|
+
)
|
|
658
|
+
|
|
659
|
+
# Validate the universe domain.
|
|
660
|
+
self._client._validate_universe_domain()
|
|
661
|
+
|
|
662
|
+
# Send the request.
|
|
663
|
+
response = await rpc(
|
|
664
|
+
request,
|
|
665
|
+
retry=retry,
|
|
666
|
+
timeout=timeout,
|
|
667
|
+
metadata=metadata,
|
|
668
|
+
)
|
|
669
|
+
|
|
670
|
+
# This method is paged; wrap the response in a pager, which provides
|
|
671
|
+
# an `__aiter__` convenience method.
|
|
672
|
+
response = pagers.ListBackupsAsyncPager(
|
|
673
|
+
method=rpc,
|
|
674
|
+
request=request,
|
|
675
|
+
response=response,
|
|
676
|
+
retry=retry,
|
|
677
|
+
timeout=timeout,
|
|
678
|
+
metadata=metadata,
|
|
679
|
+
)
|
|
680
|
+
|
|
681
|
+
# Done; return the response.
|
|
682
|
+
return response
|
|
683
|
+
|
|
684
|
+
async def update_backup(
|
|
685
|
+
self,
|
|
686
|
+
request: Optional[Union[cloud_sql_backups.UpdateBackupRequest, dict]] = None,
|
|
687
|
+
*,
|
|
688
|
+
backup: Optional[cloud_sql_backups.Backup] = None,
|
|
689
|
+
update_mask: Optional[field_mask_pb2.FieldMask] = None,
|
|
690
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
691
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
692
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
693
|
+
) -> cloud_sql_resources.Operation:
|
|
694
|
+
r"""Updates the retention period and description of the
|
|
695
|
+
backup. You can use this API to update final backups
|
|
696
|
+
only.
|
|
697
|
+
|
|
698
|
+
.. code-block:: python
|
|
699
|
+
|
|
700
|
+
# This snippet has been automatically generated and should be regarded as a
|
|
701
|
+
# code template only.
|
|
702
|
+
# It will require modifications to work:
|
|
703
|
+
# - It may require correct/in-range values for request initialization.
|
|
704
|
+
# - It may require specifying regional endpoints when creating the service
|
|
705
|
+
# client as shown in:
|
|
706
|
+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
|
|
707
|
+
from google.cloud import sqladmin_v1
|
|
708
|
+
|
|
709
|
+
async def sample_update_backup():
|
|
710
|
+
# Create a client
|
|
711
|
+
client = sqladmin_v1.SqlBackupsServiceAsyncClient()
|
|
712
|
+
|
|
713
|
+
# Initialize request argument(s)
|
|
714
|
+
backup = sqladmin_v1.Backup()
|
|
715
|
+
backup.ttl_days = 868
|
|
716
|
+
|
|
717
|
+
request = sqladmin_v1.UpdateBackupRequest(
|
|
718
|
+
backup=backup,
|
|
719
|
+
)
|
|
720
|
+
|
|
721
|
+
# Make the request
|
|
722
|
+
response = await client.update_backup(request=request)
|
|
723
|
+
|
|
724
|
+
# Handle the response
|
|
725
|
+
print(response)
|
|
726
|
+
|
|
727
|
+
Args:
|
|
728
|
+
request (Optional[Union[google.cloud.sqladmin_v1.types.UpdateBackupRequest, dict]]):
|
|
729
|
+
The request object. The request payload to update the
|
|
730
|
+
backup.
|
|
731
|
+
backup (:class:`google.cloud.sqladmin_v1.types.Backup`):
|
|
732
|
+
Required. The backup to update. The backup’s ``name``
|
|
733
|
+
field is used to identify the backup to update. Format:
|
|
734
|
+
projects/{project}/backups/{backup}
|
|
735
|
+
|
|
736
|
+
This corresponds to the ``backup`` field
|
|
737
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
738
|
+
should not be set.
|
|
739
|
+
update_mask (:class:`google.protobuf.field_mask_pb2.FieldMask`):
|
|
740
|
+
The list of fields that you can
|
|
741
|
+
update. You can update only the
|
|
742
|
+
description and retention period of the
|
|
743
|
+
final backup.
|
|
744
|
+
|
|
745
|
+
This corresponds to the ``update_mask`` field
|
|
746
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
747
|
+
should not be set.
|
|
748
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
749
|
+
should be retried.
|
|
750
|
+
timeout (float): The timeout for this request.
|
|
751
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
752
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
753
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
754
|
+
be of type `bytes`.
|
|
755
|
+
|
|
756
|
+
Returns:
|
|
757
|
+
google.cloud.sqladmin_v1.types.Operation:
|
|
758
|
+
An Operation resource. For
|
|
759
|
+
successful operations that return an
|
|
760
|
+
Operation resource, only the fields
|
|
761
|
+
relevant to the operation are populated
|
|
762
|
+
in the resource.
|
|
763
|
+
|
|
764
|
+
"""
|
|
765
|
+
# Create or coerce a protobuf request object.
|
|
766
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
767
|
+
# gotten any keyword arguments that map to the request.
|
|
768
|
+
flattened_params = [backup, update_mask]
|
|
769
|
+
has_flattened_params = (
|
|
770
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
771
|
+
)
|
|
772
|
+
if request is not None and has_flattened_params:
|
|
773
|
+
raise ValueError(
|
|
774
|
+
"If the `request` argument is set, then none of "
|
|
775
|
+
"the individual field arguments should be set."
|
|
776
|
+
)
|
|
777
|
+
|
|
778
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
779
|
+
# there are no flattened fields), or create one.
|
|
780
|
+
if not isinstance(request, cloud_sql_backups.UpdateBackupRequest):
|
|
781
|
+
request = cloud_sql_backups.UpdateBackupRequest(request)
|
|
782
|
+
|
|
783
|
+
# If we have keyword arguments corresponding to fields on the
|
|
784
|
+
# request, apply these.
|
|
785
|
+
if backup is not None:
|
|
786
|
+
request.backup = backup
|
|
787
|
+
if update_mask is not None:
|
|
788
|
+
request.update_mask = update_mask
|
|
789
|
+
|
|
790
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
791
|
+
# and friendly error handling.
|
|
792
|
+
rpc = self._client._transport._wrapped_methods[
|
|
793
|
+
self._client._transport.update_backup
|
|
794
|
+
]
|
|
795
|
+
|
|
796
|
+
# Certain fields should be provided within the metadata header;
|
|
797
|
+
# add these here.
|
|
798
|
+
metadata = tuple(metadata) + (
|
|
799
|
+
gapic_v1.routing_header.to_grpc_metadata(
|
|
800
|
+
(("backup.name", request.backup.name),)
|
|
801
|
+
),
|
|
802
|
+
)
|
|
803
|
+
|
|
804
|
+
# Validate the universe domain.
|
|
805
|
+
self._client._validate_universe_domain()
|
|
806
|
+
|
|
807
|
+
# Send the request.
|
|
808
|
+
response = await rpc(
|
|
809
|
+
request,
|
|
810
|
+
retry=retry,
|
|
811
|
+
timeout=timeout,
|
|
812
|
+
metadata=metadata,
|
|
813
|
+
)
|
|
814
|
+
|
|
815
|
+
# Done; return the response.
|
|
816
|
+
return response
|
|
817
|
+
|
|
818
|
+
async def delete_backup(
|
|
819
|
+
self,
|
|
820
|
+
request: Optional[Union[cloud_sql_backups.DeleteBackupRequest, dict]] = None,
|
|
821
|
+
*,
|
|
822
|
+
name: Optional[str] = None,
|
|
823
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
824
|
+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
|
|
825
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
826
|
+
) -> cloud_sql_resources.Operation:
|
|
827
|
+
r"""Deletes the backup.
|
|
828
|
+
|
|
829
|
+
.. code-block:: python
|
|
830
|
+
|
|
831
|
+
# This snippet has been automatically generated and should be regarded as a
|
|
832
|
+
# code template only.
|
|
833
|
+
# It will require modifications to work:
|
|
834
|
+
# - It may require correct/in-range values for request initialization.
|
|
835
|
+
# - It may require specifying regional endpoints when creating the service
|
|
836
|
+
# client as shown in:
|
|
837
|
+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
|
|
838
|
+
from google.cloud import sqladmin_v1
|
|
839
|
+
|
|
840
|
+
async def sample_delete_backup():
|
|
841
|
+
# Create a client
|
|
842
|
+
client = sqladmin_v1.SqlBackupsServiceAsyncClient()
|
|
843
|
+
|
|
844
|
+
# Initialize request argument(s)
|
|
845
|
+
request = sqladmin_v1.DeleteBackupRequest(
|
|
846
|
+
name="name_value",
|
|
847
|
+
)
|
|
848
|
+
|
|
849
|
+
# Make the request
|
|
850
|
+
response = await client.delete_backup(request=request)
|
|
851
|
+
|
|
852
|
+
# Handle the response
|
|
853
|
+
print(response)
|
|
854
|
+
|
|
855
|
+
Args:
|
|
856
|
+
request (Optional[Union[google.cloud.sqladmin_v1.types.DeleteBackupRequest, dict]]):
|
|
857
|
+
The request object. The request payload to delete the
|
|
858
|
+
backup.
|
|
859
|
+
name (:class:`str`):
|
|
860
|
+
Required. The name of the backup to
|
|
861
|
+
delete. Format:
|
|
862
|
+
projects/{project}/backups/{backup}
|
|
863
|
+
|
|
864
|
+
This corresponds to the ``name`` field
|
|
865
|
+
on the ``request`` instance; if ``request`` is provided, this
|
|
866
|
+
should not be set.
|
|
867
|
+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
|
|
868
|
+
should be retried.
|
|
869
|
+
timeout (float): The timeout for this request.
|
|
870
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
871
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
872
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
873
|
+
be of type `bytes`.
|
|
874
|
+
|
|
875
|
+
Returns:
|
|
876
|
+
google.cloud.sqladmin_v1.types.Operation:
|
|
877
|
+
An Operation resource. For
|
|
878
|
+
successful operations that return an
|
|
879
|
+
Operation resource, only the fields
|
|
880
|
+
relevant to the operation are populated
|
|
881
|
+
in the resource.
|
|
882
|
+
|
|
883
|
+
"""
|
|
884
|
+
# Create or coerce a protobuf request object.
|
|
885
|
+
# - Quick check: If we got a request object, we should *not* have
|
|
886
|
+
# gotten any keyword arguments that map to the request.
|
|
887
|
+
flattened_params = [name]
|
|
888
|
+
has_flattened_params = (
|
|
889
|
+
len([param for param in flattened_params if param is not None]) > 0
|
|
890
|
+
)
|
|
891
|
+
if request is not None and has_flattened_params:
|
|
892
|
+
raise ValueError(
|
|
893
|
+
"If the `request` argument is set, then none of "
|
|
894
|
+
"the individual field arguments should be set."
|
|
895
|
+
)
|
|
896
|
+
|
|
897
|
+
# - Use the request object if provided (there's no risk of modifying the input as
|
|
898
|
+
# there are no flattened fields), or create one.
|
|
899
|
+
if not isinstance(request, cloud_sql_backups.DeleteBackupRequest):
|
|
900
|
+
request = cloud_sql_backups.DeleteBackupRequest(request)
|
|
901
|
+
|
|
902
|
+
# If we have keyword arguments corresponding to fields on the
|
|
903
|
+
# request, apply these.
|
|
904
|
+
if name is not None:
|
|
905
|
+
request.name = name
|
|
906
|
+
|
|
907
|
+
# Wrap the RPC method; this adds retry and timeout information,
|
|
908
|
+
# and friendly error handling.
|
|
909
|
+
rpc = self._client._transport._wrapped_methods[
|
|
910
|
+
self._client._transport.delete_backup
|
|
911
|
+
]
|
|
912
|
+
|
|
913
|
+
# Certain fields should be provided within the metadata header;
|
|
914
|
+
# add these here.
|
|
915
|
+
metadata = tuple(metadata) + (
|
|
916
|
+
gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
|
|
917
|
+
)
|
|
918
|
+
|
|
919
|
+
# Validate the universe domain.
|
|
920
|
+
self._client._validate_universe_domain()
|
|
921
|
+
|
|
922
|
+
# Send the request.
|
|
923
|
+
response = await rpc(
|
|
924
|
+
request,
|
|
925
|
+
retry=retry,
|
|
926
|
+
timeout=timeout,
|
|
927
|
+
metadata=metadata,
|
|
928
|
+
)
|
|
929
|
+
|
|
930
|
+
# Done; return the response.
|
|
931
|
+
return response
|
|
932
|
+
|
|
933
|
+
async def __aenter__(self) -> "SqlBackupsServiceAsyncClient":
|
|
934
|
+
return self
|
|
935
|
+
|
|
936
|
+
async def __aexit__(self, exc_type, exc, tb):
|
|
937
|
+
await self.transport.close()
|
|
938
|
+
|
|
939
|
+
|
|
940
|
+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
|
|
941
|
+
gapic_version=package_version.__version__
|
|
942
|
+
)
|
|
943
|
+
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
|
|
944
|
+
|
|
945
|
+
|
|
946
|
+
__all__ = ("SqlBackupsServiceAsyncClient",)
|