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