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,1238 @@
|
|
|
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 dataclasses
|
|
17
|
+
import json # type: ignore
|
|
18
|
+
import logging
|
|
19
|
+
import warnings
|
|
20
|
+
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple, Union
|
|
21
|
+
|
|
22
|
+
import google.protobuf
|
|
23
|
+
from google.api_core import exceptions as core_exceptions
|
|
24
|
+
from google.api_core import gapic_v1, rest_helpers, rest_streaming
|
|
25
|
+
from google.api_core import retry as retries
|
|
26
|
+
from google.auth import credentials as ga_credentials # type: ignore
|
|
27
|
+
from google.auth.transport.requests import AuthorizedSession # type: ignore
|
|
28
|
+
from google.cloud.location import locations_pb2 # type: ignore
|
|
29
|
+
from google.longrunning import operations_pb2 # type: ignore
|
|
30
|
+
from google.protobuf import json_format
|
|
31
|
+
from requests import __version__ as requests_version
|
|
32
|
+
|
|
33
|
+
from google.cloud.sqladmin_v1beta4._compat import transcode_request
|
|
34
|
+
from google.cloud.sqladmin_v1beta4.types import cloud_sql, cloud_sql_resources
|
|
35
|
+
|
|
36
|
+
from .base import DEFAULT_CLIENT_INFO as BASE_DEFAULT_CLIENT_INFO
|
|
37
|
+
from .rest_base import _BaseSqlBackupsServiceRestTransport
|
|
38
|
+
|
|
39
|
+
try:
|
|
40
|
+
OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None]
|
|
41
|
+
except AttributeError: # pragma: NO COVER
|
|
42
|
+
OptionalRetry = Union[retries.Retry, object, None] # type: ignore
|
|
43
|
+
|
|
44
|
+
try:
|
|
45
|
+
from google.api_core import client_logging # type: ignore
|
|
46
|
+
|
|
47
|
+
CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER
|
|
48
|
+
except ImportError: # pragma: NO COVER
|
|
49
|
+
CLIENT_LOGGING_SUPPORTED = False
|
|
50
|
+
|
|
51
|
+
_LOGGER = logging.getLogger(__name__)
|
|
52
|
+
|
|
53
|
+
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
|
|
54
|
+
gapic_version=BASE_DEFAULT_CLIENT_INFO.gapic_version,
|
|
55
|
+
grpc_version=None,
|
|
56
|
+
rest_version=f"requests@{requests_version}",
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class SqlBackupsServiceRestInterceptor:
|
|
63
|
+
"""Interceptor for SqlBackupsService.
|
|
64
|
+
|
|
65
|
+
Interceptors are used to manipulate requests, request metadata, and responses
|
|
66
|
+
in arbitrary ways.
|
|
67
|
+
Example use cases include:
|
|
68
|
+
* Logging
|
|
69
|
+
* Verifying requests according to service or custom semantics
|
|
70
|
+
* Stripping extraneous information from responses
|
|
71
|
+
|
|
72
|
+
These use cases and more can be enabled by injecting an
|
|
73
|
+
instance of a custom subclass when constructing the SqlBackupsServiceRestTransport.
|
|
74
|
+
|
|
75
|
+
.. code-block:: python
|
|
76
|
+
class MyCustomSqlBackupsServiceInterceptor(SqlBackupsServiceRestInterceptor):
|
|
77
|
+
def pre_create_backup(self, request, metadata):
|
|
78
|
+
logging.log(f"Received request: {request}")
|
|
79
|
+
return request, metadata
|
|
80
|
+
|
|
81
|
+
def post_create_backup(self, response):
|
|
82
|
+
logging.log(f"Received response: {response}")
|
|
83
|
+
return response
|
|
84
|
+
|
|
85
|
+
def pre_delete_backup(self, request, metadata):
|
|
86
|
+
logging.log(f"Received request: {request}")
|
|
87
|
+
return request, metadata
|
|
88
|
+
|
|
89
|
+
def post_delete_backup(self, response):
|
|
90
|
+
logging.log(f"Received response: {response}")
|
|
91
|
+
return response
|
|
92
|
+
|
|
93
|
+
def pre_get_backup(self, request, metadata):
|
|
94
|
+
logging.log(f"Received request: {request}")
|
|
95
|
+
return request, metadata
|
|
96
|
+
|
|
97
|
+
def post_get_backup(self, response):
|
|
98
|
+
logging.log(f"Received response: {response}")
|
|
99
|
+
return response
|
|
100
|
+
|
|
101
|
+
def pre_list_backups(self, request, metadata):
|
|
102
|
+
logging.log(f"Received request: {request}")
|
|
103
|
+
return request, metadata
|
|
104
|
+
|
|
105
|
+
def post_list_backups(self, response):
|
|
106
|
+
logging.log(f"Received response: {response}")
|
|
107
|
+
return response
|
|
108
|
+
|
|
109
|
+
def pre_update_backup(self, request, metadata):
|
|
110
|
+
logging.log(f"Received request: {request}")
|
|
111
|
+
return request, metadata
|
|
112
|
+
|
|
113
|
+
def post_update_backup(self, response):
|
|
114
|
+
logging.log(f"Received response: {response}")
|
|
115
|
+
return response
|
|
116
|
+
|
|
117
|
+
transport = SqlBackupsServiceRestTransport(interceptor=MyCustomSqlBackupsServiceInterceptor())
|
|
118
|
+
client = SqlBackupsServiceClient(transport=transport)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
"""
|
|
122
|
+
|
|
123
|
+
def pre_create_backup(
|
|
124
|
+
self,
|
|
125
|
+
request: cloud_sql.CreateBackupRequest,
|
|
126
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
127
|
+
) -> Tuple[cloud_sql.CreateBackupRequest, Sequence[Tuple[str, Union[str, bytes]]]]:
|
|
128
|
+
"""Pre-rpc interceptor for create_backup
|
|
129
|
+
|
|
130
|
+
Override in a subclass to manipulate the request or metadata
|
|
131
|
+
before they are sent to the SqlBackupsService server.
|
|
132
|
+
"""
|
|
133
|
+
return request, metadata
|
|
134
|
+
|
|
135
|
+
def post_create_backup(
|
|
136
|
+
self, response: cloud_sql_resources.Operation
|
|
137
|
+
) -> cloud_sql_resources.Operation:
|
|
138
|
+
"""Post-rpc interceptor for create_backup
|
|
139
|
+
|
|
140
|
+
DEPRECATED. Please use the `post_create_backup_with_metadata`
|
|
141
|
+
interceptor instead.
|
|
142
|
+
|
|
143
|
+
Override in a subclass to read or manipulate the response
|
|
144
|
+
after it is returned by the SqlBackupsService server but before
|
|
145
|
+
it is returned to user code. This `post_create_backup` interceptor runs
|
|
146
|
+
before the `post_create_backup_with_metadata` interceptor.
|
|
147
|
+
"""
|
|
148
|
+
return response
|
|
149
|
+
|
|
150
|
+
def post_create_backup_with_metadata(
|
|
151
|
+
self,
|
|
152
|
+
response: cloud_sql_resources.Operation,
|
|
153
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
154
|
+
) -> Tuple[cloud_sql_resources.Operation, Sequence[Tuple[str, Union[str, bytes]]]]:
|
|
155
|
+
"""Post-rpc interceptor for create_backup
|
|
156
|
+
|
|
157
|
+
Override in a subclass to read or manipulate the response or metadata after it
|
|
158
|
+
is returned by the SqlBackupsService server but before it is returned to user code.
|
|
159
|
+
|
|
160
|
+
We recommend only using this `post_create_backup_with_metadata`
|
|
161
|
+
interceptor in new development instead of the `post_create_backup` interceptor.
|
|
162
|
+
When both interceptors are used, this `post_create_backup_with_metadata` interceptor runs after the
|
|
163
|
+
`post_create_backup` interceptor. The (possibly modified) response returned by
|
|
164
|
+
`post_create_backup` will be passed to
|
|
165
|
+
`post_create_backup_with_metadata`.
|
|
166
|
+
"""
|
|
167
|
+
return response, metadata
|
|
168
|
+
|
|
169
|
+
def pre_delete_backup(
|
|
170
|
+
self,
|
|
171
|
+
request: cloud_sql.DeleteBackupRequest,
|
|
172
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
173
|
+
) -> Tuple[cloud_sql.DeleteBackupRequest, Sequence[Tuple[str, Union[str, bytes]]]]:
|
|
174
|
+
"""Pre-rpc interceptor for delete_backup
|
|
175
|
+
|
|
176
|
+
Override in a subclass to manipulate the request or metadata
|
|
177
|
+
before they are sent to the SqlBackupsService server.
|
|
178
|
+
"""
|
|
179
|
+
return request, metadata
|
|
180
|
+
|
|
181
|
+
def post_delete_backup(
|
|
182
|
+
self, response: cloud_sql_resources.Operation
|
|
183
|
+
) -> cloud_sql_resources.Operation:
|
|
184
|
+
"""Post-rpc interceptor for delete_backup
|
|
185
|
+
|
|
186
|
+
DEPRECATED. Please use the `post_delete_backup_with_metadata`
|
|
187
|
+
interceptor instead.
|
|
188
|
+
|
|
189
|
+
Override in a subclass to read or manipulate the response
|
|
190
|
+
after it is returned by the SqlBackupsService server but before
|
|
191
|
+
it is returned to user code. This `post_delete_backup` interceptor runs
|
|
192
|
+
before the `post_delete_backup_with_metadata` interceptor.
|
|
193
|
+
"""
|
|
194
|
+
return response
|
|
195
|
+
|
|
196
|
+
def post_delete_backup_with_metadata(
|
|
197
|
+
self,
|
|
198
|
+
response: cloud_sql_resources.Operation,
|
|
199
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
200
|
+
) -> Tuple[cloud_sql_resources.Operation, Sequence[Tuple[str, Union[str, bytes]]]]:
|
|
201
|
+
"""Post-rpc interceptor for delete_backup
|
|
202
|
+
|
|
203
|
+
Override in a subclass to read or manipulate the response or metadata after it
|
|
204
|
+
is returned by the SqlBackupsService server but before it is returned to user code.
|
|
205
|
+
|
|
206
|
+
We recommend only using this `post_delete_backup_with_metadata`
|
|
207
|
+
interceptor in new development instead of the `post_delete_backup` interceptor.
|
|
208
|
+
When both interceptors are used, this `post_delete_backup_with_metadata` interceptor runs after the
|
|
209
|
+
`post_delete_backup` interceptor. The (possibly modified) response returned by
|
|
210
|
+
`post_delete_backup` will be passed to
|
|
211
|
+
`post_delete_backup_with_metadata`.
|
|
212
|
+
"""
|
|
213
|
+
return response, metadata
|
|
214
|
+
|
|
215
|
+
def pre_get_backup(
|
|
216
|
+
self,
|
|
217
|
+
request: cloud_sql.GetBackupRequest,
|
|
218
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
219
|
+
) -> Tuple[cloud_sql.GetBackupRequest, Sequence[Tuple[str, Union[str, bytes]]]]:
|
|
220
|
+
"""Pre-rpc interceptor for get_backup
|
|
221
|
+
|
|
222
|
+
Override in a subclass to manipulate the request or metadata
|
|
223
|
+
before they are sent to the SqlBackupsService server.
|
|
224
|
+
"""
|
|
225
|
+
return request, metadata
|
|
226
|
+
|
|
227
|
+
def post_get_backup(
|
|
228
|
+
self, response: cloud_sql_resources.Backup
|
|
229
|
+
) -> cloud_sql_resources.Backup:
|
|
230
|
+
"""Post-rpc interceptor for get_backup
|
|
231
|
+
|
|
232
|
+
DEPRECATED. Please use the `post_get_backup_with_metadata`
|
|
233
|
+
interceptor instead.
|
|
234
|
+
|
|
235
|
+
Override in a subclass to read or manipulate the response
|
|
236
|
+
after it is returned by the SqlBackupsService server but before
|
|
237
|
+
it is returned to user code. This `post_get_backup` interceptor runs
|
|
238
|
+
before the `post_get_backup_with_metadata` interceptor.
|
|
239
|
+
"""
|
|
240
|
+
return response
|
|
241
|
+
|
|
242
|
+
def post_get_backup_with_metadata(
|
|
243
|
+
self,
|
|
244
|
+
response: cloud_sql_resources.Backup,
|
|
245
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
246
|
+
) -> Tuple[cloud_sql_resources.Backup, Sequence[Tuple[str, Union[str, bytes]]]]:
|
|
247
|
+
"""Post-rpc interceptor for get_backup
|
|
248
|
+
|
|
249
|
+
Override in a subclass to read or manipulate the response or metadata after it
|
|
250
|
+
is returned by the SqlBackupsService server but before it is returned to user code.
|
|
251
|
+
|
|
252
|
+
We recommend only using this `post_get_backup_with_metadata`
|
|
253
|
+
interceptor in new development instead of the `post_get_backup` interceptor.
|
|
254
|
+
When both interceptors are used, this `post_get_backup_with_metadata` interceptor runs after the
|
|
255
|
+
`post_get_backup` interceptor. The (possibly modified) response returned by
|
|
256
|
+
`post_get_backup` will be passed to
|
|
257
|
+
`post_get_backup_with_metadata`.
|
|
258
|
+
"""
|
|
259
|
+
return response, metadata
|
|
260
|
+
|
|
261
|
+
def pre_list_backups(
|
|
262
|
+
self,
|
|
263
|
+
request: cloud_sql.ListBackupsRequest,
|
|
264
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
265
|
+
) -> Tuple[cloud_sql.ListBackupsRequest, Sequence[Tuple[str, Union[str, bytes]]]]:
|
|
266
|
+
"""Pre-rpc interceptor for list_backups
|
|
267
|
+
|
|
268
|
+
Override in a subclass to manipulate the request or metadata
|
|
269
|
+
before they are sent to the SqlBackupsService server.
|
|
270
|
+
"""
|
|
271
|
+
return request, metadata
|
|
272
|
+
|
|
273
|
+
def post_list_backups(
|
|
274
|
+
self, response: cloud_sql.ListBackupsResponse
|
|
275
|
+
) -> cloud_sql.ListBackupsResponse:
|
|
276
|
+
"""Post-rpc interceptor for list_backups
|
|
277
|
+
|
|
278
|
+
DEPRECATED. Please use the `post_list_backups_with_metadata`
|
|
279
|
+
interceptor instead.
|
|
280
|
+
|
|
281
|
+
Override in a subclass to read or manipulate the response
|
|
282
|
+
after it is returned by the SqlBackupsService server but before
|
|
283
|
+
it is returned to user code. This `post_list_backups` interceptor runs
|
|
284
|
+
before the `post_list_backups_with_metadata` interceptor.
|
|
285
|
+
"""
|
|
286
|
+
return response
|
|
287
|
+
|
|
288
|
+
def post_list_backups_with_metadata(
|
|
289
|
+
self,
|
|
290
|
+
response: cloud_sql.ListBackupsResponse,
|
|
291
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
292
|
+
) -> Tuple[cloud_sql.ListBackupsResponse, Sequence[Tuple[str, Union[str, bytes]]]]:
|
|
293
|
+
"""Post-rpc interceptor for list_backups
|
|
294
|
+
|
|
295
|
+
Override in a subclass to read or manipulate the response or metadata after it
|
|
296
|
+
is returned by the SqlBackupsService server but before it is returned to user code.
|
|
297
|
+
|
|
298
|
+
We recommend only using this `post_list_backups_with_metadata`
|
|
299
|
+
interceptor in new development instead of the `post_list_backups` interceptor.
|
|
300
|
+
When both interceptors are used, this `post_list_backups_with_metadata` interceptor runs after the
|
|
301
|
+
`post_list_backups` interceptor. The (possibly modified) response returned by
|
|
302
|
+
`post_list_backups` will be passed to
|
|
303
|
+
`post_list_backups_with_metadata`.
|
|
304
|
+
"""
|
|
305
|
+
return response, metadata
|
|
306
|
+
|
|
307
|
+
def pre_update_backup(
|
|
308
|
+
self,
|
|
309
|
+
request: cloud_sql.UpdateBackupRequest,
|
|
310
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
311
|
+
) -> Tuple[cloud_sql.UpdateBackupRequest, Sequence[Tuple[str, Union[str, bytes]]]]:
|
|
312
|
+
"""Pre-rpc interceptor for update_backup
|
|
313
|
+
|
|
314
|
+
Override in a subclass to manipulate the request or metadata
|
|
315
|
+
before they are sent to the SqlBackupsService server.
|
|
316
|
+
"""
|
|
317
|
+
return request, metadata
|
|
318
|
+
|
|
319
|
+
def post_update_backup(
|
|
320
|
+
self, response: cloud_sql_resources.Operation
|
|
321
|
+
) -> cloud_sql_resources.Operation:
|
|
322
|
+
"""Post-rpc interceptor for update_backup
|
|
323
|
+
|
|
324
|
+
DEPRECATED. Please use the `post_update_backup_with_metadata`
|
|
325
|
+
interceptor instead.
|
|
326
|
+
|
|
327
|
+
Override in a subclass to read or manipulate the response
|
|
328
|
+
after it is returned by the SqlBackupsService server but before
|
|
329
|
+
it is returned to user code. This `post_update_backup` interceptor runs
|
|
330
|
+
before the `post_update_backup_with_metadata` interceptor.
|
|
331
|
+
"""
|
|
332
|
+
return response
|
|
333
|
+
|
|
334
|
+
def post_update_backup_with_metadata(
|
|
335
|
+
self,
|
|
336
|
+
response: cloud_sql_resources.Operation,
|
|
337
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]],
|
|
338
|
+
) -> Tuple[cloud_sql_resources.Operation, Sequence[Tuple[str, Union[str, bytes]]]]:
|
|
339
|
+
"""Post-rpc interceptor for update_backup
|
|
340
|
+
|
|
341
|
+
Override in a subclass to read or manipulate the response or metadata after it
|
|
342
|
+
is returned by the SqlBackupsService server but before it is returned to user code.
|
|
343
|
+
|
|
344
|
+
We recommend only using this `post_update_backup_with_metadata`
|
|
345
|
+
interceptor in new development instead of the `post_update_backup` interceptor.
|
|
346
|
+
When both interceptors are used, this `post_update_backup_with_metadata` interceptor runs after the
|
|
347
|
+
`post_update_backup` interceptor. The (possibly modified) response returned by
|
|
348
|
+
`post_update_backup` will be passed to
|
|
349
|
+
`post_update_backup_with_metadata`.
|
|
350
|
+
"""
|
|
351
|
+
return response, metadata
|
|
352
|
+
|
|
353
|
+
|
|
354
|
+
@dataclasses.dataclass
|
|
355
|
+
class SqlBackupsServiceRestStub:
|
|
356
|
+
_session: AuthorizedSession
|
|
357
|
+
_host: str
|
|
358
|
+
_interceptor: SqlBackupsServiceRestInterceptor
|
|
359
|
+
|
|
360
|
+
|
|
361
|
+
class SqlBackupsServiceRestTransport(_BaseSqlBackupsServiceRestTransport):
|
|
362
|
+
"""REST backend synchronous transport for SqlBackupsService.
|
|
363
|
+
|
|
364
|
+
This class defines the same methods as the primary client, so the
|
|
365
|
+
primary client can load the underlying transport implementation
|
|
366
|
+
and call it.
|
|
367
|
+
|
|
368
|
+
It sends JSON representations of protocol buffers over HTTP/1.1
|
|
369
|
+
"""
|
|
370
|
+
|
|
371
|
+
def __init__(
|
|
372
|
+
self,
|
|
373
|
+
*,
|
|
374
|
+
host: str = "sqladmin.googleapis.com",
|
|
375
|
+
credentials: Optional[ga_credentials.Credentials] = None,
|
|
376
|
+
credentials_file: Optional[str] = None,
|
|
377
|
+
scopes: Optional[Sequence[str]] = None,
|
|
378
|
+
client_cert_source_for_mtls: Optional[Callable[[], Tuple[bytes, bytes]]] = None,
|
|
379
|
+
quota_project_id: Optional[str] = None,
|
|
380
|
+
client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
|
|
381
|
+
always_use_jwt_access: Optional[bool] = False,
|
|
382
|
+
url_scheme: str = "https",
|
|
383
|
+
interceptor: Optional[SqlBackupsServiceRestInterceptor] = None,
|
|
384
|
+
api_audience: Optional[str] = None,
|
|
385
|
+
) -> None:
|
|
386
|
+
"""Instantiate the transport.
|
|
387
|
+
|
|
388
|
+
Args:
|
|
389
|
+
host (Optional[str]):
|
|
390
|
+
The hostname to connect to (default: 'sqladmin.googleapis.com').
|
|
391
|
+
credentials (Optional[google.auth.credentials.Credentials]): The
|
|
392
|
+
authorization credentials to attach to requests. These
|
|
393
|
+
credentials identify the application to the service; if none
|
|
394
|
+
are specified, the client will attempt to ascertain the
|
|
395
|
+
credentials from the environment.
|
|
396
|
+
|
|
397
|
+
credentials_file (Optional[str]): Deprecated. A file with credentials that can
|
|
398
|
+
be loaded with :func:`google.auth.load_credentials_from_file`.
|
|
399
|
+
This argument is ignored if ``channel`` is provided. This argument will be
|
|
400
|
+
removed in the next major version of this library.
|
|
401
|
+
scopes (Optional(Sequence[str])): A list of scopes. This argument is
|
|
402
|
+
ignored if ``channel`` is provided.
|
|
403
|
+
client_cert_source_for_mtls (Callable[[], Tuple[bytes, bytes]]): Client
|
|
404
|
+
certificate to configure mutual TLS HTTP channel. It is ignored
|
|
405
|
+
if ``channel`` is provided.
|
|
406
|
+
quota_project_id (Optional[str]): An optional project to use for billing
|
|
407
|
+
and quota.
|
|
408
|
+
client_info (google.api_core.gapic_v1.client_info.ClientInfo):
|
|
409
|
+
The client info used to send a user-agent string along with
|
|
410
|
+
API requests. If ``None``, then default info will be used.
|
|
411
|
+
Generally, you only need to set this if you are developing
|
|
412
|
+
your own client library.
|
|
413
|
+
always_use_jwt_access (Optional[bool]): Whether self signed JWT should
|
|
414
|
+
be used for service account credentials.
|
|
415
|
+
url_scheme: the protocol scheme for the API endpoint. Normally
|
|
416
|
+
"https", but for testing or local servers,
|
|
417
|
+
"http" can be specified.
|
|
418
|
+
interceptor (Optional[SqlBackupsServiceRestInterceptor]): Interceptor used
|
|
419
|
+
to manipulate requests, request metadata, and responses.
|
|
420
|
+
api_audience (Optional[str]): The intended audience for the API calls
|
|
421
|
+
to the service that will be set when using certain 3rd party
|
|
422
|
+
authentication flows. Audience is typically a resource identifier.
|
|
423
|
+
If not set, the host value will be used as a default.
|
|
424
|
+
"""
|
|
425
|
+
# Run the base constructor
|
|
426
|
+
# TODO(yon-mg): resolve other ctor params i.e. scopes, quota, etc.
|
|
427
|
+
# TODO: When custom host (api_endpoint) is set, `scopes` must *also* be set on the
|
|
428
|
+
# credentials object
|
|
429
|
+
super().__init__(
|
|
430
|
+
host=host,
|
|
431
|
+
credentials=credentials,
|
|
432
|
+
client_info=client_info,
|
|
433
|
+
always_use_jwt_access=always_use_jwt_access,
|
|
434
|
+
url_scheme=url_scheme,
|
|
435
|
+
api_audience=api_audience,
|
|
436
|
+
)
|
|
437
|
+
self._session = AuthorizedSession(
|
|
438
|
+
self._credentials, default_host=self.DEFAULT_HOST
|
|
439
|
+
)
|
|
440
|
+
if client_cert_source_for_mtls:
|
|
441
|
+
self._session.configure_mtls_channel(client_cert_source_for_mtls)
|
|
442
|
+
self._interceptor = interceptor or SqlBackupsServiceRestInterceptor()
|
|
443
|
+
self._prep_wrapped_messages(client_info)
|
|
444
|
+
|
|
445
|
+
class _CreateBackup(
|
|
446
|
+
_BaseSqlBackupsServiceRestTransport._BaseCreateBackup, SqlBackupsServiceRestStub
|
|
447
|
+
):
|
|
448
|
+
def __hash__(self):
|
|
449
|
+
return hash("SqlBackupsServiceRestTransport.CreateBackup")
|
|
450
|
+
|
|
451
|
+
@staticmethod
|
|
452
|
+
def _get_response(
|
|
453
|
+
host,
|
|
454
|
+
metadata,
|
|
455
|
+
query_params,
|
|
456
|
+
session,
|
|
457
|
+
timeout,
|
|
458
|
+
transcoded_request,
|
|
459
|
+
body=None,
|
|
460
|
+
):
|
|
461
|
+
uri = transcoded_request["uri"]
|
|
462
|
+
method = transcoded_request["method"]
|
|
463
|
+
headers = dict(metadata)
|
|
464
|
+
headers["Content-Type"] = "application/json"
|
|
465
|
+
response = getattr(session, method)(
|
|
466
|
+
"{host}{uri}".format(host=host, uri=uri),
|
|
467
|
+
timeout=timeout,
|
|
468
|
+
headers=headers,
|
|
469
|
+
params=rest_helpers.flatten_query_params(query_params, strict=True),
|
|
470
|
+
data=body,
|
|
471
|
+
)
|
|
472
|
+
return response
|
|
473
|
+
|
|
474
|
+
def __call__(
|
|
475
|
+
self,
|
|
476
|
+
request: cloud_sql.CreateBackupRequest,
|
|
477
|
+
*,
|
|
478
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
479
|
+
timeout: Optional[float] = None,
|
|
480
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
481
|
+
) -> cloud_sql_resources.Operation:
|
|
482
|
+
r"""Call the create backup method over HTTP.
|
|
483
|
+
|
|
484
|
+
Args:
|
|
485
|
+
request (~.cloud_sql.CreateBackupRequest):
|
|
486
|
+
The request object. The request payload to create the
|
|
487
|
+
backup
|
|
488
|
+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
|
|
489
|
+
should be retried.
|
|
490
|
+
timeout (float): The timeout for this request.
|
|
491
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
492
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
493
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
494
|
+
be of type `bytes`.
|
|
495
|
+
|
|
496
|
+
Returns:
|
|
497
|
+
~.cloud_sql_resources.Operation:
|
|
498
|
+
An Operation resource. For
|
|
499
|
+
successful operations that return an
|
|
500
|
+
Operation resource, only the fields
|
|
501
|
+
relevant to the operation are populated
|
|
502
|
+
in the resource.
|
|
503
|
+
|
|
504
|
+
"""
|
|
505
|
+
|
|
506
|
+
http_options = _BaseSqlBackupsServiceRestTransport._BaseCreateBackup._get_http_options()
|
|
507
|
+
request, metadata = self._interceptor.pre_create_backup(request, metadata)
|
|
508
|
+
transcoded_request, body, query_params = transcode_request(
|
|
509
|
+
http_options,
|
|
510
|
+
request,
|
|
511
|
+
required_fields_default_values=getattr(
|
|
512
|
+
_BaseSqlBackupsServiceRestTransport._BaseCreateBackup,
|
|
513
|
+
"_BaseCreateBackup__REQUIRED_FIELDS_DEFAULT_VALUES",
|
|
514
|
+
None,
|
|
515
|
+
),
|
|
516
|
+
rest_numeric_enums=True,
|
|
517
|
+
)
|
|
518
|
+
|
|
519
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
520
|
+
logging.DEBUG
|
|
521
|
+
): # pragma: NO COVER
|
|
522
|
+
request_url = "{host}{uri}".format(
|
|
523
|
+
host=self._host, uri=transcoded_request["uri"]
|
|
524
|
+
)
|
|
525
|
+
method = transcoded_request["method"]
|
|
526
|
+
try:
|
|
527
|
+
request_payload = type(request).to_json(request)
|
|
528
|
+
except:
|
|
529
|
+
request_payload = None
|
|
530
|
+
http_request = {
|
|
531
|
+
"payload": request_payload,
|
|
532
|
+
"requestMethod": method,
|
|
533
|
+
"requestUrl": request_url,
|
|
534
|
+
"headers": dict(metadata),
|
|
535
|
+
}
|
|
536
|
+
_LOGGER.debug(
|
|
537
|
+
f"Sending request for google.cloud.sql_v1beta4.SqlBackupsServiceClient.CreateBackup",
|
|
538
|
+
extra={
|
|
539
|
+
"serviceName": "google.cloud.sql.v1beta4.SqlBackupsService",
|
|
540
|
+
"rpcName": "CreateBackup",
|
|
541
|
+
"httpRequest": http_request,
|
|
542
|
+
"metadata": http_request["headers"],
|
|
543
|
+
},
|
|
544
|
+
)
|
|
545
|
+
|
|
546
|
+
# Send the request
|
|
547
|
+
response = SqlBackupsServiceRestTransport._CreateBackup._get_response(
|
|
548
|
+
self._host,
|
|
549
|
+
metadata,
|
|
550
|
+
query_params,
|
|
551
|
+
self._session,
|
|
552
|
+
timeout,
|
|
553
|
+
transcoded_request,
|
|
554
|
+
body,
|
|
555
|
+
)
|
|
556
|
+
|
|
557
|
+
# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
|
|
558
|
+
# subclass.
|
|
559
|
+
if response.status_code >= 400:
|
|
560
|
+
raise core_exceptions.from_http_response(response)
|
|
561
|
+
|
|
562
|
+
# Return the response
|
|
563
|
+
resp = cloud_sql_resources.Operation()
|
|
564
|
+
pb_resp = cloud_sql_resources.Operation.pb(resp)
|
|
565
|
+
|
|
566
|
+
json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
|
|
567
|
+
|
|
568
|
+
resp = self._interceptor.post_create_backup(resp)
|
|
569
|
+
response_metadata = [(k, str(v)) for k, v in response.headers.items()]
|
|
570
|
+
resp, _ = self._interceptor.post_create_backup_with_metadata(
|
|
571
|
+
resp, response_metadata
|
|
572
|
+
)
|
|
573
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
574
|
+
logging.DEBUG
|
|
575
|
+
): # pragma: NO COVER
|
|
576
|
+
try:
|
|
577
|
+
response_payload = cloud_sql_resources.Operation.to_json(response)
|
|
578
|
+
except:
|
|
579
|
+
response_payload = None
|
|
580
|
+
http_response = {
|
|
581
|
+
"payload": response_payload,
|
|
582
|
+
"headers": dict(response.headers),
|
|
583
|
+
"status": response.status_code,
|
|
584
|
+
}
|
|
585
|
+
_LOGGER.debug(
|
|
586
|
+
"Received response for google.cloud.sql_v1beta4.SqlBackupsServiceClient.create_backup",
|
|
587
|
+
extra={
|
|
588
|
+
"serviceName": "google.cloud.sql.v1beta4.SqlBackupsService",
|
|
589
|
+
"rpcName": "CreateBackup",
|
|
590
|
+
"metadata": http_response["headers"],
|
|
591
|
+
"httpResponse": http_response,
|
|
592
|
+
},
|
|
593
|
+
)
|
|
594
|
+
return resp
|
|
595
|
+
|
|
596
|
+
class _DeleteBackup(
|
|
597
|
+
_BaseSqlBackupsServiceRestTransport._BaseDeleteBackup, SqlBackupsServiceRestStub
|
|
598
|
+
):
|
|
599
|
+
def __hash__(self):
|
|
600
|
+
return hash("SqlBackupsServiceRestTransport.DeleteBackup")
|
|
601
|
+
|
|
602
|
+
@staticmethod
|
|
603
|
+
def _get_response(
|
|
604
|
+
host,
|
|
605
|
+
metadata,
|
|
606
|
+
query_params,
|
|
607
|
+
session,
|
|
608
|
+
timeout,
|
|
609
|
+
transcoded_request,
|
|
610
|
+
body=None,
|
|
611
|
+
):
|
|
612
|
+
uri = transcoded_request["uri"]
|
|
613
|
+
method = transcoded_request["method"]
|
|
614
|
+
headers = dict(metadata)
|
|
615
|
+
headers["Content-Type"] = "application/json"
|
|
616
|
+
response = getattr(session, method)(
|
|
617
|
+
"{host}{uri}".format(host=host, uri=uri),
|
|
618
|
+
timeout=timeout,
|
|
619
|
+
headers=headers,
|
|
620
|
+
params=rest_helpers.flatten_query_params(query_params, strict=True),
|
|
621
|
+
)
|
|
622
|
+
return response
|
|
623
|
+
|
|
624
|
+
def __call__(
|
|
625
|
+
self,
|
|
626
|
+
request: cloud_sql.DeleteBackupRequest,
|
|
627
|
+
*,
|
|
628
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
629
|
+
timeout: Optional[float] = None,
|
|
630
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
631
|
+
) -> cloud_sql_resources.Operation:
|
|
632
|
+
r"""Call the delete backup method over HTTP.
|
|
633
|
+
|
|
634
|
+
Args:
|
|
635
|
+
request (~.cloud_sql.DeleteBackupRequest):
|
|
636
|
+
The request object. The request payload to delete the
|
|
637
|
+
backup.
|
|
638
|
+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
|
|
639
|
+
should be retried.
|
|
640
|
+
timeout (float): The timeout for this request.
|
|
641
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
642
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
643
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
644
|
+
be of type `bytes`.
|
|
645
|
+
|
|
646
|
+
Returns:
|
|
647
|
+
~.cloud_sql_resources.Operation:
|
|
648
|
+
An Operation resource. For
|
|
649
|
+
successful operations that return an
|
|
650
|
+
Operation resource, only the fields
|
|
651
|
+
relevant to the operation are populated
|
|
652
|
+
in the resource.
|
|
653
|
+
|
|
654
|
+
"""
|
|
655
|
+
|
|
656
|
+
http_options = _BaseSqlBackupsServiceRestTransport._BaseDeleteBackup._get_http_options()
|
|
657
|
+
request, metadata = self._interceptor.pre_delete_backup(request, metadata)
|
|
658
|
+
transcoded_request, body, query_params = transcode_request(
|
|
659
|
+
http_options,
|
|
660
|
+
request,
|
|
661
|
+
required_fields_default_values=getattr(
|
|
662
|
+
_BaseSqlBackupsServiceRestTransport._BaseDeleteBackup,
|
|
663
|
+
"_BaseDeleteBackup__REQUIRED_FIELDS_DEFAULT_VALUES",
|
|
664
|
+
None,
|
|
665
|
+
),
|
|
666
|
+
rest_numeric_enums=True,
|
|
667
|
+
)
|
|
668
|
+
|
|
669
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
670
|
+
logging.DEBUG
|
|
671
|
+
): # pragma: NO COVER
|
|
672
|
+
request_url = "{host}{uri}".format(
|
|
673
|
+
host=self._host, uri=transcoded_request["uri"]
|
|
674
|
+
)
|
|
675
|
+
method = transcoded_request["method"]
|
|
676
|
+
try:
|
|
677
|
+
request_payload = type(request).to_json(request)
|
|
678
|
+
except:
|
|
679
|
+
request_payload = None
|
|
680
|
+
http_request = {
|
|
681
|
+
"payload": request_payload,
|
|
682
|
+
"requestMethod": method,
|
|
683
|
+
"requestUrl": request_url,
|
|
684
|
+
"headers": dict(metadata),
|
|
685
|
+
}
|
|
686
|
+
_LOGGER.debug(
|
|
687
|
+
f"Sending request for google.cloud.sql_v1beta4.SqlBackupsServiceClient.DeleteBackup",
|
|
688
|
+
extra={
|
|
689
|
+
"serviceName": "google.cloud.sql.v1beta4.SqlBackupsService",
|
|
690
|
+
"rpcName": "DeleteBackup",
|
|
691
|
+
"httpRequest": http_request,
|
|
692
|
+
"metadata": http_request["headers"],
|
|
693
|
+
},
|
|
694
|
+
)
|
|
695
|
+
|
|
696
|
+
# Send the request
|
|
697
|
+
response = SqlBackupsServiceRestTransport._DeleteBackup._get_response(
|
|
698
|
+
self._host,
|
|
699
|
+
metadata,
|
|
700
|
+
query_params,
|
|
701
|
+
self._session,
|
|
702
|
+
timeout,
|
|
703
|
+
transcoded_request,
|
|
704
|
+
)
|
|
705
|
+
|
|
706
|
+
# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
|
|
707
|
+
# subclass.
|
|
708
|
+
if response.status_code >= 400:
|
|
709
|
+
raise core_exceptions.from_http_response(response)
|
|
710
|
+
|
|
711
|
+
# Return the response
|
|
712
|
+
resp = cloud_sql_resources.Operation()
|
|
713
|
+
pb_resp = cloud_sql_resources.Operation.pb(resp)
|
|
714
|
+
|
|
715
|
+
json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
|
|
716
|
+
|
|
717
|
+
resp = self._interceptor.post_delete_backup(resp)
|
|
718
|
+
response_metadata = [(k, str(v)) for k, v in response.headers.items()]
|
|
719
|
+
resp, _ = self._interceptor.post_delete_backup_with_metadata(
|
|
720
|
+
resp, response_metadata
|
|
721
|
+
)
|
|
722
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
723
|
+
logging.DEBUG
|
|
724
|
+
): # pragma: NO COVER
|
|
725
|
+
try:
|
|
726
|
+
response_payload = cloud_sql_resources.Operation.to_json(response)
|
|
727
|
+
except:
|
|
728
|
+
response_payload = None
|
|
729
|
+
http_response = {
|
|
730
|
+
"payload": response_payload,
|
|
731
|
+
"headers": dict(response.headers),
|
|
732
|
+
"status": response.status_code,
|
|
733
|
+
}
|
|
734
|
+
_LOGGER.debug(
|
|
735
|
+
"Received response for google.cloud.sql_v1beta4.SqlBackupsServiceClient.delete_backup",
|
|
736
|
+
extra={
|
|
737
|
+
"serviceName": "google.cloud.sql.v1beta4.SqlBackupsService",
|
|
738
|
+
"rpcName": "DeleteBackup",
|
|
739
|
+
"metadata": http_response["headers"],
|
|
740
|
+
"httpResponse": http_response,
|
|
741
|
+
},
|
|
742
|
+
)
|
|
743
|
+
return resp
|
|
744
|
+
|
|
745
|
+
class _GetBackup(
|
|
746
|
+
_BaseSqlBackupsServiceRestTransport._BaseGetBackup, SqlBackupsServiceRestStub
|
|
747
|
+
):
|
|
748
|
+
def __hash__(self):
|
|
749
|
+
return hash("SqlBackupsServiceRestTransport.GetBackup")
|
|
750
|
+
|
|
751
|
+
@staticmethod
|
|
752
|
+
def _get_response(
|
|
753
|
+
host,
|
|
754
|
+
metadata,
|
|
755
|
+
query_params,
|
|
756
|
+
session,
|
|
757
|
+
timeout,
|
|
758
|
+
transcoded_request,
|
|
759
|
+
body=None,
|
|
760
|
+
):
|
|
761
|
+
uri = transcoded_request["uri"]
|
|
762
|
+
method = transcoded_request["method"]
|
|
763
|
+
headers = dict(metadata)
|
|
764
|
+
headers["Content-Type"] = "application/json"
|
|
765
|
+
response = getattr(session, method)(
|
|
766
|
+
"{host}{uri}".format(host=host, uri=uri),
|
|
767
|
+
timeout=timeout,
|
|
768
|
+
headers=headers,
|
|
769
|
+
params=rest_helpers.flatten_query_params(query_params, strict=True),
|
|
770
|
+
)
|
|
771
|
+
return response
|
|
772
|
+
|
|
773
|
+
def __call__(
|
|
774
|
+
self,
|
|
775
|
+
request: cloud_sql.GetBackupRequest,
|
|
776
|
+
*,
|
|
777
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
778
|
+
timeout: Optional[float] = None,
|
|
779
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
780
|
+
) -> cloud_sql_resources.Backup:
|
|
781
|
+
r"""Call the get backup method over HTTP.
|
|
782
|
+
|
|
783
|
+
Args:
|
|
784
|
+
request (~.cloud_sql.GetBackupRequest):
|
|
785
|
+
The request object. The request payload to get the
|
|
786
|
+
backup.
|
|
787
|
+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
|
|
788
|
+
should be retried.
|
|
789
|
+
timeout (float): The timeout for this request.
|
|
790
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
791
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
792
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
793
|
+
be of type `bytes`.
|
|
794
|
+
|
|
795
|
+
Returns:
|
|
796
|
+
~.cloud_sql_resources.Backup:
|
|
797
|
+
A backup resource.
|
|
798
|
+
"""
|
|
799
|
+
|
|
800
|
+
http_options = (
|
|
801
|
+
_BaseSqlBackupsServiceRestTransport._BaseGetBackup._get_http_options()
|
|
802
|
+
)
|
|
803
|
+
request, metadata = self._interceptor.pre_get_backup(request, metadata)
|
|
804
|
+
transcoded_request, body, query_params = transcode_request(
|
|
805
|
+
http_options,
|
|
806
|
+
request,
|
|
807
|
+
required_fields_default_values=getattr(
|
|
808
|
+
_BaseSqlBackupsServiceRestTransport._BaseGetBackup,
|
|
809
|
+
"_BaseGetBackup__REQUIRED_FIELDS_DEFAULT_VALUES",
|
|
810
|
+
None,
|
|
811
|
+
),
|
|
812
|
+
rest_numeric_enums=True,
|
|
813
|
+
)
|
|
814
|
+
|
|
815
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
816
|
+
logging.DEBUG
|
|
817
|
+
): # pragma: NO COVER
|
|
818
|
+
request_url = "{host}{uri}".format(
|
|
819
|
+
host=self._host, uri=transcoded_request["uri"]
|
|
820
|
+
)
|
|
821
|
+
method = transcoded_request["method"]
|
|
822
|
+
try:
|
|
823
|
+
request_payload = type(request).to_json(request)
|
|
824
|
+
except:
|
|
825
|
+
request_payload = None
|
|
826
|
+
http_request = {
|
|
827
|
+
"payload": request_payload,
|
|
828
|
+
"requestMethod": method,
|
|
829
|
+
"requestUrl": request_url,
|
|
830
|
+
"headers": dict(metadata),
|
|
831
|
+
}
|
|
832
|
+
_LOGGER.debug(
|
|
833
|
+
f"Sending request for google.cloud.sql_v1beta4.SqlBackupsServiceClient.GetBackup",
|
|
834
|
+
extra={
|
|
835
|
+
"serviceName": "google.cloud.sql.v1beta4.SqlBackupsService",
|
|
836
|
+
"rpcName": "GetBackup",
|
|
837
|
+
"httpRequest": http_request,
|
|
838
|
+
"metadata": http_request["headers"],
|
|
839
|
+
},
|
|
840
|
+
)
|
|
841
|
+
|
|
842
|
+
# Send the request
|
|
843
|
+
response = SqlBackupsServiceRestTransport._GetBackup._get_response(
|
|
844
|
+
self._host,
|
|
845
|
+
metadata,
|
|
846
|
+
query_params,
|
|
847
|
+
self._session,
|
|
848
|
+
timeout,
|
|
849
|
+
transcoded_request,
|
|
850
|
+
)
|
|
851
|
+
|
|
852
|
+
# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
|
|
853
|
+
# subclass.
|
|
854
|
+
if response.status_code >= 400:
|
|
855
|
+
raise core_exceptions.from_http_response(response)
|
|
856
|
+
|
|
857
|
+
# Return the response
|
|
858
|
+
resp = cloud_sql_resources.Backup()
|
|
859
|
+
pb_resp = cloud_sql_resources.Backup.pb(resp)
|
|
860
|
+
|
|
861
|
+
json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
|
|
862
|
+
|
|
863
|
+
resp = self._interceptor.post_get_backup(resp)
|
|
864
|
+
response_metadata = [(k, str(v)) for k, v in response.headers.items()]
|
|
865
|
+
resp, _ = self._interceptor.post_get_backup_with_metadata(
|
|
866
|
+
resp, response_metadata
|
|
867
|
+
)
|
|
868
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
869
|
+
logging.DEBUG
|
|
870
|
+
): # pragma: NO COVER
|
|
871
|
+
try:
|
|
872
|
+
response_payload = cloud_sql_resources.Backup.to_json(response)
|
|
873
|
+
except:
|
|
874
|
+
response_payload = None
|
|
875
|
+
http_response = {
|
|
876
|
+
"payload": response_payload,
|
|
877
|
+
"headers": dict(response.headers),
|
|
878
|
+
"status": response.status_code,
|
|
879
|
+
}
|
|
880
|
+
_LOGGER.debug(
|
|
881
|
+
"Received response for google.cloud.sql_v1beta4.SqlBackupsServiceClient.get_backup",
|
|
882
|
+
extra={
|
|
883
|
+
"serviceName": "google.cloud.sql.v1beta4.SqlBackupsService",
|
|
884
|
+
"rpcName": "GetBackup",
|
|
885
|
+
"metadata": http_response["headers"],
|
|
886
|
+
"httpResponse": http_response,
|
|
887
|
+
},
|
|
888
|
+
)
|
|
889
|
+
return resp
|
|
890
|
+
|
|
891
|
+
class _ListBackups(
|
|
892
|
+
_BaseSqlBackupsServiceRestTransport._BaseListBackups, SqlBackupsServiceRestStub
|
|
893
|
+
):
|
|
894
|
+
def __hash__(self):
|
|
895
|
+
return hash("SqlBackupsServiceRestTransport.ListBackups")
|
|
896
|
+
|
|
897
|
+
@staticmethod
|
|
898
|
+
def _get_response(
|
|
899
|
+
host,
|
|
900
|
+
metadata,
|
|
901
|
+
query_params,
|
|
902
|
+
session,
|
|
903
|
+
timeout,
|
|
904
|
+
transcoded_request,
|
|
905
|
+
body=None,
|
|
906
|
+
):
|
|
907
|
+
uri = transcoded_request["uri"]
|
|
908
|
+
method = transcoded_request["method"]
|
|
909
|
+
headers = dict(metadata)
|
|
910
|
+
headers["Content-Type"] = "application/json"
|
|
911
|
+
response = getattr(session, method)(
|
|
912
|
+
"{host}{uri}".format(host=host, uri=uri),
|
|
913
|
+
timeout=timeout,
|
|
914
|
+
headers=headers,
|
|
915
|
+
params=rest_helpers.flatten_query_params(query_params, strict=True),
|
|
916
|
+
)
|
|
917
|
+
return response
|
|
918
|
+
|
|
919
|
+
def __call__(
|
|
920
|
+
self,
|
|
921
|
+
request: cloud_sql.ListBackupsRequest,
|
|
922
|
+
*,
|
|
923
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
924
|
+
timeout: Optional[float] = None,
|
|
925
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
926
|
+
) -> cloud_sql.ListBackupsResponse:
|
|
927
|
+
r"""Call the list backups method over HTTP.
|
|
928
|
+
|
|
929
|
+
Args:
|
|
930
|
+
request (~.cloud_sql.ListBackupsRequest):
|
|
931
|
+
The request object. The request payload to list the
|
|
932
|
+
backups.
|
|
933
|
+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
|
|
934
|
+
should be retried.
|
|
935
|
+
timeout (float): The timeout for this request.
|
|
936
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
937
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
938
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
939
|
+
be of type `bytes`.
|
|
940
|
+
|
|
941
|
+
Returns:
|
|
942
|
+
~.cloud_sql.ListBackupsResponse:
|
|
943
|
+
The response payload containing a
|
|
944
|
+
list of the backups.
|
|
945
|
+
|
|
946
|
+
"""
|
|
947
|
+
|
|
948
|
+
http_options = (
|
|
949
|
+
_BaseSqlBackupsServiceRestTransport._BaseListBackups._get_http_options()
|
|
950
|
+
)
|
|
951
|
+
request, metadata = self._interceptor.pre_list_backups(request, metadata)
|
|
952
|
+
transcoded_request, body, query_params = transcode_request(
|
|
953
|
+
http_options,
|
|
954
|
+
request,
|
|
955
|
+
required_fields_default_values=getattr(
|
|
956
|
+
_BaseSqlBackupsServiceRestTransport._BaseListBackups,
|
|
957
|
+
"_BaseListBackups__REQUIRED_FIELDS_DEFAULT_VALUES",
|
|
958
|
+
None,
|
|
959
|
+
),
|
|
960
|
+
rest_numeric_enums=True,
|
|
961
|
+
)
|
|
962
|
+
|
|
963
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
964
|
+
logging.DEBUG
|
|
965
|
+
): # pragma: NO COVER
|
|
966
|
+
request_url = "{host}{uri}".format(
|
|
967
|
+
host=self._host, uri=transcoded_request["uri"]
|
|
968
|
+
)
|
|
969
|
+
method = transcoded_request["method"]
|
|
970
|
+
try:
|
|
971
|
+
request_payload = type(request).to_json(request)
|
|
972
|
+
except:
|
|
973
|
+
request_payload = None
|
|
974
|
+
http_request = {
|
|
975
|
+
"payload": request_payload,
|
|
976
|
+
"requestMethod": method,
|
|
977
|
+
"requestUrl": request_url,
|
|
978
|
+
"headers": dict(metadata),
|
|
979
|
+
}
|
|
980
|
+
_LOGGER.debug(
|
|
981
|
+
f"Sending request for google.cloud.sql_v1beta4.SqlBackupsServiceClient.ListBackups",
|
|
982
|
+
extra={
|
|
983
|
+
"serviceName": "google.cloud.sql.v1beta4.SqlBackupsService",
|
|
984
|
+
"rpcName": "ListBackups",
|
|
985
|
+
"httpRequest": http_request,
|
|
986
|
+
"metadata": http_request["headers"],
|
|
987
|
+
},
|
|
988
|
+
)
|
|
989
|
+
|
|
990
|
+
# Send the request
|
|
991
|
+
response = SqlBackupsServiceRestTransport._ListBackups._get_response(
|
|
992
|
+
self._host,
|
|
993
|
+
metadata,
|
|
994
|
+
query_params,
|
|
995
|
+
self._session,
|
|
996
|
+
timeout,
|
|
997
|
+
transcoded_request,
|
|
998
|
+
)
|
|
999
|
+
|
|
1000
|
+
# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
|
|
1001
|
+
# subclass.
|
|
1002
|
+
if response.status_code >= 400:
|
|
1003
|
+
raise core_exceptions.from_http_response(response)
|
|
1004
|
+
|
|
1005
|
+
# Return the response
|
|
1006
|
+
resp = cloud_sql.ListBackupsResponse()
|
|
1007
|
+
pb_resp = cloud_sql.ListBackupsResponse.pb(resp)
|
|
1008
|
+
|
|
1009
|
+
json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
|
|
1010
|
+
|
|
1011
|
+
resp = self._interceptor.post_list_backups(resp)
|
|
1012
|
+
response_metadata = [(k, str(v)) for k, v in response.headers.items()]
|
|
1013
|
+
resp, _ = self._interceptor.post_list_backups_with_metadata(
|
|
1014
|
+
resp, response_metadata
|
|
1015
|
+
)
|
|
1016
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
1017
|
+
logging.DEBUG
|
|
1018
|
+
): # pragma: NO COVER
|
|
1019
|
+
try:
|
|
1020
|
+
response_payload = cloud_sql.ListBackupsResponse.to_json(response)
|
|
1021
|
+
except:
|
|
1022
|
+
response_payload = None
|
|
1023
|
+
http_response = {
|
|
1024
|
+
"payload": response_payload,
|
|
1025
|
+
"headers": dict(response.headers),
|
|
1026
|
+
"status": response.status_code,
|
|
1027
|
+
}
|
|
1028
|
+
_LOGGER.debug(
|
|
1029
|
+
"Received response for google.cloud.sql_v1beta4.SqlBackupsServiceClient.list_backups",
|
|
1030
|
+
extra={
|
|
1031
|
+
"serviceName": "google.cloud.sql.v1beta4.SqlBackupsService",
|
|
1032
|
+
"rpcName": "ListBackups",
|
|
1033
|
+
"metadata": http_response["headers"],
|
|
1034
|
+
"httpResponse": http_response,
|
|
1035
|
+
},
|
|
1036
|
+
)
|
|
1037
|
+
return resp
|
|
1038
|
+
|
|
1039
|
+
class _UpdateBackup(
|
|
1040
|
+
_BaseSqlBackupsServiceRestTransport._BaseUpdateBackup, SqlBackupsServiceRestStub
|
|
1041
|
+
):
|
|
1042
|
+
def __hash__(self):
|
|
1043
|
+
return hash("SqlBackupsServiceRestTransport.UpdateBackup")
|
|
1044
|
+
|
|
1045
|
+
@staticmethod
|
|
1046
|
+
def _get_response(
|
|
1047
|
+
host,
|
|
1048
|
+
metadata,
|
|
1049
|
+
query_params,
|
|
1050
|
+
session,
|
|
1051
|
+
timeout,
|
|
1052
|
+
transcoded_request,
|
|
1053
|
+
body=None,
|
|
1054
|
+
):
|
|
1055
|
+
uri = transcoded_request["uri"]
|
|
1056
|
+
method = transcoded_request["method"]
|
|
1057
|
+
headers = dict(metadata)
|
|
1058
|
+
headers["Content-Type"] = "application/json"
|
|
1059
|
+
response = getattr(session, method)(
|
|
1060
|
+
"{host}{uri}".format(host=host, uri=uri),
|
|
1061
|
+
timeout=timeout,
|
|
1062
|
+
headers=headers,
|
|
1063
|
+
params=rest_helpers.flatten_query_params(query_params, strict=True),
|
|
1064
|
+
data=body,
|
|
1065
|
+
)
|
|
1066
|
+
return response
|
|
1067
|
+
|
|
1068
|
+
def __call__(
|
|
1069
|
+
self,
|
|
1070
|
+
request: cloud_sql.UpdateBackupRequest,
|
|
1071
|
+
*,
|
|
1072
|
+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
|
|
1073
|
+
timeout: Optional[float] = None,
|
|
1074
|
+
metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
|
|
1075
|
+
) -> cloud_sql_resources.Operation:
|
|
1076
|
+
r"""Call the update backup method over HTTP.
|
|
1077
|
+
|
|
1078
|
+
Args:
|
|
1079
|
+
request (~.cloud_sql.UpdateBackupRequest):
|
|
1080
|
+
The request object. The request payload to update the
|
|
1081
|
+
backup.
|
|
1082
|
+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
|
|
1083
|
+
should be retried.
|
|
1084
|
+
timeout (float): The timeout for this request.
|
|
1085
|
+
metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
|
|
1086
|
+
sent along with the request as metadata. Normally, each value must be of type `str`,
|
|
1087
|
+
but for metadata keys ending with the suffix `-bin`, the corresponding values must
|
|
1088
|
+
be of type `bytes`.
|
|
1089
|
+
|
|
1090
|
+
Returns:
|
|
1091
|
+
~.cloud_sql_resources.Operation:
|
|
1092
|
+
An Operation resource. For
|
|
1093
|
+
successful operations that return an
|
|
1094
|
+
Operation resource, only the fields
|
|
1095
|
+
relevant to the operation are populated
|
|
1096
|
+
in the resource.
|
|
1097
|
+
|
|
1098
|
+
"""
|
|
1099
|
+
|
|
1100
|
+
http_options = _BaseSqlBackupsServiceRestTransport._BaseUpdateBackup._get_http_options()
|
|
1101
|
+
request, metadata = self._interceptor.pre_update_backup(request, metadata)
|
|
1102
|
+
transcoded_request, body, query_params = transcode_request(
|
|
1103
|
+
http_options,
|
|
1104
|
+
request,
|
|
1105
|
+
required_fields_default_values=getattr(
|
|
1106
|
+
_BaseSqlBackupsServiceRestTransport._BaseUpdateBackup,
|
|
1107
|
+
"_BaseUpdateBackup__REQUIRED_FIELDS_DEFAULT_VALUES",
|
|
1108
|
+
None,
|
|
1109
|
+
),
|
|
1110
|
+
rest_numeric_enums=True,
|
|
1111
|
+
)
|
|
1112
|
+
|
|
1113
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
1114
|
+
logging.DEBUG
|
|
1115
|
+
): # pragma: NO COVER
|
|
1116
|
+
request_url = "{host}{uri}".format(
|
|
1117
|
+
host=self._host, uri=transcoded_request["uri"]
|
|
1118
|
+
)
|
|
1119
|
+
method = transcoded_request["method"]
|
|
1120
|
+
try:
|
|
1121
|
+
request_payload = type(request).to_json(request)
|
|
1122
|
+
except:
|
|
1123
|
+
request_payload = None
|
|
1124
|
+
http_request = {
|
|
1125
|
+
"payload": request_payload,
|
|
1126
|
+
"requestMethod": method,
|
|
1127
|
+
"requestUrl": request_url,
|
|
1128
|
+
"headers": dict(metadata),
|
|
1129
|
+
}
|
|
1130
|
+
_LOGGER.debug(
|
|
1131
|
+
f"Sending request for google.cloud.sql_v1beta4.SqlBackupsServiceClient.UpdateBackup",
|
|
1132
|
+
extra={
|
|
1133
|
+
"serviceName": "google.cloud.sql.v1beta4.SqlBackupsService",
|
|
1134
|
+
"rpcName": "UpdateBackup",
|
|
1135
|
+
"httpRequest": http_request,
|
|
1136
|
+
"metadata": http_request["headers"],
|
|
1137
|
+
},
|
|
1138
|
+
)
|
|
1139
|
+
|
|
1140
|
+
# Send the request
|
|
1141
|
+
response = SqlBackupsServiceRestTransport._UpdateBackup._get_response(
|
|
1142
|
+
self._host,
|
|
1143
|
+
metadata,
|
|
1144
|
+
query_params,
|
|
1145
|
+
self._session,
|
|
1146
|
+
timeout,
|
|
1147
|
+
transcoded_request,
|
|
1148
|
+
body,
|
|
1149
|
+
)
|
|
1150
|
+
|
|
1151
|
+
# In case of error, raise the appropriate core_exceptions.GoogleAPICallError exception
|
|
1152
|
+
# subclass.
|
|
1153
|
+
if response.status_code >= 400:
|
|
1154
|
+
raise core_exceptions.from_http_response(response)
|
|
1155
|
+
|
|
1156
|
+
# Return the response
|
|
1157
|
+
resp = cloud_sql_resources.Operation()
|
|
1158
|
+
pb_resp = cloud_sql_resources.Operation.pb(resp)
|
|
1159
|
+
|
|
1160
|
+
json_format.Parse(response.content, pb_resp, ignore_unknown_fields=True)
|
|
1161
|
+
|
|
1162
|
+
resp = self._interceptor.post_update_backup(resp)
|
|
1163
|
+
response_metadata = [(k, str(v)) for k, v in response.headers.items()]
|
|
1164
|
+
resp, _ = self._interceptor.post_update_backup_with_metadata(
|
|
1165
|
+
resp, response_metadata
|
|
1166
|
+
)
|
|
1167
|
+
if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
|
|
1168
|
+
logging.DEBUG
|
|
1169
|
+
): # pragma: NO COVER
|
|
1170
|
+
try:
|
|
1171
|
+
response_payload = cloud_sql_resources.Operation.to_json(response)
|
|
1172
|
+
except:
|
|
1173
|
+
response_payload = None
|
|
1174
|
+
http_response = {
|
|
1175
|
+
"payload": response_payload,
|
|
1176
|
+
"headers": dict(response.headers),
|
|
1177
|
+
"status": response.status_code,
|
|
1178
|
+
}
|
|
1179
|
+
_LOGGER.debug(
|
|
1180
|
+
"Received response for google.cloud.sql_v1beta4.SqlBackupsServiceClient.update_backup",
|
|
1181
|
+
extra={
|
|
1182
|
+
"serviceName": "google.cloud.sql.v1beta4.SqlBackupsService",
|
|
1183
|
+
"rpcName": "UpdateBackup",
|
|
1184
|
+
"metadata": http_response["headers"],
|
|
1185
|
+
"httpResponse": http_response,
|
|
1186
|
+
},
|
|
1187
|
+
)
|
|
1188
|
+
return resp
|
|
1189
|
+
|
|
1190
|
+
@property
|
|
1191
|
+
def create_backup(
|
|
1192
|
+
self,
|
|
1193
|
+
) -> Callable[[cloud_sql.CreateBackupRequest], cloud_sql_resources.Operation]:
|
|
1194
|
+
# The return type is fine, but mypy isn't sophisticated enough to determine what's going on here.
|
|
1195
|
+
# In C++ this would require a dynamic_cast
|
|
1196
|
+
return self._CreateBackup(self._session, self._host, self._interceptor) # type: ignore
|
|
1197
|
+
|
|
1198
|
+
@property
|
|
1199
|
+
def delete_backup(
|
|
1200
|
+
self,
|
|
1201
|
+
) -> Callable[[cloud_sql.DeleteBackupRequest], cloud_sql_resources.Operation]:
|
|
1202
|
+
# The return type is fine, but mypy isn't sophisticated enough to determine what's going on here.
|
|
1203
|
+
# In C++ this would require a dynamic_cast
|
|
1204
|
+
return self._DeleteBackup(self._session, self._host, self._interceptor) # type: ignore
|
|
1205
|
+
|
|
1206
|
+
@property
|
|
1207
|
+
def get_backup(
|
|
1208
|
+
self,
|
|
1209
|
+
) -> Callable[[cloud_sql.GetBackupRequest], cloud_sql_resources.Backup]:
|
|
1210
|
+
# The return type is fine, but mypy isn't sophisticated enough to determine what's going on here.
|
|
1211
|
+
# In C++ this would require a dynamic_cast
|
|
1212
|
+
return self._GetBackup(self._session, self._host, self._interceptor) # type: ignore
|
|
1213
|
+
|
|
1214
|
+
@property
|
|
1215
|
+
def list_backups(
|
|
1216
|
+
self,
|
|
1217
|
+
) -> Callable[[cloud_sql.ListBackupsRequest], cloud_sql.ListBackupsResponse]:
|
|
1218
|
+
# The return type is fine, but mypy isn't sophisticated enough to determine what's going on here.
|
|
1219
|
+
# In C++ this would require a dynamic_cast
|
|
1220
|
+
return self._ListBackups(self._session, self._host, self._interceptor) # type: ignore
|
|
1221
|
+
|
|
1222
|
+
@property
|
|
1223
|
+
def update_backup(
|
|
1224
|
+
self,
|
|
1225
|
+
) -> Callable[[cloud_sql.UpdateBackupRequest], cloud_sql_resources.Operation]:
|
|
1226
|
+
# The return type is fine, but mypy isn't sophisticated enough to determine what's going on here.
|
|
1227
|
+
# In C++ this would require a dynamic_cast
|
|
1228
|
+
return self._UpdateBackup(self._session, self._host, self._interceptor) # type: ignore
|
|
1229
|
+
|
|
1230
|
+
@property
|
|
1231
|
+
def kind(self) -> str:
|
|
1232
|
+
return "rest"
|
|
1233
|
+
|
|
1234
|
+
def close(self):
|
|
1235
|
+
self._session.close()
|
|
1236
|
+
|
|
1237
|
+
|
|
1238
|
+
__all__ = ("SqlBackupsServiceRestTransport",)
|