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.
Files changed (274) hide show
  1. google/cloud/sqladmin/__init__.py +605 -0
  2. google/cloud/sqladmin/gapic_version.py +16 -0
  3. google/cloud/sqladmin/py.typed +2 -0
  4. google/cloud/sqladmin_v1/__init__.py +616 -0
  5. google/cloud/sqladmin_v1/_compat.py +262 -0
  6. google/cloud/sqladmin_v1/gapic_metadata.json +959 -0
  7. google/cloud/sqladmin_v1/gapic_version.py +16 -0
  8. google/cloud/sqladmin_v1/py.typed +2 -0
  9. google/cloud/sqladmin_v1/services/__init__.py +15 -0
  10. google/cloud/sqladmin_v1/services/sql_available_database_versions_service/__init__.py +22 -0
  11. google/cloud/sqladmin_v1/services/sql_available_database_versions_service/async_client.py +336 -0
  12. google/cloud/sqladmin_v1/services/sql_available_database_versions_service/client.py +613 -0
  13. google/cloud/sqladmin_v1/services/sql_available_database_versions_service/transports/__init__.py +34 -0
  14. google/cloud/sqladmin_v1/services/sql_available_database_versions_service/transports/base.py +159 -0
  15. google/cloud/sqladmin_v1/services/sql_available_database_versions_service/transports/grpc.py +339 -0
  16. google/cloud/sqladmin_v1/services/sql_available_database_versions_service/transports/grpc_asyncio.py +356 -0
  17. google/cloud/sqladmin_v1/services/sql_backup_runs_service/__init__.py +22 -0
  18. google/cloud/sqladmin_v1/services/sql_backup_runs_service/async_client.py +697 -0
  19. google/cloud/sqladmin_v1/services/sql_backup_runs_service/client.py +977 -0
  20. google/cloud/sqladmin_v1/services/sql_backup_runs_service/pagers.py +199 -0
  21. google/cloud/sqladmin_v1/services/sql_backup_runs_service/transports/__init__.py +32 -0
  22. google/cloud/sqladmin_v1/services/sql_backup_runs_service/transports/base.py +225 -0
  23. google/cloud/sqladmin_v1/services/sql_backup_runs_service/transports/grpc.py +456 -0
  24. google/cloud/sqladmin_v1/services/sql_backup_runs_service/transports/grpc_asyncio.py +495 -0
  25. google/cloud/sqladmin_v1/services/sql_backups_service/__init__.py +22 -0
  26. google/cloud/sqladmin_v1/services/sql_backups_service/async_client.py +946 -0
  27. google/cloud/sqladmin_v1/services/sql_backups_service/client.py +1244 -0
  28. google/cloud/sqladmin_v1/services/sql_backups_service/pagers.py +197 -0
  29. google/cloud/sqladmin_v1/services/sql_backups_service/transports/__init__.py +32 -0
  30. google/cloud/sqladmin_v1/services/sql_backups_service/transports/base.py +237 -0
  31. google/cloud/sqladmin_v1/services/sql_backups_service/transports/grpc.py +478 -0
  32. google/cloud/sqladmin_v1/services/sql_backups_service/transports/grpc_asyncio.py +527 -0
  33. google/cloud/sqladmin_v1/services/sql_connect_service/__init__.py +22 -0
  34. google/cloud/sqladmin_v1/services/sql_connect_service/async_client.py +591 -0
  35. google/cloud/sqladmin_v1/services/sql_connect_service/client.py +867 -0
  36. google/cloud/sqladmin_v1/services/sql_connect_service/transports/__init__.py +32 -0
  37. google/cloud/sqladmin_v1/services/sql_connect_service/transports/base.py +215 -0
  38. google/cloud/sqladmin_v1/services/sql_connect_service/transports/grpc.py +430 -0
  39. google/cloud/sqladmin_v1/services/sql_connect_service/transports/grpc_asyncio.py +464 -0
  40. google/cloud/sqladmin_v1/services/sql_databases_service/__init__.py +22 -0
  41. google/cloud/sqladmin_v1/services/sql_databases_service/async_client.py +872 -0
  42. google/cloud/sqladmin_v1/services/sql_databases_service/client.py +1152 -0
  43. google/cloud/sqladmin_v1/services/sql_databases_service/transports/__init__.py +32 -0
  44. google/cloud/sqladmin_v1/services/sql_databases_service/transports/base.py +251 -0
  45. google/cloud/sqladmin_v1/services/sql_databases_service/transports/grpc.py +515 -0
  46. google/cloud/sqladmin_v1/services/sql_databases_service/transports/grpc_asyncio.py +568 -0
  47. google/cloud/sqladmin_v1/services/sql_events_service/__init__.py +22 -0
  48. google/cloud/sqladmin_v1/services/sql_events_service/async_client.py +311 -0
  49. google/cloud/sqladmin_v1/services/sql_events_service/client.py +593 -0
  50. google/cloud/sqladmin_v1/services/sql_events_service/transports/__init__.py +32 -0
  51. google/cloud/sqladmin_v1/services/sql_events_service/transports/base.py +159 -0
  52. google/cloud/sqladmin_v1/services/sql_events_service/transports/grpc.py +337 -0
  53. google/cloud/sqladmin_v1/services/sql_events_service/transports/grpc_asyncio.py +354 -0
  54. google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/__init__.py +22 -0
  55. google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/async_client.py +327 -0
  56. google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/client.py +605 -0
  57. google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/transports/__init__.py +32 -0
  58. google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/transports/base.py +159 -0
  59. google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/transports/grpc.py +337 -0
  60. google/cloud/sqladmin_v1/services/sql_feature_eligibility_service/transports/grpc_asyncio.py +356 -0
  61. google/cloud/sqladmin_v1/services/sql_flags_service/__init__.py +22 -0
  62. google/cloud/sqladmin_v1/services/sql_flags_service/async_client.py +386 -0
  63. google/cloud/sqladmin_v1/services/sql_flags_service/client.py +667 -0
  64. google/cloud/sqladmin_v1/services/sql_flags_service/transports/__init__.py +32 -0
  65. google/cloud/sqladmin_v1/services/sql_flags_service/transports/base.py +181 -0
  66. google/cloud/sqladmin_v1/services/sql_flags_service/transports/grpc.py +367 -0
  67. google/cloud/sqladmin_v1/services/sql_flags_service/transports/grpc_asyncio.py +391 -0
  68. google/cloud/sqladmin_v1/services/sql_iam_policies_service/__init__.py +22 -0
  69. google/cloud/sqladmin_v1/services/sql_iam_policies_service/async_client.py +315 -0
  70. google/cloud/sqladmin_v1/services/sql_iam_policies_service/client.py +593 -0
  71. google/cloud/sqladmin_v1/services/sql_iam_policies_service/transports/__init__.py +32 -0
  72. google/cloud/sqladmin_v1/services/sql_iam_policies_service/transports/base.py +159 -0
  73. google/cloud/sqladmin_v1/services/sql_iam_policies_service/transports/grpc.py +336 -0
  74. google/cloud/sqladmin_v1/services/sql_iam_policies_service/transports/grpc_asyncio.py +353 -0
  75. google/cloud/sqladmin_v1/services/sql_instance_names_service/__init__.py +22 -0
  76. google/cloud/sqladmin_v1/services/sql_instance_names_service/async_client.py +321 -0
  77. google/cloud/sqladmin_v1/services/sql_instance_names_service/client.py +595 -0
  78. google/cloud/sqladmin_v1/services/sql_instance_names_service/transports/__init__.py +32 -0
  79. google/cloud/sqladmin_v1/services/sql_instance_names_service/transports/base.py +159 -0
  80. google/cloud/sqladmin_v1/services/sql_instance_names_service/transports/grpc.py +336 -0
  81. google/cloud/sqladmin_v1/services/sql_instance_names_service/transports/grpc_asyncio.py +353 -0
  82. google/cloud/sqladmin_v1/services/sql_instances_service/__init__.py +22 -0
  83. google/cloud/sqladmin_v1/services/sql_instances_service/async_client.py +4519 -0
  84. google/cloud/sqladmin_v1/services/sql_instances_service/client.py +4833 -0
  85. google/cloud/sqladmin_v1/services/sql_instances_service/pagers.py +197 -0
  86. google/cloud/sqladmin_v1/services/sql_instances_service/transports/__init__.py +32 -0
  87. google/cloud/sqladmin_v1/services/sql_instances_service/transports/base.py +801 -0
  88. google/cloud/sqladmin_v1/services/sql_instances_service/transports/grpc.py +1661 -0
  89. google/cloud/sqladmin_v1/services/sql_instances_service/transports/grpc_asyncio.py +1904 -0
  90. google/cloud/sqladmin_v1/services/sql_operations_service/__init__.py +22 -0
  91. google/cloud/sqladmin_v1/services/sql_operations_service/async_client.py +591 -0
  92. google/cloud/sqladmin_v1/services/sql_operations_service/client.py +871 -0
  93. google/cloud/sqladmin_v1/services/sql_operations_service/pagers.py +197 -0
  94. google/cloud/sqladmin_v1/services/sql_operations_service/transports/__init__.py +32 -0
  95. google/cloud/sqladmin_v1/services/sql_operations_service/transports/base.py +210 -0
  96. google/cloud/sqladmin_v1/services/sql_operations_service/transports/grpc.py +426 -0
  97. google/cloud/sqladmin_v1/services/sql_operations_service/transports/grpc_asyncio.py +462 -0
  98. google/cloud/sqladmin_v1/services/sql_regions_service/__init__.py +22 -0
  99. google/cloud/sqladmin_v1/services/sql_regions_service/async_client.py +314 -0
  100. google/cloud/sqladmin_v1/services/sql_regions_service/client.py +596 -0
  101. google/cloud/sqladmin_v1/services/sql_regions_service/transports/__init__.py +32 -0
  102. google/cloud/sqladmin_v1/services/sql_regions_service/transports/base.py +159 -0
  103. google/cloud/sqladmin_v1/services/sql_regions_service/transports/grpc.py +338 -0
  104. google/cloud/sqladmin_v1/services/sql_regions_service/transports/grpc_asyncio.py +355 -0
  105. google/cloud/sqladmin_v1/services/sql_ssl_certs_service/__init__.py +22 -0
  106. google/cloud/sqladmin_v1/services/sql_ssl_certs_service/async_client.py +680 -0
  107. google/cloud/sqladmin_v1/services/sql_ssl_certs_service/client.py +960 -0
  108. google/cloud/sqladmin_v1/services/sql_ssl_certs_service/transports/__init__.py +32 -0
  109. google/cloud/sqladmin_v1/services/sql_ssl_certs_service/transports/base.py +226 -0
  110. google/cloud/sqladmin_v1/services/sql_ssl_certs_service/transports/grpc.py +461 -0
  111. google/cloud/sqladmin_v1/services/sql_ssl_certs_service/transports/grpc_asyncio.py +501 -0
  112. google/cloud/sqladmin_v1/services/sql_tiers_service/__init__.py +22 -0
  113. google/cloud/sqladmin_v1/services/sql_tiers_service/async_client.py +395 -0
  114. google/cloud/sqladmin_v1/services/sql_tiers_service/client.py +676 -0
  115. google/cloud/sqladmin_v1/services/sql_tiers_service/transports/__init__.py +32 -0
  116. google/cloud/sqladmin_v1/services/sql_tiers_service/transports/base.py +181 -0
  117. google/cloud/sqladmin_v1/services/sql_tiers_service/transports/grpc.py +369 -0
  118. google/cloud/sqladmin_v1/services/sql_tiers_service/transports/grpc_asyncio.py +393 -0
  119. google/cloud/sqladmin_v1/services/sql_users_service/__init__.py +22 -0
  120. google/cloud/sqladmin_v1/services/sql_users_service/async_client.py +754 -0
  121. google/cloud/sqladmin_v1/services/sql_users_service/client.py +1035 -0
  122. google/cloud/sqladmin_v1/services/sql_users_service/transports/__init__.py +32 -0
  123. google/cloud/sqladmin_v1/services/sql_users_service/transports/base.py +237 -0
  124. google/cloud/sqladmin_v1/services/sql_users_service/transports/grpc.py +477 -0
  125. google/cloud/sqladmin_v1/services/sql_users_service/transports/grpc_asyncio.py +526 -0
  126. google/cloud/sqladmin_v1/types/__init__.py +472 -0
  127. google/cloud/sqladmin_v1/types/cloud_sql_available_database_versions.py +24 -0
  128. google/cloud/sqladmin_v1/types/cloud_sql_backup_runs.py +438 -0
  129. google/cloud/sqladmin_v1/types/cloud_sql_backups.py +467 -0
  130. google/cloud/sqladmin_v1/types/cloud_sql_connect.py +385 -0
  131. google/cloud/sqladmin_v1/types/cloud_sql_databases.py +202 -0
  132. google/cloud/sqladmin_v1/types/cloud_sql_events.py +24 -0
  133. google/cloud/sqladmin_v1/types/cloud_sql_feature_eligibility.py +24 -0
  134. google/cloud/sqladmin_v1/types/cloud_sql_flags.py +272 -0
  135. google/cloud/sqladmin_v1/types/cloud_sql_iam_policies.py +24 -0
  136. google/cloud/sqladmin_v1/types/cloud_sql_instance_names.py +24 -0
  137. google/cloud/sqladmin_v1/types/cloud_sql_instances.py +4514 -0
  138. google/cloud/sqladmin_v1/types/cloud_sql_operations.py +164 -0
  139. google/cloud/sqladmin_v1/types/cloud_sql_regions.py +24 -0
  140. google/cloud/sqladmin_v1/types/cloud_sql_resources.py +4678 -0
  141. google/cloud/sqladmin_v1/types/cloud_sql_ssl_certs.py +220 -0
  142. google/cloud/sqladmin_v1/types/cloud_sql_tiers.py +108 -0
  143. google/cloud/sqladmin_v1/types/cloud_sql_users.py +571 -0
  144. google/cloud/sqladmin_v1beta4/__init__.py +583 -0
  145. google/cloud/sqladmin_v1beta4/_compat.py +262 -0
  146. google/cloud/sqladmin_v1beta4/gapic_metadata.json +1371 -0
  147. google/cloud/sqladmin_v1beta4/gapic_version.py +16 -0
  148. google/cloud/sqladmin_v1beta4/py.typed +2 -0
  149. google/cloud/sqladmin_v1beta4/services/__init__.py +15 -0
  150. google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/__init__.py +22 -0
  151. google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/async_client.py +689 -0
  152. google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/client.py +971 -0
  153. google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/pagers.py +197 -0
  154. google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/transports/__init__.py +36 -0
  155. google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/transports/base.py +223 -0
  156. google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/transports/grpc.py +449 -0
  157. google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/transports/grpc_asyncio.py +490 -0
  158. google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/transports/rest.py +1038 -0
  159. google/cloud/sqladmin_v1beta4/services/sql_backup_runs_service/transports/rest_base.py +150 -0
  160. google/cloud/sqladmin_v1beta4/services/sql_backups_service/__init__.py +22 -0
  161. google/cloud/sqladmin_v1beta4/services/sql_backups_service/async_client.py +941 -0
  162. google/cloud/sqladmin_v1beta4/services/sql_backups_service/client.py +1241 -0
  163. google/cloud/sqladmin_v1beta4/services/sql_backups_service/pagers.py +197 -0
  164. google/cloud/sqladmin_v1beta4/services/sql_backups_service/transports/__init__.py +36 -0
  165. google/cloud/sqladmin_v1beta4/services/sql_backups_service/transports/base.py +234 -0
  166. google/cloud/sqladmin_v1beta4/services/sql_backups_service/transports/grpc.py +470 -0
  167. google/cloud/sqladmin_v1beta4/services/sql_backups_service/transports/grpc_asyncio.py +521 -0
  168. google/cloud/sqladmin_v1beta4/services/sql_backups_service/transports/rest.py +1238 -0
  169. google/cloud/sqladmin_v1beta4/services/sql_backups_service/transports/rest_base.py +175 -0
  170. google/cloud/sqladmin_v1beta4/services/sql_connect_service/__init__.py +22 -0
  171. google/cloud/sqladmin_v1beta4/services/sql_connect_service/async_client.py +591 -0
  172. google/cloud/sqladmin_v1beta4/services/sql_connect_service/client.py +869 -0
  173. google/cloud/sqladmin_v1beta4/services/sql_connect_service/transports/__init__.py +36 -0
  174. google/cloud/sqladmin_v1beta4/services/sql_connect_service/transports/base.py +215 -0
  175. google/cloud/sqladmin_v1beta4/services/sql_connect_service/transports/grpc.py +430 -0
  176. google/cloud/sqladmin_v1beta4/services/sql_connect_service/transports/grpc_asyncio.py +464 -0
  177. google/cloud/sqladmin_v1beta4/services/sql_connect_service/transports/rest.py +852 -0
  178. google/cloud/sqladmin_v1beta4/services/sql_connect_service/transports/rest_base.py +138 -0
  179. google/cloud/sqladmin_v1beta4/services/sql_data_service/__init__.py +22 -0
  180. google/cloud/sqladmin_v1beta4/services/sql_data_service/async_client.py +444 -0
  181. google/cloud/sqladmin_v1beta4/services/sql_data_service/client.py +739 -0
  182. google/cloud/sqladmin_v1beta4/services/sql_data_service/transports/__init__.py +36 -0
  183. google/cloud/sqladmin_v1beta4/services/sql_data_service/transports/base.py +181 -0
  184. google/cloud/sqladmin_v1beta4/services/sql_data_service/transports/grpc.py +407 -0
  185. google/cloud/sqladmin_v1beta4/services/sql_data_service/transports/grpc_asyncio.py +431 -0
  186. google/cloud/sqladmin_v1beta4/services/sql_data_service/transports/rest.py +213 -0
  187. google/cloud/sqladmin_v1beta4/services/sql_data_service/transports/rest_base.py +97 -0
  188. google/cloud/sqladmin_v1beta4/services/sql_databases_service/__init__.py +22 -0
  189. google/cloud/sqladmin_v1beta4/services/sql_databases_service/async_client.py +860 -0
  190. google/cloud/sqladmin_v1beta4/services/sql_databases_service/client.py +1142 -0
  191. google/cloud/sqladmin_v1beta4/services/sql_databases_service/transports/__init__.py +36 -0
  192. google/cloud/sqladmin_v1beta4/services/sql_databases_service/transports/base.py +251 -0
  193. google/cloud/sqladmin_v1beta4/services/sql_databases_service/transports/grpc.py +502 -0
  194. google/cloud/sqladmin_v1beta4/services/sql_databases_service/transports/grpc_asyncio.py +561 -0
  195. google/cloud/sqladmin_v1beta4/services/sql_databases_service/transports/rest.py +1468 -0
  196. google/cloud/sqladmin_v1beta4/services/sql_databases_service/transports/rest_base.py +180 -0
  197. google/cloud/sqladmin_v1beta4/services/sql_flags_service/__init__.py +22 -0
  198. google/cloud/sqladmin_v1beta4/services/sql_flags_service/async_client.py +386 -0
  199. google/cloud/sqladmin_v1beta4/services/sql_flags_service/client.py +669 -0
  200. google/cloud/sqladmin_v1beta4/services/sql_flags_service/transports/__init__.py +36 -0
  201. google/cloud/sqladmin_v1beta4/services/sql_flags_service/transports/base.py +181 -0
  202. google/cloud/sqladmin_v1beta4/services/sql_flags_service/transports/grpc.py +365 -0
  203. google/cloud/sqladmin_v1beta4/services/sql_flags_service/transports/grpc_asyncio.py +389 -0
  204. google/cloud/sqladmin_v1beta4/services/sql_flags_service/transports/rest.py +392 -0
  205. google/cloud/sqladmin_v1beta4/services/sql_flags_service/transports/rest_base.py +107 -0
  206. google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/__init__.py +22 -0
  207. google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/async_client.py +315 -0
  208. google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/client.py +595 -0
  209. google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/transports/__init__.py +39 -0
  210. google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/transports/base.py +159 -0
  211. google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/transports/grpc.py +336 -0
  212. google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/transports/grpc_asyncio.py +353 -0
  213. google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/transports/rest.py +184 -0
  214. google/cloud/sqladmin_v1beta4/services/sql_iam_policies_service/transports/rest_base.py +91 -0
  215. google/cloud/sqladmin_v1beta4/services/sql_instances_service/__init__.py +22 -0
  216. google/cloud/sqladmin_v1beta4/services/sql_instances_service/async_client.py +4399 -0
  217. google/cloud/sqladmin_v1beta4/services/sql_instances_service/client.py +4715 -0
  218. google/cloud/sqladmin_v1beta4/services/sql_instances_service/pagers.py +197 -0
  219. google/cloud/sqladmin_v1beta4/services/sql_instances_service/transports/__init__.py +36 -0
  220. google/cloud/sqladmin_v1beta4/services/sql_instances_service/transports/base.py +801 -0
  221. google/cloud/sqladmin_v1beta4/services/sql_instances_service/transports/grpc.py +1627 -0
  222. google/cloud/sqladmin_v1beta4/services/sql_instances_service/transports/grpc_asyncio.py +1895 -0
  223. google/cloud/sqladmin_v1beta4/services/sql_instances_service/transports/rest.py +9625 -0
  224. google/cloud/sqladmin_v1beta4/services/sql_instances_service/transports/rest_base.py +744 -0
  225. google/cloud/sqladmin_v1beta4/services/sql_operations_service/__init__.py +22 -0
  226. google/cloud/sqladmin_v1beta4/services/sql_operations_service/async_client.py +585 -0
  227. google/cloud/sqladmin_v1beta4/services/sql_operations_service/client.py +867 -0
  228. google/cloud/sqladmin_v1beta4/services/sql_operations_service/pagers.py +197 -0
  229. google/cloud/sqladmin_v1beta4/services/sql_operations_service/transports/__init__.py +36 -0
  230. google/cloud/sqladmin_v1beta4/services/sql_operations_service/transports/base.py +210 -0
  231. google/cloud/sqladmin_v1beta4/services/sql_operations_service/transports/grpc.py +422 -0
  232. google/cloud/sqladmin_v1beta4/services/sql_operations_service/transports/grpc_asyncio.py +458 -0
  233. google/cloud/sqladmin_v1beta4/services/sql_operations_service/transports/rest.py +744 -0
  234. google/cloud/sqladmin_v1beta4/services/sql_operations_service/transports/rest_base.py +136 -0
  235. google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/__init__.py +22 -0
  236. google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/async_client.py +672 -0
  237. google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/client.py +954 -0
  238. google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/transports/__init__.py +36 -0
  239. google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/transports/base.py +226 -0
  240. google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/transports/grpc.py +453 -0
  241. google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/transports/grpc_asyncio.py +497 -0
  242. google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/transports/rest.py +1036 -0
  243. google/cloud/sqladmin_v1beta4/services/sql_ssl_certs_service/transports/rest_base.py +150 -0
  244. google/cloud/sqladmin_v1beta4/services/sql_tiers_service/__init__.py +22 -0
  245. google/cloud/sqladmin_v1beta4/services/sql_tiers_service/async_client.py +393 -0
  246. google/cloud/sqladmin_v1beta4/services/sql_tiers_service/client.py +676 -0
  247. google/cloud/sqladmin_v1beta4/services/sql_tiers_service/transports/__init__.py +36 -0
  248. google/cloud/sqladmin_v1beta4/services/sql_tiers_service/transports/base.py +181 -0
  249. google/cloud/sqladmin_v1beta4/services/sql_tiers_service/transports/grpc.py +368 -0
  250. google/cloud/sqladmin_v1beta4/services/sql_tiers_service/transports/grpc_asyncio.py +392 -0
  251. google/cloud/sqladmin_v1beta4/services/sql_tiers_service/transports/rest.py +396 -0
  252. google/cloud/sqladmin_v1beta4/services/sql_tiers_service/transports/rest_base.py +107 -0
  253. google/cloud/sqladmin_v1beta4/services/sql_users_service/__init__.py +22 -0
  254. google/cloud/sqladmin_v1beta4/services/sql_users_service/async_client.py +754 -0
  255. google/cloud/sqladmin_v1beta4/services/sql_users_service/client.py +1037 -0
  256. google/cloud/sqladmin_v1beta4/services/sql_users_service/transports/__init__.py +36 -0
  257. google/cloud/sqladmin_v1beta4/services/sql_users_service/transports/base.py +237 -0
  258. google/cloud/sqladmin_v1beta4/services/sql_users_service/transports/grpc.py +475 -0
  259. google/cloud/sqladmin_v1beta4/services/sql_users_service/transports/grpc_asyncio.py +524 -0
  260. google/cloud/sqladmin_v1beta4/services/sql_users_service/transports/rest.py +1249 -0
  261. google/cloud/sqladmin_v1beta4/services/sql_users_service/transports/rest_base.py +165 -0
  262. google/cloud/sqladmin_v1beta4/types/__init__.py +480 -0
  263. google/cloud/sqladmin_v1beta4/types/cloud_sql.py +2666 -0
  264. google/cloud/sqladmin_v1beta4/types/cloud_sql_connect.py +386 -0
  265. google/cloud/sqladmin_v1beta4/types/cloud_sql_data.py +339 -0
  266. google/cloud/sqladmin_v1beta4/types/cloud_sql_iam_policies.py +24 -0
  267. google/cloud/sqladmin_v1beta4/types/cloud_sql_resources.py +8111 -0
  268. google/cloud/sqladmin_v1beta4/types/cloud_sql_tiers.py +108 -0
  269. google/cloud/sqladmin_v1beta4/types/cloud_sql_users.py +573 -0
  270. google_cloud_sql-0.1.1.dist-info/METADATA +239 -0
  271. google_cloud_sql-0.1.1.dist-info/RECORD +274 -0
  272. google_cloud_sql-0.1.1.dist-info/WHEEL +5 -0
  273. google_cloud_sql-0.1.1.dist-info/licenses/LICENSE +202 -0
  274. google_cloud_sql-0.1.1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,1241 @@
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 json
17
+ import logging as std_logging
18
+ import os
19
+ import re
20
+ import warnings
21
+ from collections import OrderedDict
22
+ from http import HTTPStatus
23
+ from typing import (
24
+ Callable,
25
+ Dict,
26
+ Mapping,
27
+ MutableMapping,
28
+ MutableSequence,
29
+ Optional,
30
+ Sequence,
31
+ Tuple,
32
+ Type,
33
+ Union,
34
+ cast,
35
+ )
36
+
37
+ import google.protobuf
38
+ from google.api_core import client_options as client_options_lib
39
+ from google.api_core import exceptions as core_exceptions
40
+ from google.api_core import gapic_v1
41
+ from google.api_core import retry as retries
42
+ from google.auth import credentials as ga_credentials # type: ignore
43
+ from google.auth.exceptions import MutualTLSChannelError # type: ignore
44
+ from google.auth.transport import mtls # type: ignore
45
+ from google.auth.transport.grpc import SslCredentials # type: ignore
46
+ from google.oauth2 import service_account # type: ignore
47
+
48
+ from google.cloud.sqladmin_v1beta4 import gapic_version as package_version
49
+ from google.cloud.sqladmin_v1beta4._compat import (
50
+ get_api_endpoint,
51
+ get_default_mtls_endpoint,
52
+ get_universe_domain,
53
+ read_environment_variables,
54
+ should_use_client_cert,
55
+ )
56
+
57
+ try:
58
+ OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None]
59
+ except AttributeError: # pragma: NO COVER
60
+ OptionalRetry = Union[retries.Retry, object, None] # type: ignore
61
+
62
+ try:
63
+ from google.api_core import client_logging # type: ignore
64
+
65
+ CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER
66
+ except ImportError: # pragma: NO COVER
67
+ CLIENT_LOGGING_SUPPORTED = False
68
+
69
+ _LOGGER = std_logging.getLogger(__name__)
70
+
71
+ import google.protobuf.field_mask_pb2 as field_mask_pb2 # type: ignore
72
+ import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore
73
+ import google.protobuf.wrappers_pb2 as wrappers_pb2 # type: ignore
74
+ import google.type.interval_pb2 as interval_pb2 # type: ignore
75
+ from google.cloud.location import locations_pb2 # type: ignore
76
+ from google.longrunning import operations_pb2 # type: ignore
77
+
78
+ from google.cloud.sqladmin_v1beta4.services.sql_backups_service import pagers
79
+ from google.cloud.sqladmin_v1beta4.types import cloud_sql, cloud_sql_resources
80
+
81
+ from .transports.base import DEFAULT_CLIENT_INFO, SqlBackupsServiceTransport
82
+ from .transports.grpc import SqlBackupsServiceGrpcTransport
83
+ from .transports.grpc_asyncio import SqlBackupsServiceGrpcAsyncIOTransport
84
+ from .transports.rest import SqlBackupsServiceRestTransport
85
+
86
+
87
+ class SqlBackupsServiceClientMeta(type):
88
+ """Metaclass for the SqlBackupsService client.
89
+
90
+ This provides class-level methods for building and retrieving
91
+ support objects (e.g. transport) without polluting the client instance
92
+ objects.
93
+ """
94
+
95
+ _transport_registry = OrderedDict() # type: Dict[str, Type[SqlBackupsServiceTransport]]
96
+ _transport_registry["grpc"] = SqlBackupsServiceGrpcTransport
97
+ _transport_registry["grpc_asyncio"] = SqlBackupsServiceGrpcAsyncIOTransport
98
+ _transport_registry["rest"] = SqlBackupsServiceRestTransport
99
+
100
+ def get_transport_class(
101
+ cls,
102
+ label: Optional[str] = None,
103
+ ) -> Type[SqlBackupsServiceTransport]:
104
+ """Returns an appropriate transport class.
105
+
106
+ Args:
107
+ label: The name of the desired transport. If none is
108
+ provided, then the first transport in the registry is used.
109
+
110
+ Returns:
111
+ The transport class to use.
112
+ """
113
+ # If a specific transport is requested, return that one.
114
+ if label:
115
+ return cls._transport_registry[label]
116
+
117
+ # No transport is requested; return the default (that is, the first one
118
+ # in the dictionary).
119
+ return next(iter(cls._transport_registry.values()))
120
+
121
+
122
+ class SqlBackupsServiceClient(metaclass=SqlBackupsServiceClientMeta):
123
+ """"""
124
+
125
+ # Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead.
126
+ DEFAULT_ENDPOINT = "sqladmin.googleapis.com"
127
+ DEFAULT_MTLS_ENDPOINT = get_default_mtls_endpoint(DEFAULT_ENDPOINT)
128
+
129
+ _DEFAULT_ENDPOINT_TEMPLATE = "sqladmin.{UNIVERSE_DOMAIN}"
130
+ _DEFAULT_UNIVERSE = "googleapis.com"
131
+
132
+ @classmethod
133
+ def from_service_account_info(cls, info: dict, *args, **kwargs):
134
+ """Creates an instance of this client using the provided credentials
135
+ info.
136
+
137
+ Args:
138
+ info (dict): The service account private key info.
139
+ args: Additional arguments to pass to the constructor.
140
+ kwargs: Additional arguments to pass to the constructor.
141
+
142
+ Returns:
143
+ SqlBackupsServiceClient: The constructed client.
144
+ """
145
+ credentials = service_account.Credentials.from_service_account_info(info)
146
+ kwargs["credentials"] = credentials
147
+ return cls(*args, **kwargs)
148
+
149
+ @classmethod
150
+ def from_service_account_file(cls, filename: str, *args, **kwargs):
151
+ """Creates an instance of this client using the provided credentials
152
+ file.
153
+
154
+ Args:
155
+ filename (str): The path to the service account private key json
156
+ file.
157
+ args: Additional arguments to pass to the constructor.
158
+ kwargs: Additional arguments to pass to the constructor.
159
+
160
+ Returns:
161
+ SqlBackupsServiceClient: The constructed client.
162
+ """
163
+ credentials = service_account.Credentials.from_service_account_file(filename)
164
+ kwargs["credentials"] = credentials
165
+ return cls(*args, **kwargs)
166
+
167
+ from_service_account_json = from_service_account_file
168
+
169
+ @property
170
+ def transport(self) -> SqlBackupsServiceTransport:
171
+ """Returns the transport used by the client instance.
172
+
173
+ Returns:
174
+ SqlBackupsServiceTransport: The transport used by the client
175
+ instance.
176
+ """
177
+ return self._transport
178
+
179
+ @staticmethod
180
+ def backup_path(
181
+ project: str,
182
+ backup: str,
183
+ ) -> str:
184
+ """Returns a fully-qualified backup string."""
185
+ return "projects/{project}/backups/{backup}".format(
186
+ project=project,
187
+ backup=backup,
188
+ )
189
+
190
+ @staticmethod
191
+ def parse_backup_path(path: str) -> Dict[str, str]:
192
+ """Parses a backup path into its component segments."""
193
+ m = re.match(r"^projects/(?P<project>.+?)/backups/(?P<backup>.+?)$", path)
194
+ return m.groupdict() if m else {}
195
+
196
+ @staticmethod
197
+ def service_connection_policy_path(
198
+ project: str,
199
+ region: str,
200
+ service_connection_policy: str,
201
+ ) -> str:
202
+ """Returns a fully-qualified service_connection_policy string."""
203
+ return "projects/{project}/regions/{region}/serviceConnectionPolicies/{service_connection_policy}".format(
204
+ project=project,
205
+ region=region,
206
+ service_connection_policy=service_connection_policy,
207
+ )
208
+
209
+ @staticmethod
210
+ def parse_service_connection_policy_path(path: str) -> Dict[str, str]:
211
+ """Parses a service_connection_policy path into its component segments."""
212
+ m = re.match(
213
+ r"^projects/(?P<project>.+?)/regions/(?P<region>.+?)/serviceConnectionPolicies/(?P<service_connection_policy>.+?)$",
214
+ path,
215
+ )
216
+ return m.groupdict() if m else {}
217
+
218
+ @staticmethod
219
+ def common_billing_account_path(
220
+ billing_account: str,
221
+ ) -> str:
222
+ """Returns a fully-qualified billing_account string."""
223
+ return "billingAccounts/{billing_account}".format(
224
+ billing_account=billing_account,
225
+ )
226
+
227
+ @staticmethod
228
+ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
229
+ """Parse a billing_account path into its component segments."""
230
+ m = re.match(r"^billingAccounts/(?P<billing_account>.+?)$", path)
231
+ return m.groupdict() if m else {}
232
+
233
+ @staticmethod
234
+ def common_folder_path(
235
+ folder: str,
236
+ ) -> str:
237
+ """Returns a fully-qualified folder string."""
238
+ return "folders/{folder}".format(
239
+ folder=folder,
240
+ )
241
+
242
+ @staticmethod
243
+ def parse_common_folder_path(path: str) -> Dict[str, str]:
244
+ """Parse a folder path into its component segments."""
245
+ m = re.match(r"^folders/(?P<folder>.+?)$", path)
246
+ return m.groupdict() if m else {}
247
+
248
+ @staticmethod
249
+ def common_organization_path(
250
+ organization: str,
251
+ ) -> str:
252
+ """Returns a fully-qualified organization string."""
253
+ return "organizations/{organization}".format(
254
+ organization=organization,
255
+ )
256
+
257
+ @staticmethod
258
+ def parse_common_organization_path(path: str) -> Dict[str, str]:
259
+ """Parse a organization path into its component segments."""
260
+ m = re.match(r"^organizations/(?P<organization>.+?)$", path)
261
+ return m.groupdict() if m else {}
262
+
263
+ @staticmethod
264
+ def common_project_path(
265
+ project: str,
266
+ ) -> str:
267
+ """Returns a fully-qualified project string."""
268
+ return "projects/{project}".format(
269
+ project=project,
270
+ )
271
+
272
+ @staticmethod
273
+ def parse_common_project_path(path: str) -> Dict[str, str]:
274
+ """Parse a project path into its component segments."""
275
+ m = re.match(r"^projects/(?P<project>.+?)$", path)
276
+ return m.groupdict() if m else {}
277
+
278
+ @staticmethod
279
+ def common_location_path(
280
+ project: str,
281
+ location: str,
282
+ ) -> str:
283
+ """Returns a fully-qualified location string."""
284
+ return "projects/{project}/locations/{location}".format(
285
+ project=project,
286
+ location=location,
287
+ )
288
+
289
+ @staticmethod
290
+ def parse_common_location_path(path: str) -> Dict[str, str]:
291
+ """Parse a location path into its component segments."""
292
+ m = re.match(r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)$", path)
293
+ return m.groupdict() if m else {}
294
+
295
+ @classmethod
296
+ def get_mtls_endpoint_and_cert_source(
297
+ cls, client_options: Optional[client_options_lib.ClientOptions] = None
298
+ ):
299
+ """Deprecated. Return the API endpoint and client cert source for mutual TLS.
300
+
301
+ The client cert source is determined in the following order:
302
+ (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the
303
+ client cert source is None.
304
+ (2) if `client_options.client_cert_source` is provided, use the provided one; if the
305
+ default client cert source exists, use the default one; otherwise the client cert
306
+ source is None.
307
+
308
+ The API endpoint is determined in the following order:
309
+ (1) if `client_options.api_endpoint` if provided, use the provided one.
310
+ (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the
311
+ default mTLS endpoint; if the environment variable is "never", use the default API
312
+ endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise
313
+ use the default API endpoint.
314
+
315
+ More details can be found at https://google.aip.dev/auth/4114.
316
+
317
+ Args:
318
+ client_options (google.api_core.client_options.ClientOptions): Custom options for the
319
+ client. Only the `api_endpoint` and `client_cert_source` properties may be used
320
+ in this method.
321
+
322
+ Returns:
323
+ Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the
324
+ client cert source to use.
325
+
326
+ Raises:
327
+ google.auth.exceptions.MutualTLSChannelError: If any errors happen.
328
+ """
329
+
330
+ warnings.warn(
331
+ "get_mtls_endpoint_and_cert_source is deprecated. Use the api_endpoint property instead.",
332
+ DeprecationWarning,
333
+ )
334
+ if client_options is None:
335
+ client_options = client_options_lib.ClientOptions()
336
+ use_client_cert = should_use_client_cert()
337
+ use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto")
338
+ if use_mtls_endpoint not in ("auto", "never", "always"):
339
+ raise MutualTLSChannelError(
340
+ "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`"
341
+ )
342
+
343
+ # Figure out the client cert source to use.
344
+ client_cert_source = None
345
+ if use_client_cert:
346
+ if client_options.client_cert_source:
347
+ client_cert_source = client_options.client_cert_source
348
+ elif mtls.has_default_client_cert_source():
349
+ client_cert_source = mtls.default_client_cert_source()
350
+
351
+ # Figure out which api endpoint to use.
352
+ if client_options.api_endpoint is not None:
353
+ api_endpoint = client_options.api_endpoint
354
+ elif use_mtls_endpoint == "always" or (
355
+ use_mtls_endpoint == "auto" and client_cert_source
356
+ ):
357
+ api_endpoint = cls.DEFAULT_MTLS_ENDPOINT # type: ignore
358
+ else:
359
+ api_endpoint = cls.DEFAULT_ENDPOINT
360
+
361
+ return api_endpoint, client_cert_source
362
+
363
+ @staticmethod
364
+ def _get_client_cert_source(provided_cert_source, use_cert_flag):
365
+ """Return the client cert source to be used by the client.
366
+
367
+ Args:
368
+ provided_cert_source (bytes): The client certificate source provided.
369
+ use_cert_flag (bool): A flag indicating whether to use the client certificate.
370
+
371
+ Returns:
372
+ bytes or None: The client cert source to be used by the client.
373
+ """
374
+ client_cert_source = None
375
+ if use_cert_flag:
376
+ if provided_cert_source:
377
+ client_cert_source = provided_cert_source
378
+ elif mtls.has_default_client_cert_source():
379
+ client_cert_source = mtls.default_client_cert_source()
380
+ return client_cert_source
381
+
382
+ def _validate_universe_domain(self):
383
+ """Validates client's and credentials' universe domains are consistent.
384
+
385
+ Returns:
386
+ bool: True iff the configured universe domain is valid.
387
+
388
+ Raises:
389
+ ValueError: If the configured universe domain is not valid.
390
+ """
391
+
392
+ # NOTE (b/349488459): universe validation is disabled until further notice.
393
+ return True
394
+
395
+ def _add_cred_info_for_auth_errors(
396
+ self, error: core_exceptions.GoogleAPICallError
397
+ ) -> None:
398
+ """Adds credential info string to error details for 401/403/404 errors.
399
+
400
+ Args:
401
+ error (google.api_core.exceptions.GoogleAPICallError): The error to add the cred info.
402
+ """
403
+ if error.code not in [
404
+ HTTPStatus.UNAUTHORIZED,
405
+ HTTPStatus.FORBIDDEN,
406
+ HTTPStatus.NOT_FOUND,
407
+ ]:
408
+ return
409
+
410
+ cred = self._transport._credentials
411
+
412
+ # get_cred_info is only available in google-auth>=2.35.0
413
+ if not hasattr(cred, "get_cred_info"):
414
+ return
415
+
416
+ # ignore the type check since pypy test fails when get_cred_info
417
+ # is not available
418
+ cred_info = cred.get_cred_info() # type: ignore
419
+ if cred_info and hasattr(error._details, "append"):
420
+ error._details.append(json.dumps(cred_info))
421
+
422
+ @property
423
+ def api_endpoint(self) -> str:
424
+ """Return the API endpoint used by the client instance.
425
+
426
+ Returns:
427
+ str: The API endpoint used by the client instance.
428
+ """
429
+ return self._api_endpoint
430
+
431
+ @property
432
+ def universe_domain(self) -> str:
433
+ """Return the universe domain used by the client instance.
434
+
435
+ Returns:
436
+ str: The universe domain used by the client instance.
437
+ """
438
+ return self._universe_domain
439
+
440
+ def __init__(
441
+ self,
442
+ *,
443
+ credentials: Optional[ga_credentials.Credentials] = None,
444
+ transport: Optional[
445
+ Union[
446
+ str,
447
+ SqlBackupsServiceTransport,
448
+ Callable[..., SqlBackupsServiceTransport],
449
+ ]
450
+ ] = None,
451
+ client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None,
452
+ client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
453
+ ) -> None:
454
+ """Instantiates the sql backups service client.
455
+
456
+ Args:
457
+ credentials (Optional[google.auth.credentials.Credentials]): The
458
+ authorization credentials to attach to requests. These
459
+ credentials identify the application to the service; if none
460
+ are specified, the client will attempt to ascertain the
461
+ credentials from the environment.
462
+ transport (Optional[Union[str,SqlBackupsServiceTransport,Callable[..., SqlBackupsServiceTransport]]]):
463
+ The transport to use, or a Callable that constructs and returns a new transport.
464
+ If a Callable is given, it will be called with the same set of initialization
465
+ arguments as used in the SqlBackupsServiceTransport constructor.
466
+ If set to None, a transport is chosen automatically.
467
+ client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]):
468
+ Custom options for the client.
469
+
470
+ 1. The ``api_endpoint`` property can be used to override the
471
+ default endpoint provided by the client when ``transport`` is
472
+ not explicitly provided. Only if this property is not set and
473
+ ``transport`` was not explicitly provided, the endpoint is
474
+ determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment
475
+ variable, which have one of the following values:
476
+ "always" (always use the default mTLS endpoint), "never" (always
477
+ use the default regular endpoint) and "auto" (auto-switch to the
478
+ default mTLS endpoint if client certificate is present; this is
479
+ the default value).
480
+
481
+ 2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
482
+ is "true", then the ``client_cert_source`` property can be used
483
+ to provide a client certificate for mTLS transport. If
484
+ not provided, the default SSL client certificate will be used if
485
+ present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not
486
+ set, no client certificate will be used.
487
+
488
+ 3. The ``universe_domain`` property can be used to override the
489
+ default "googleapis.com" universe. Note that the ``api_endpoint``
490
+ property still takes precedence; and ``universe_domain`` is
491
+ currently not supported for mTLS.
492
+
493
+ client_info (google.api_core.gapic_v1.client_info.ClientInfo):
494
+ The client info used to send a user-agent string along with
495
+ API requests. If ``None``, then default info will be used.
496
+ Generally, you only need to set this if you're developing
497
+ your own client library.
498
+
499
+ Raises:
500
+ google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport
501
+ creation failed for any reason.
502
+ """
503
+ self._client_options = client_options
504
+ if isinstance(self._client_options, dict):
505
+ self._client_options = client_options_lib.from_dict(self._client_options)
506
+ if self._client_options is None:
507
+ self._client_options = client_options_lib.ClientOptions()
508
+ self._client_options = cast(
509
+ client_options_lib.ClientOptions, self._client_options
510
+ )
511
+
512
+ universe_domain_opt = getattr(self._client_options, "universe_domain", None)
513
+
514
+ self._use_client_cert, self._use_mtls_endpoint, self._universe_domain_env = (
515
+ read_environment_variables()
516
+ )
517
+ self._client_cert_source = SqlBackupsServiceClient._get_client_cert_source(
518
+ self._client_options.client_cert_source, self._use_client_cert
519
+ )
520
+ self._universe_domain = get_universe_domain(
521
+ universe_domain_opt,
522
+ self._universe_domain_env,
523
+ default_universe=SqlBackupsServiceClient._DEFAULT_UNIVERSE,
524
+ )
525
+ self._api_endpoint: str = "" # updated below, depending on `transport`
526
+
527
+ # Initialize the universe domain validation.
528
+ self._is_universe_domain_valid = False
529
+
530
+ if CLIENT_LOGGING_SUPPORTED: # pragma: NO COVER
531
+ # Setup logging.
532
+ client_logging.initialize_logging()
533
+
534
+ api_key_value = getattr(self._client_options, "api_key", None)
535
+ if api_key_value and credentials:
536
+ raise ValueError(
537
+ "client_options.api_key and credentials are mutually exclusive"
538
+ )
539
+
540
+ # Save or instantiate the transport.
541
+ # Ordinarily, we provide the transport, but allowing a custom transport
542
+ # instance provides an extensibility point for unusual situations.
543
+ transport_provided = isinstance(transport, SqlBackupsServiceTransport)
544
+ if transport_provided:
545
+ # transport is a SqlBackupsServiceTransport instance.
546
+ if credentials or self._client_options.credentials_file or api_key_value:
547
+ raise ValueError(
548
+ "When providing a transport instance, "
549
+ "provide its credentials directly."
550
+ )
551
+ if self._client_options.scopes:
552
+ raise ValueError(
553
+ "When providing a transport instance, provide its scopes directly."
554
+ )
555
+ self._transport = cast(SqlBackupsServiceTransport, transport)
556
+ self._api_endpoint = self._transport.host
557
+
558
+ self._api_endpoint = self._api_endpoint or get_api_endpoint(
559
+ api_override=self._client_options.api_endpoint,
560
+ universe_domain=self._universe_domain,
561
+ default_universe=SqlBackupsServiceClient._DEFAULT_UNIVERSE,
562
+ default_mtls_endpoint=SqlBackupsServiceClient.DEFAULT_MTLS_ENDPOINT,
563
+ default_endpoint_template=SqlBackupsServiceClient._DEFAULT_ENDPOINT_TEMPLATE,
564
+ use_mtls=self._use_mtls_endpoint == "always"
565
+ or (self._use_mtls_endpoint == "auto" and self._client_cert_source),
566
+ )
567
+
568
+ if not transport_provided:
569
+ import google.auth._default # type: ignore
570
+
571
+ if api_key_value and hasattr(
572
+ google.auth._default, "get_api_key_credentials"
573
+ ):
574
+ credentials = google.auth._default.get_api_key_credentials(
575
+ api_key_value
576
+ )
577
+
578
+ transport_init: Union[
579
+ Type[SqlBackupsServiceTransport],
580
+ Callable[..., SqlBackupsServiceTransport],
581
+ ] = (
582
+ SqlBackupsServiceClient.get_transport_class(transport)
583
+ if isinstance(transport, str) or transport is None
584
+ else cast(Callable[..., SqlBackupsServiceTransport], transport)
585
+ )
586
+ # initialize with the provided callable or the passed in class
587
+ self._transport = transport_init(
588
+ credentials=credentials,
589
+ credentials_file=self._client_options.credentials_file,
590
+ host=self._api_endpoint,
591
+ scopes=self._client_options.scopes,
592
+ client_cert_source_for_mtls=self._client_cert_source,
593
+ quota_project_id=self._client_options.quota_project_id,
594
+ client_info=client_info,
595
+ always_use_jwt_access=True,
596
+ api_audience=self._client_options.api_audience,
597
+ )
598
+
599
+ if "async" not in str(self._transport):
600
+ if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
601
+ std_logging.DEBUG
602
+ ): # pragma: NO COVER
603
+ _LOGGER.debug(
604
+ "Created client `google.cloud.sql_v1beta4.SqlBackupsServiceClient`.",
605
+ extra={
606
+ "serviceName": "google.cloud.sql.v1beta4.SqlBackupsService",
607
+ "universeDomain": getattr(
608
+ self._transport._credentials, "universe_domain", ""
609
+ ),
610
+ "credentialsType": f"{type(self._transport._credentials).__module__}.{type(self._transport._credentials).__qualname__}",
611
+ "credentialsInfo": getattr(
612
+ self.transport._credentials, "get_cred_info", lambda: None
613
+ )(),
614
+ }
615
+ if hasattr(self._transport, "_credentials")
616
+ else {
617
+ "serviceName": "google.cloud.sql.v1beta4.SqlBackupsService",
618
+ "credentialsType": None,
619
+ },
620
+ )
621
+
622
+ def create_backup(
623
+ self,
624
+ request: Optional[Union[cloud_sql.CreateBackupRequest, dict]] = None,
625
+ *,
626
+ parent: Optional[str] = None,
627
+ backup: Optional[cloud_sql_resources.Backup] = None,
628
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
629
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
630
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
631
+ ) -> cloud_sql_resources.Operation:
632
+ r"""Creates a backup for a Cloud SQL instance. This API
633
+ can be used only to create on-demand backups.
634
+
635
+ .. code-block:: python
636
+
637
+ # This snippet has been automatically generated and should be regarded as a
638
+ # code template only.
639
+ # It will require modifications to work:
640
+ # - It may require correct/in-range values for request initialization.
641
+ # - It may require specifying regional endpoints when creating the service
642
+ # client as shown in:
643
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
644
+ from google.cloud import sqladmin_v1beta4
645
+
646
+ def sample_create_backup():
647
+ # Create a client
648
+ client = sqladmin_v1beta4.SqlBackupsServiceClient()
649
+
650
+ # Initialize request argument(s)
651
+ backup = sqladmin_v1beta4.Backup()
652
+ backup.ttl_days = 868
653
+
654
+ request = sqladmin_v1beta4.CreateBackupRequest(
655
+ parent="parent_value",
656
+ backup=backup,
657
+ )
658
+
659
+ # Make the request
660
+ response = client.create_backup(request=request)
661
+
662
+ # Handle the response
663
+ print(response)
664
+
665
+ Args:
666
+ request (Union[google.cloud.sqladmin_v1beta4.types.CreateBackupRequest, dict]):
667
+ The request object. The request payload to create the
668
+ backup
669
+ parent (str):
670
+ Required. The parent resource where
671
+ this backup is created. Format:
672
+ projects/{project}
673
+
674
+ This corresponds to the ``parent`` field
675
+ on the ``request`` instance; if ``request`` is provided, this
676
+ should not be set.
677
+ backup (google.cloud.sqladmin_v1beta4.types.Backup):
678
+ Required. The Backup to create.
679
+ This corresponds to the ``backup`` field
680
+ on the ``request`` instance; if ``request`` is provided, this
681
+ should not be set.
682
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
683
+ should be retried.
684
+ timeout (float): The timeout for this request.
685
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
686
+ sent along with the request as metadata. Normally, each value must be of type `str`,
687
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
688
+ be of type `bytes`.
689
+
690
+ Returns:
691
+ google.cloud.sqladmin_v1beta4.types.Operation:
692
+ An Operation resource.&nbsp;For
693
+ successful operations that return an
694
+ Operation resource, only the fields
695
+ relevant to the operation are populated
696
+ in the resource.
697
+
698
+ """
699
+ # Create or coerce a protobuf request object.
700
+ # - Quick check: If we got a request object, we should *not* have
701
+ # gotten any keyword arguments that map to the request.
702
+ flattened_params = [parent, backup]
703
+ has_flattened_params = (
704
+ len([param for param in flattened_params if param is not None]) > 0
705
+ )
706
+ if request is not None and has_flattened_params:
707
+ raise ValueError(
708
+ "If the `request` argument is set, then none of "
709
+ "the individual field arguments should be set."
710
+ )
711
+
712
+ # - Use the request object if provided (there's no risk of modifying the input as
713
+ # there are no flattened fields), or create one.
714
+ if not isinstance(request, cloud_sql.CreateBackupRequest):
715
+ request = cloud_sql.CreateBackupRequest(request)
716
+ # If we have keyword arguments corresponding to fields on the
717
+ # request, apply these.
718
+ if parent is not None:
719
+ request.parent = parent
720
+ if backup is not None:
721
+ request.backup = backup
722
+
723
+ # Wrap the RPC method; this adds retry and timeout information,
724
+ # and friendly error handling.
725
+ rpc = self._transport._wrapped_methods[self._transport.create_backup]
726
+
727
+ # Certain fields should be provided within the metadata header;
728
+ # add these here.
729
+ metadata = tuple(metadata) + (
730
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
731
+ )
732
+
733
+ # Validate the universe domain.
734
+ self._validate_universe_domain()
735
+
736
+ # Send the request.
737
+ response = rpc(
738
+ request,
739
+ retry=retry,
740
+ timeout=timeout,
741
+ metadata=metadata,
742
+ )
743
+
744
+ # Done; return the response.
745
+ return response
746
+
747
+ def get_backup(
748
+ self,
749
+ request: Optional[Union[cloud_sql.GetBackupRequest, dict]] = None,
750
+ *,
751
+ name: Optional[str] = None,
752
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
753
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
754
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
755
+ ) -> cloud_sql_resources.Backup:
756
+ r"""Retrieves a resource containing information about a
757
+ backup.
758
+
759
+ .. code-block:: python
760
+
761
+ # This snippet has been automatically generated and should be regarded as a
762
+ # code template only.
763
+ # It will require modifications to work:
764
+ # - It may require correct/in-range values for request initialization.
765
+ # - It may require specifying regional endpoints when creating the service
766
+ # client as shown in:
767
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
768
+ from google.cloud import sqladmin_v1beta4
769
+
770
+ def sample_get_backup():
771
+ # Create a client
772
+ client = sqladmin_v1beta4.SqlBackupsServiceClient()
773
+
774
+ # Initialize request argument(s)
775
+ request = sqladmin_v1beta4.GetBackupRequest(
776
+ name="name_value",
777
+ )
778
+
779
+ # Make the request
780
+ response = client.get_backup(request=request)
781
+
782
+ # Handle the response
783
+ print(response)
784
+
785
+ Args:
786
+ request (Union[google.cloud.sqladmin_v1beta4.types.GetBackupRequest, dict]):
787
+ The request object. The request payload to get the
788
+ backup.
789
+ name (str):
790
+ Required. The name of the backup to
791
+ retrieve. Format:
792
+ projects/{project}/backups/{backup}
793
+
794
+ This corresponds to the ``name`` field
795
+ on the ``request`` instance; if ``request`` is provided, this
796
+ should not be set.
797
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
798
+ should be retried.
799
+ timeout (float): The timeout for this request.
800
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
801
+ sent along with the request as metadata. Normally, each value must be of type `str`,
802
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
803
+ be of type `bytes`.
804
+
805
+ Returns:
806
+ google.cloud.sqladmin_v1beta4.types.Backup:
807
+ A backup resource.
808
+ """
809
+ # Create or coerce a protobuf request object.
810
+ # - Quick check: If we got a request object, we should *not* have
811
+ # gotten any keyword arguments that map to the request.
812
+ flattened_params = [name]
813
+ has_flattened_params = (
814
+ len([param for param in flattened_params if param is not None]) > 0
815
+ )
816
+ if request is not None and has_flattened_params:
817
+ raise ValueError(
818
+ "If the `request` argument is set, then none of "
819
+ "the individual field arguments should be set."
820
+ )
821
+
822
+ # - Use the request object if provided (there's no risk of modifying the input as
823
+ # there are no flattened fields), or create one.
824
+ if not isinstance(request, cloud_sql.GetBackupRequest):
825
+ request = cloud_sql.GetBackupRequest(request)
826
+ # If we have keyword arguments corresponding to fields on the
827
+ # request, apply these.
828
+ if name is not None:
829
+ request.name = name
830
+
831
+ # Wrap the RPC method; this adds retry and timeout information,
832
+ # and friendly error handling.
833
+ rpc = self._transport._wrapped_methods[self._transport.get_backup]
834
+
835
+ # Certain fields should be provided within the metadata header;
836
+ # add these here.
837
+ metadata = tuple(metadata) + (
838
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
839
+ )
840
+
841
+ # Validate the universe domain.
842
+ self._validate_universe_domain()
843
+
844
+ # Send the request.
845
+ response = rpc(
846
+ request,
847
+ retry=retry,
848
+ timeout=timeout,
849
+ metadata=metadata,
850
+ )
851
+
852
+ # Done; return the response.
853
+ return response
854
+
855
+ def list_backups(
856
+ self,
857
+ request: Optional[Union[cloud_sql.ListBackupsRequest, dict]] = None,
858
+ *,
859
+ parent: Optional[str] = None,
860
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
861
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
862
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
863
+ ) -> pagers.ListBackupsPager:
864
+ r"""Lists all backups associated with the project.
865
+
866
+ .. code-block:: python
867
+
868
+ # This snippet has been automatically generated and should be regarded as a
869
+ # code template only.
870
+ # It will require modifications to work:
871
+ # - It may require correct/in-range values for request initialization.
872
+ # - It may require specifying regional endpoints when creating the service
873
+ # client as shown in:
874
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
875
+ from google.cloud import sqladmin_v1beta4
876
+
877
+ def sample_list_backups():
878
+ # Create a client
879
+ client = sqladmin_v1beta4.SqlBackupsServiceClient()
880
+
881
+ # Initialize request argument(s)
882
+ request = sqladmin_v1beta4.ListBackupsRequest(
883
+ parent="parent_value",
884
+ )
885
+
886
+ # Make the request
887
+ page_result = client.list_backups(request=request)
888
+
889
+ # Handle the response
890
+ for response in page_result:
891
+ print(response)
892
+
893
+ Args:
894
+ request (Union[google.cloud.sqladmin_v1beta4.types.ListBackupsRequest, dict]):
895
+ The request object. The request payload to list the
896
+ backups.
897
+ parent (str):
898
+ Required. The parent that owns this
899
+ collection of backups. Format:
900
+ projects/{project}
901
+
902
+ This corresponds to the ``parent`` field
903
+ on the ``request`` instance; if ``request`` is provided, this
904
+ should not be set.
905
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
906
+ should be retried.
907
+ timeout (float): The timeout for this request.
908
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
909
+ sent along with the request as metadata. Normally, each value must be of type `str`,
910
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
911
+ be of type `bytes`.
912
+
913
+ Returns:
914
+ google.cloud.sqladmin_v1beta4.services.sql_backups_service.pagers.ListBackupsPager:
915
+ The response payload containing a
916
+ list of the backups.
917
+ Iterating over this object will yield
918
+ results and resolve additional pages
919
+ automatically.
920
+
921
+ """
922
+ # Create or coerce a protobuf request object.
923
+ # - Quick check: If we got a request object, we should *not* have
924
+ # gotten any keyword arguments that map to the request.
925
+ flattened_params = [parent]
926
+ has_flattened_params = (
927
+ len([param for param in flattened_params if param is not None]) > 0
928
+ )
929
+ if request is not None and has_flattened_params:
930
+ raise ValueError(
931
+ "If the `request` argument is set, then none of "
932
+ "the individual field arguments should be set."
933
+ )
934
+
935
+ # - Use the request object if provided (there's no risk of modifying the input as
936
+ # there are no flattened fields), or create one.
937
+ if not isinstance(request, cloud_sql.ListBackupsRequest):
938
+ request = cloud_sql.ListBackupsRequest(request)
939
+ # If we have keyword arguments corresponding to fields on the
940
+ # request, apply these.
941
+ if parent is not None:
942
+ request.parent = parent
943
+
944
+ # Wrap the RPC method; this adds retry and timeout information,
945
+ # and friendly error handling.
946
+ rpc = self._transport._wrapped_methods[self._transport.list_backups]
947
+
948
+ # Certain fields should be provided within the metadata header;
949
+ # add these here.
950
+ metadata = tuple(metadata) + (
951
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
952
+ )
953
+
954
+ # Validate the universe domain.
955
+ self._validate_universe_domain()
956
+
957
+ # Send the request.
958
+ response = rpc(
959
+ request,
960
+ retry=retry,
961
+ timeout=timeout,
962
+ metadata=metadata,
963
+ )
964
+
965
+ # This method is paged; wrap the response in a pager, which provides
966
+ # an `__iter__` convenience method.
967
+ response = pagers.ListBackupsPager(
968
+ method=rpc,
969
+ request=request,
970
+ response=response,
971
+ retry=retry,
972
+ timeout=timeout,
973
+ metadata=metadata,
974
+ )
975
+
976
+ # Done; return the response.
977
+ return response
978
+
979
+ def update_backup(
980
+ self,
981
+ request: Optional[Union[cloud_sql.UpdateBackupRequest, dict]] = None,
982
+ *,
983
+ backup: Optional[cloud_sql_resources.Backup] = None,
984
+ update_mask: Optional[field_mask_pb2.FieldMask] = None,
985
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
986
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
987
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
988
+ ) -> cloud_sql_resources.Operation:
989
+ r"""Updates the retention period and the description of
990
+ the backup. You can use this API to update final backups
991
+ only.
992
+
993
+ .. code-block:: python
994
+
995
+ # This snippet has been automatically generated and should be regarded as a
996
+ # code template only.
997
+ # It will require modifications to work:
998
+ # - It may require correct/in-range values for request initialization.
999
+ # - It may require specifying regional endpoints when creating the service
1000
+ # client as shown in:
1001
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
1002
+ from google.cloud import sqladmin_v1beta4
1003
+
1004
+ def sample_update_backup():
1005
+ # Create a client
1006
+ client = sqladmin_v1beta4.SqlBackupsServiceClient()
1007
+
1008
+ # Initialize request argument(s)
1009
+ backup = sqladmin_v1beta4.Backup()
1010
+ backup.ttl_days = 868
1011
+
1012
+ request = sqladmin_v1beta4.UpdateBackupRequest(
1013
+ backup=backup,
1014
+ )
1015
+
1016
+ # Make the request
1017
+ response = client.update_backup(request=request)
1018
+
1019
+ # Handle the response
1020
+ print(response)
1021
+
1022
+ Args:
1023
+ request (Union[google.cloud.sqladmin_v1beta4.types.UpdateBackupRequest, dict]):
1024
+ The request object. The request payload to update the
1025
+ backup.
1026
+ backup (google.cloud.sqladmin_v1beta4.types.Backup):
1027
+ Required. The backup to update. The backup’s ``name``
1028
+ field is used to identify the backup to update. Format:
1029
+ projects/{project}/backups/{backup}
1030
+
1031
+ This corresponds to the ``backup`` field
1032
+ on the ``request`` instance; if ``request`` is provided, this
1033
+ should not be set.
1034
+ update_mask (google.protobuf.field_mask_pb2.FieldMask):
1035
+ The list of fields that you can
1036
+ update. You can update only the
1037
+ description and retention period of the
1038
+ final backup.
1039
+
1040
+ This corresponds to the ``update_mask`` field
1041
+ on the ``request`` instance; if ``request`` is provided, this
1042
+ should not be set.
1043
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
1044
+ should be retried.
1045
+ timeout (float): The timeout for this request.
1046
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1047
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1048
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1049
+ be of type `bytes`.
1050
+
1051
+ Returns:
1052
+ google.cloud.sqladmin_v1beta4.types.Operation:
1053
+ An Operation resource.&nbsp;For
1054
+ successful operations that return an
1055
+ Operation resource, only the fields
1056
+ relevant to the operation are populated
1057
+ in the resource.
1058
+
1059
+ """
1060
+ # Create or coerce a protobuf request object.
1061
+ # - Quick check: If we got a request object, we should *not* have
1062
+ # gotten any keyword arguments that map to the request.
1063
+ flattened_params = [backup, update_mask]
1064
+ has_flattened_params = (
1065
+ len([param for param in flattened_params if param is not None]) > 0
1066
+ )
1067
+ if request is not None and has_flattened_params:
1068
+ raise ValueError(
1069
+ "If the `request` argument is set, then none of "
1070
+ "the individual field arguments should be set."
1071
+ )
1072
+
1073
+ # - Use the request object if provided (there's no risk of modifying the input as
1074
+ # there are no flattened fields), or create one.
1075
+ if not isinstance(request, cloud_sql.UpdateBackupRequest):
1076
+ request = cloud_sql.UpdateBackupRequest(request)
1077
+ # If we have keyword arguments corresponding to fields on the
1078
+ # request, apply these.
1079
+ if backup is not None:
1080
+ request.backup = backup
1081
+ if update_mask is not None:
1082
+ request.update_mask = update_mask
1083
+
1084
+ # Wrap the RPC method; this adds retry and timeout information,
1085
+ # and friendly error handling.
1086
+ rpc = self._transport._wrapped_methods[self._transport.update_backup]
1087
+
1088
+ # Certain fields should be provided within the metadata header;
1089
+ # add these here.
1090
+ metadata = tuple(metadata) + (
1091
+ gapic_v1.routing_header.to_grpc_metadata(
1092
+ (("backup.name", request.backup.name),)
1093
+ ),
1094
+ )
1095
+
1096
+ # Validate the universe domain.
1097
+ self._validate_universe_domain()
1098
+
1099
+ # Send the request.
1100
+ response = rpc(
1101
+ request,
1102
+ retry=retry,
1103
+ timeout=timeout,
1104
+ metadata=metadata,
1105
+ )
1106
+
1107
+ # Done; return the response.
1108
+ return response
1109
+
1110
+ def delete_backup(
1111
+ self,
1112
+ request: Optional[Union[cloud_sql.DeleteBackupRequest, dict]] = None,
1113
+ *,
1114
+ name: Optional[str] = None,
1115
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1116
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1117
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1118
+ ) -> cloud_sql_resources.Operation:
1119
+ r"""Deletes the backup.
1120
+
1121
+ .. code-block:: python
1122
+
1123
+ # This snippet has been automatically generated and should be regarded as a
1124
+ # code template only.
1125
+ # It will require modifications to work:
1126
+ # - It may require correct/in-range values for request initialization.
1127
+ # - It may require specifying regional endpoints when creating the service
1128
+ # client as shown in:
1129
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
1130
+ from google.cloud import sqladmin_v1beta4
1131
+
1132
+ def sample_delete_backup():
1133
+ # Create a client
1134
+ client = sqladmin_v1beta4.SqlBackupsServiceClient()
1135
+
1136
+ # Initialize request argument(s)
1137
+ request = sqladmin_v1beta4.DeleteBackupRequest(
1138
+ name="name_value",
1139
+ )
1140
+
1141
+ # Make the request
1142
+ response = client.delete_backup(request=request)
1143
+
1144
+ # Handle the response
1145
+ print(response)
1146
+
1147
+ Args:
1148
+ request (Union[google.cloud.sqladmin_v1beta4.types.DeleteBackupRequest, dict]):
1149
+ The request object. The request payload to delete the
1150
+ backup.
1151
+ name (str):
1152
+ Required. The name of the backup to
1153
+ delete. Format:
1154
+ projects/{project}/backups/{backup}
1155
+
1156
+ This corresponds to the ``name`` field
1157
+ on the ``request`` instance; if ``request`` is provided, this
1158
+ should not be set.
1159
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
1160
+ should be retried.
1161
+ timeout (float): The timeout for this request.
1162
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1163
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1164
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1165
+ be of type `bytes`.
1166
+
1167
+ Returns:
1168
+ google.cloud.sqladmin_v1beta4.types.Operation:
1169
+ An Operation resource.&nbsp;For
1170
+ successful operations that return an
1171
+ Operation resource, only the fields
1172
+ relevant to the operation are populated
1173
+ in the resource.
1174
+
1175
+ """
1176
+ # Create or coerce a protobuf request object.
1177
+ # - Quick check: If we got a request object, we should *not* have
1178
+ # gotten any keyword arguments that map to the request.
1179
+ flattened_params = [name]
1180
+ has_flattened_params = (
1181
+ len([param for param in flattened_params if param is not None]) > 0
1182
+ )
1183
+ if request is not None and has_flattened_params:
1184
+ raise ValueError(
1185
+ "If the `request` argument is set, then none of "
1186
+ "the individual field arguments should be set."
1187
+ )
1188
+
1189
+ # - Use the request object if provided (there's no risk of modifying the input as
1190
+ # there are no flattened fields), or create one.
1191
+ if not isinstance(request, cloud_sql.DeleteBackupRequest):
1192
+ request = cloud_sql.DeleteBackupRequest(request)
1193
+ # If we have keyword arguments corresponding to fields on the
1194
+ # request, apply these.
1195
+ if name is not None:
1196
+ request.name = name
1197
+
1198
+ # Wrap the RPC method; this adds retry and timeout information,
1199
+ # and friendly error handling.
1200
+ rpc = self._transport._wrapped_methods[self._transport.delete_backup]
1201
+
1202
+ # Certain fields should be provided within the metadata header;
1203
+ # add these here.
1204
+ metadata = tuple(metadata) + (
1205
+ gapic_v1.routing_header.to_grpc_metadata((("name", request.name),)),
1206
+ )
1207
+
1208
+ # Validate the universe domain.
1209
+ self._validate_universe_domain()
1210
+
1211
+ # Send the request.
1212
+ response = rpc(
1213
+ request,
1214
+ retry=retry,
1215
+ timeout=timeout,
1216
+ metadata=metadata,
1217
+ )
1218
+
1219
+ # Done; return the response.
1220
+ return response
1221
+
1222
+ def __enter__(self) -> "SqlBackupsServiceClient":
1223
+ return self
1224
+
1225
+ def __exit__(self, type, value, traceback):
1226
+ """Releases underlying transport's resources.
1227
+
1228
+ .. warning::
1229
+ ONLY use as a context manager if the transport is NOT shared
1230
+ with other clients! Exiting the with block will CLOSE the transport
1231
+ and may cause errors in other clients!
1232
+ """
1233
+ self.transport.close()
1234
+
1235
+
1236
+ DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
1237
+ gapic_version=package_version.__version__
1238
+ )
1239
+ DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
1240
+
1241
+ __all__ = ("SqlBackupsServiceClient",)