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