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,977 @@
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.timestamp_pb2 as timestamp_pb2 # type: ignore
72
+ from google.cloud.location import locations_pb2 # type: ignore
73
+ from google.longrunning import operations_pb2 # type: ignore
74
+
75
+ from google.cloud.sqladmin_v1.services.sql_backup_runs_service import pagers
76
+ from google.cloud.sqladmin_v1.types import cloud_sql_backup_runs, cloud_sql_resources
77
+
78
+ from .transports.base import DEFAULT_CLIENT_INFO, SqlBackupRunsServiceTransport
79
+ from .transports.grpc import SqlBackupRunsServiceGrpcTransport
80
+ from .transports.grpc_asyncio import SqlBackupRunsServiceGrpcAsyncIOTransport
81
+
82
+
83
+ class SqlBackupRunsServiceClientMeta(type):
84
+ """Metaclass for the SqlBackupRunsService client.
85
+
86
+ This provides class-level methods for building and retrieving
87
+ support objects (e.g. transport) without polluting the client instance
88
+ objects.
89
+ """
90
+
91
+ _transport_registry = OrderedDict() # type: Dict[str, Type[SqlBackupRunsServiceTransport]]
92
+ _transport_registry["grpc"] = SqlBackupRunsServiceGrpcTransport
93
+ _transport_registry["grpc_asyncio"] = SqlBackupRunsServiceGrpcAsyncIOTransport
94
+
95
+ def get_transport_class(
96
+ cls,
97
+ label: Optional[str] = None,
98
+ ) -> Type[SqlBackupRunsServiceTransport]:
99
+ """Returns an appropriate transport class.
100
+
101
+ Args:
102
+ label: The name of the desired transport. If none is
103
+ provided, then the first transport in the registry is used.
104
+
105
+ Returns:
106
+ The transport class to use.
107
+ """
108
+ # If a specific transport is requested, return that one.
109
+ if label:
110
+ return cls._transport_registry[label]
111
+
112
+ # No transport is requested; return the default (that is, the first one
113
+ # in the dictionary).
114
+ return next(iter(cls._transport_registry.values()))
115
+
116
+
117
+ class SqlBackupRunsServiceClient(metaclass=SqlBackupRunsServiceClientMeta):
118
+ """Service for managing database backups."""
119
+
120
+ # Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead.
121
+ DEFAULT_ENDPOINT = "sqladmin.googleapis.com"
122
+ DEFAULT_MTLS_ENDPOINT = get_default_mtls_endpoint(DEFAULT_ENDPOINT)
123
+
124
+ _DEFAULT_ENDPOINT_TEMPLATE = "sqladmin.{UNIVERSE_DOMAIN}"
125
+ _DEFAULT_UNIVERSE = "googleapis.com"
126
+
127
+ @classmethod
128
+ def from_service_account_info(cls, info: dict, *args, **kwargs):
129
+ """Creates an instance of this client using the provided credentials
130
+ info.
131
+
132
+ Args:
133
+ info (dict): The service account private key info.
134
+ args: Additional arguments to pass to the constructor.
135
+ kwargs: Additional arguments to pass to the constructor.
136
+
137
+ Returns:
138
+ SqlBackupRunsServiceClient: The constructed client.
139
+ """
140
+ credentials = service_account.Credentials.from_service_account_info(info)
141
+ kwargs["credentials"] = credentials
142
+ return cls(*args, **kwargs)
143
+
144
+ @classmethod
145
+ def from_service_account_file(cls, filename: str, *args, **kwargs):
146
+ """Creates an instance of this client using the provided credentials
147
+ file.
148
+
149
+ Args:
150
+ filename (str): The path to the service account private key json
151
+ file.
152
+ args: Additional arguments to pass to the constructor.
153
+ kwargs: Additional arguments to pass to the constructor.
154
+
155
+ Returns:
156
+ SqlBackupRunsServiceClient: The constructed client.
157
+ """
158
+ credentials = service_account.Credentials.from_service_account_file(filename)
159
+ kwargs["credentials"] = credentials
160
+ return cls(*args, **kwargs)
161
+
162
+ from_service_account_json = from_service_account_file
163
+
164
+ @property
165
+ def transport(self) -> SqlBackupRunsServiceTransport:
166
+ """Returns the transport used by the client instance.
167
+
168
+ Returns:
169
+ SqlBackupRunsServiceTransport: The transport used by the client
170
+ instance.
171
+ """
172
+ return self._transport
173
+
174
+ @staticmethod
175
+ def common_billing_account_path(
176
+ billing_account: str,
177
+ ) -> str:
178
+ """Returns a fully-qualified billing_account string."""
179
+ return "billingAccounts/{billing_account}".format(
180
+ billing_account=billing_account,
181
+ )
182
+
183
+ @staticmethod
184
+ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
185
+ """Parse a billing_account path into its component segments."""
186
+ m = re.match(r"^billingAccounts/(?P<billing_account>.+?)$", path)
187
+ return m.groupdict() if m else {}
188
+
189
+ @staticmethod
190
+ def common_folder_path(
191
+ folder: str,
192
+ ) -> str:
193
+ """Returns a fully-qualified folder string."""
194
+ return "folders/{folder}".format(
195
+ folder=folder,
196
+ )
197
+
198
+ @staticmethod
199
+ def parse_common_folder_path(path: str) -> Dict[str, str]:
200
+ """Parse a folder path into its component segments."""
201
+ m = re.match(r"^folders/(?P<folder>.+?)$", path)
202
+ return m.groupdict() if m else {}
203
+
204
+ @staticmethod
205
+ def common_organization_path(
206
+ organization: str,
207
+ ) -> str:
208
+ """Returns a fully-qualified organization string."""
209
+ return "organizations/{organization}".format(
210
+ organization=organization,
211
+ )
212
+
213
+ @staticmethod
214
+ def parse_common_organization_path(path: str) -> Dict[str, str]:
215
+ """Parse a organization path into its component segments."""
216
+ m = re.match(r"^organizations/(?P<organization>.+?)$", path)
217
+ return m.groupdict() if m else {}
218
+
219
+ @staticmethod
220
+ def common_project_path(
221
+ project: str,
222
+ ) -> str:
223
+ """Returns a fully-qualified project string."""
224
+ return "projects/{project}".format(
225
+ project=project,
226
+ )
227
+
228
+ @staticmethod
229
+ def parse_common_project_path(path: str) -> Dict[str, str]:
230
+ """Parse a project path into its component segments."""
231
+ m = re.match(r"^projects/(?P<project>.+?)$", path)
232
+ return m.groupdict() if m else {}
233
+
234
+ @staticmethod
235
+ def common_location_path(
236
+ project: str,
237
+ location: str,
238
+ ) -> str:
239
+ """Returns a fully-qualified location string."""
240
+ return "projects/{project}/locations/{location}".format(
241
+ project=project,
242
+ location=location,
243
+ )
244
+
245
+ @staticmethod
246
+ def parse_common_location_path(path: str) -> Dict[str, str]:
247
+ """Parse a location path into its component segments."""
248
+ m = re.match(r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)$", path)
249
+ return m.groupdict() if m else {}
250
+
251
+ @classmethod
252
+ def get_mtls_endpoint_and_cert_source(
253
+ cls, client_options: Optional[client_options_lib.ClientOptions] = None
254
+ ):
255
+ """Deprecated. Return the API endpoint and client cert source for mutual TLS.
256
+
257
+ The client cert source is determined in the following order:
258
+ (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the
259
+ client cert source is None.
260
+ (2) if `client_options.client_cert_source` is provided, use the provided one; if the
261
+ default client cert source exists, use the default one; otherwise the client cert
262
+ source is None.
263
+
264
+ The API endpoint is determined in the following order:
265
+ (1) if `client_options.api_endpoint` if provided, use the provided one.
266
+ (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the
267
+ default mTLS endpoint; if the environment variable is "never", use the default API
268
+ endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise
269
+ use the default API endpoint.
270
+
271
+ More details can be found at https://google.aip.dev/auth/4114.
272
+
273
+ Args:
274
+ client_options (google.api_core.client_options.ClientOptions): Custom options for the
275
+ client. Only the `api_endpoint` and `client_cert_source` properties may be used
276
+ in this method.
277
+
278
+ Returns:
279
+ Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the
280
+ client cert source to use.
281
+
282
+ Raises:
283
+ google.auth.exceptions.MutualTLSChannelError: If any errors happen.
284
+ """
285
+
286
+ warnings.warn(
287
+ "get_mtls_endpoint_and_cert_source is deprecated. Use the api_endpoint property instead.",
288
+ DeprecationWarning,
289
+ )
290
+ if client_options is None:
291
+ client_options = client_options_lib.ClientOptions()
292
+ use_client_cert = should_use_client_cert()
293
+ use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto")
294
+ if use_mtls_endpoint not in ("auto", "never", "always"):
295
+ raise MutualTLSChannelError(
296
+ "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`"
297
+ )
298
+
299
+ # Figure out the client cert source to use.
300
+ client_cert_source = None
301
+ if use_client_cert:
302
+ if client_options.client_cert_source:
303
+ client_cert_source = client_options.client_cert_source
304
+ elif mtls.has_default_client_cert_source():
305
+ client_cert_source = mtls.default_client_cert_source()
306
+
307
+ # Figure out which api endpoint to use.
308
+ if client_options.api_endpoint is not None:
309
+ api_endpoint = client_options.api_endpoint
310
+ elif use_mtls_endpoint == "always" or (
311
+ use_mtls_endpoint == "auto" and client_cert_source
312
+ ):
313
+ api_endpoint = cls.DEFAULT_MTLS_ENDPOINT # type: ignore
314
+ else:
315
+ api_endpoint = cls.DEFAULT_ENDPOINT
316
+
317
+ return api_endpoint, client_cert_source
318
+
319
+ @staticmethod
320
+ def _get_client_cert_source(provided_cert_source, use_cert_flag):
321
+ """Return the client cert source to be used by the client.
322
+
323
+ Args:
324
+ provided_cert_source (bytes): The client certificate source provided.
325
+ use_cert_flag (bool): A flag indicating whether to use the client certificate.
326
+
327
+ Returns:
328
+ bytes or None: The client cert source to be used by the client.
329
+ """
330
+ client_cert_source = None
331
+ if use_cert_flag:
332
+ if provided_cert_source:
333
+ client_cert_source = provided_cert_source
334
+ elif mtls.has_default_client_cert_source():
335
+ client_cert_source = mtls.default_client_cert_source()
336
+ return client_cert_source
337
+
338
+ def _validate_universe_domain(self):
339
+ """Validates client's and credentials' universe domains are consistent.
340
+
341
+ Returns:
342
+ bool: True iff the configured universe domain is valid.
343
+
344
+ Raises:
345
+ ValueError: If the configured universe domain is not valid.
346
+ """
347
+
348
+ # NOTE (b/349488459): universe validation is disabled until further notice.
349
+ return True
350
+
351
+ def _add_cred_info_for_auth_errors(
352
+ self, error: core_exceptions.GoogleAPICallError
353
+ ) -> None:
354
+ """Adds credential info string to error details for 401/403/404 errors.
355
+
356
+ Args:
357
+ error (google.api_core.exceptions.GoogleAPICallError): The error to add the cred info.
358
+ """
359
+ if error.code not in [
360
+ HTTPStatus.UNAUTHORIZED,
361
+ HTTPStatus.FORBIDDEN,
362
+ HTTPStatus.NOT_FOUND,
363
+ ]:
364
+ return
365
+
366
+ cred = self._transport._credentials
367
+
368
+ # get_cred_info is only available in google-auth>=2.35.0
369
+ if not hasattr(cred, "get_cred_info"):
370
+ return
371
+
372
+ # ignore the type check since pypy test fails when get_cred_info
373
+ # is not available
374
+ cred_info = cred.get_cred_info() # type: ignore
375
+ if cred_info and hasattr(error._details, "append"):
376
+ error._details.append(json.dumps(cred_info))
377
+
378
+ @property
379
+ def api_endpoint(self) -> str:
380
+ """Return the API endpoint used by the client instance.
381
+
382
+ Returns:
383
+ str: The API endpoint used by the client instance.
384
+ """
385
+ return self._api_endpoint
386
+
387
+ @property
388
+ def universe_domain(self) -> str:
389
+ """Return the universe domain used by the client instance.
390
+
391
+ Returns:
392
+ str: The universe domain used by the client instance.
393
+ """
394
+ return self._universe_domain
395
+
396
+ def __init__(
397
+ self,
398
+ *,
399
+ credentials: Optional[ga_credentials.Credentials] = None,
400
+ transport: Optional[
401
+ Union[
402
+ str,
403
+ SqlBackupRunsServiceTransport,
404
+ Callable[..., SqlBackupRunsServiceTransport],
405
+ ]
406
+ ] = None,
407
+ client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None,
408
+ client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
409
+ ) -> None:
410
+ """Instantiates the sql backup runs service client.
411
+
412
+ Args:
413
+ credentials (Optional[google.auth.credentials.Credentials]): The
414
+ authorization credentials to attach to requests. These
415
+ credentials identify the application to the service; if none
416
+ are specified, the client will attempt to ascertain the
417
+ credentials from the environment.
418
+ transport (Optional[Union[str,SqlBackupRunsServiceTransport,Callable[..., SqlBackupRunsServiceTransport]]]):
419
+ The transport to use, or a Callable that constructs and returns a new transport.
420
+ If a Callable is given, it will be called with the same set of initialization
421
+ arguments as used in the SqlBackupRunsServiceTransport constructor.
422
+ If set to None, a transport is chosen automatically.
423
+ client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]):
424
+ Custom options for the client.
425
+
426
+ 1. The ``api_endpoint`` property can be used to override the
427
+ default endpoint provided by the client when ``transport`` is
428
+ not explicitly provided. Only if this property is not set and
429
+ ``transport`` was not explicitly provided, the endpoint is
430
+ determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment
431
+ variable, which have one of the following values:
432
+ "always" (always use the default mTLS endpoint), "never" (always
433
+ use the default regular endpoint) and "auto" (auto-switch to the
434
+ default mTLS endpoint if client certificate is present; this is
435
+ the default value).
436
+
437
+ 2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
438
+ is "true", then the ``client_cert_source`` property can be used
439
+ to provide a client certificate for mTLS transport. If
440
+ not provided, the default SSL client certificate will be used if
441
+ present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not
442
+ set, no client certificate will be used.
443
+
444
+ 3. The ``universe_domain`` property can be used to override the
445
+ default "googleapis.com" universe. Note that the ``api_endpoint``
446
+ property still takes precedence; and ``universe_domain`` is
447
+ currently not supported for mTLS.
448
+
449
+ client_info (google.api_core.gapic_v1.client_info.ClientInfo):
450
+ The client info used to send a user-agent string along with
451
+ API requests. If ``None``, then default info will be used.
452
+ Generally, you only need to set this if you're developing
453
+ your own client library.
454
+
455
+ Raises:
456
+ google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport
457
+ creation failed for any reason.
458
+ """
459
+ self._client_options = client_options
460
+ if isinstance(self._client_options, dict):
461
+ self._client_options = client_options_lib.from_dict(self._client_options)
462
+ if self._client_options is None:
463
+ self._client_options = client_options_lib.ClientOptions()
464
+ self._client_options = cast(
465
+ client_options_lib.ClientOptions, self._client_options
466
+ )
467
+
468
+ universe_domain_opt = getattr(self._client_options, "universe_domain", None)
469
+
470
+ self._use_client_cert, self._use_mtls_endpoint, self._universe_domain_env = (
471
+ read_environment_variables()
472
+ )
473
+ self._client_cert_source = SqlBackupRunsServiceClient._get_client_cert_source(
474
+ self._client_options.client_cert_source, self._use_client_cert
475
+ )
476
+ self._universe_domain = get_universe_domain(
477
+ universe_domain_opt,
478
+ self._universe_domain_env,
479
+ default_universe=SqlBackupRunsServiceClient._DEFAULT_UNIVERSE,
480
+ )
481
+ self._api_endpoint: str = "" # updated below, depending on `transport`
482
+
483
+ # Initialize the universe domain validation.
484
+ self._is_universe_domain_valid = False
485
+
486
+ if CLIENT_LOGGING_SUPPORTED: # pragma: NO COVER
487
+ # Setup logging.
488
+ client_logging.initialize_logging()
489
+
490
+ api_key_value = getattr(self._client_options, "api_key", None)
491
+ if api_key_value and credentials:
492
+ raise ValueError(
493
+ "client_options.api_key and credentials are mutually exclusive"
494
+ )
495
+
496
+ # Save or instantiate the transport.
497
+ # Ordinarily, we provide the transport, but allowing a custom transport
498
+ # instance provides an extensibility point for unusual situations.
499
+ transport_provided = isinstance(transport, SqlBackupRunsServiceTransport)
500
+ if transport_provided:
501
+ # transport is a SqlBackupRunsServiceTransport instance.
502
+ if credentials or self._client_options.credentials_file or api_key_value:
503
+ raise ValueError(
504
+ "When providing a transport instance, "
505
+ "provide its credentials directly."
506
+ )
507
+ if self._client_options.scopes:
508
+ raise ValueError(
509
+ "When providing a transport instance, provide its scopes directly."
510
+ )
511
+ self._transport = cast(SqlBackupRunsServiceTransport, transport)
512
+ self._api_endpoint = self._transport.host
513
+
514
+ self._api_endpoint = self._api_endpoint or get_api_endpoint(
515
+ api_override=self._client_options.api_endpoint,
516
+ universe_domain=self._universe_domain,
517
+ default_universe=SqlBackupRunsServiceClient._DEFAULT_UNIVERSE,
518
+ default_mtls_endpoint=SqlBackupRunsServiceClient.DEFAULT_MTLS_ENDPOINT,
519
+ default_endpoint_template=SqlBackupRunsServiceClient._DEFAULT_ENDPOINT_TEMPLATE,
520
+ use_mtls=self._use_mtls_endpoint == "always"
521
+ or (self._use_mtls_endpoint == "auto" and self._client_cert_source),
522
+ )
523
+
524
+ if not transport_provided:
525
+ import google.auth._default # type: ignore
526
+
527
+ if api_key_value and hasattr(
528
+ google.auth._default, "get_api_key_credentials"
529
+ ):
530
+ credentials = google.auth._default.get_api_key_credentials(
531
+ api_key_value
532
+ )
533
+
534
+ transport_init: Union[
535
+ Type[SqlBackupRunsServiceTransport],
536
+ Callable[..., SqlBackupRunsServiceTransport],
537
+ ] = (
538
+ SqlBackupRunsServiceClient.get_transport_class(transport)
539
+ if isinstance(transport, str) or transport is None
540
+ else cast(Callable[..., SqlBackupRunsServiceTransport], transport)
541
+ )
542
+ # initialize with the provided callable or the passed in class
543
+ self._transport = transport_init(
544
+ credentials=credentials,
545
+ credentials_file=self._client_options.credentials_file,
546
+ host=self._api_endpoint,
547
+ scopes=self._client_options.scopes,
548
+ client_cert_source_for_mtls=self._client_cert_source,
549
+ quota_project_id=self._client_options.quota_project_id,
550
+ client_info=client_info,
551
+ always_use_jwt_access=True,
552
+ api_audience=self._client_options.api_audience,
553
+ )
554
+
555
+ if "async" not in str(self._transport):
556
+ if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
557
+ std_logging.DEBUG
558
+ ): # pragma: NO COVER
559
+ _LOGGER.debug(
560
+ "Created client `google.cloud.sql_v1.SqlBackupRunsServiceClient`.",
561
+ extra={
562
+ "serviceName": "google.cloud.sql.v1.SqlBackupRunsService",
563
+ "universeDomain": getattr(
564
+ self._transport._credentials, "universe_domain", ""
565
+ ),
566
+ "credentialsType": f"{type(self._transport._credentials).__module__}.{type(self._transport._credentials).__qualname__}",
567
+ "credentialsInfo": getattr(
568
+ self.transport._credentials, "get_cred_info", lambda: None
569
+ )(),
570
+ }
571
+ if hasattr(self._transport, "_credentials")
572
+ else {
573
+ "serviceName": "google.cloud.sql.v1.SqlBackupRunsService",
574
+ "credentialsType": None,
575
+ },
576
+ )
577
+
578
+ def delete(
579
+ self,
580
+ request: Optional[
581
+ Union[cloud_sql_backup_runs.SqlBackupRunsDeleteRequest, dict]
582
+ ] = None,
583
+ *,
584
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
585
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
586
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
587
+ ) -> cloud_sql_resources.Operation:
588
+ r"""Deletes the backup taken by a backup run.
589
+
590
+ .. code-block:: python
591
+
592
+ # This snippet has been automatically generated and should be regarded as a
593
+ # code template only.
594
+ # It will require modifications to work:
595
+ # - It may require correct/in-range values for request initialization.
596
+ # - It may require specifying regional endpoints when creating the service
597
+ # client as shown in:
598
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
599
+ from google.cloud import sqladmin_v1
600
+
601
+ def sample_delete():
602
+ # Create a client
603
+ client = sqladmin_v1.SqlBackupRunsServiceClient()
604
+
605
+ # Initialize request argument(s)
606
+ request = sqladmin_v1.SqlBackupRunsDeleteRequest(
607
+ )
608
+
609
+ # Make the request
610
+ response = client.delete(request=request)
611
+
612
+ # Handle the response
613
+ print(response)
614
+
615
+ Args:
616
+ request (Union[google.cloud.sqladmin_v1.types.SqlBackupRunsDeleteRequest, dict]):
617
+ The request object. Backup runs delete request.
618
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
619
+ should be retried.
620
+ timeout (float): The timeout for this request.
621
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
622
+ sent along with the request as metadata. Normally, each value must be of type `str`,
623
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
624
+ be of type `bytes`.
625
+
626
+ Returns:
627
+ google.cloud.sqladmin_v1.types.Operation:
628
+ An Operation resource.&nbsp;For
629
+ successful operations that return an
630
+ Operation resource, only the fields
631
+ relevant to the operation are populated
632
+ in the resource.
633
+
634
+ """
635
+ # Create or coerce a protobuf request object.
636
+ # - Use the request object if provided (there's no risk of modifying the input as
637
+ # there are no flattened fields), or create one.
638
+ if not isinstance(request, cloud_sql_backup_runs.SqlBackupRunsDeleteRequest):
639
+ request = cloud_sql_backup_runs.SqlBackupRunsDeleteRequest(request)
640
+
641
+ # Wrap the RPC method; this adds retry and timeout information,
642
+ # and friendly error handling.
643
+ rpc = self._transport._wrapped_methods[self._transport.delete]
644
+
645
+ # Certain fields should be provided within the metadata header;
646
+ # add these here.
647
+ metadata = tuple(metadata) + (
648
+ gapic_v1.routing_header.to_grpc_metadata(
649
+ (
650
+ ("project", request.project),
651
+ ("instance", request.instance),
652
+ ("id", request.id),
653
+ )
654
+ ),
655
+ )
656
+
657
+ # Validate the universe domain.
658
+ self._validate_universe_domain()
659
+
660
+ # Send the request.
661
+ response = rpc(
662
+ request,
663
+ retry=retry,
664
+ timeout=timeout,
665
+ metadata=metadata,
666
+ )
667
+
668
+ # Done; return the response.
669
+ return response
670
+
671
+ def get(
672
+ self,
673
+ request: Optional[
674
+ Union[cloud_sql_backup_runs.SqlBackupRunsGetRequest, dict]
675
+ ] = None,
676
+ *,
677
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
678
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
679
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
680
+ ) -> cloud_sql_backup_runs.BackupRun:
681
+ r"""Retrieves a resource containing information about a
682
+ backup run.
683
+
684
+ .. code-block:: python
685
+
686
+ # This snippet has been automatically generated and should be regarded as a
687
+ # code template only.
688
+ # It will require modifications to work:
689
+ # - It may require correct/in-range values for request initialization.
690
+ # - It may require specifying regional endpoints when creating the service
691
+ # client as shown in:
692
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
693
+ from google.cloud import sqladmin_v1
694
+
695
+ def sample_get():
696
+ # Create a client
697
+ client = sqladmin_v1.SqlBackupRunsServiceClient()
698
+
699
+ # Initialize request argument(s)
700
+ request = sqladmin_v1.SqlBackupRunsGetRequest(
701
+ )
702
+
703
+ # Make the request
704
+ response = client.get(request=request)
705
+
706
+ # Handle the response
707
+ print(response)
708
+
709
+ Args:
710
+ request (Union[google.cloud.sqladmin_v1.types.SqlBackupRunsGetRequest, dict]):
711
+ The request object. Backup runs get request.
712
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
713
+ should be retried.
714
+ timeout (float): The timeout for this request.
715
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
716
+ sent along with the request as metadata. Normally, each value must be of type `str`,
717
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
718
+ be of type `bytes`.
719
+
720
+ Returns:
721
+ google.cloud.sqladmin_v1.types.BackupRun:
722
+ A BackupRun resource.
723
+ """
724
+ # Create or coerce a protobuf request object.
725
+ # - Use the request object if provided (there's no risk of modifying the input as
726
+ # there are no flattened fields), or create one.
727
+ if not isinstance(request, cloud_sql_backup_runs.SqlBackupRunsGetRequest):
728
+ request = cloud_sql_backup_runs.SqlBackupRunsGetRequest(request)
729
+
730
+ # Wrap the RPC method; this adds retry and timeout information,
731
+ # and friendly error handling.
732
+ rpc = self._transport._wrapped_methods[self._transport.get]
733
+
734
+ # Certain fields should be provided within the metadata header;
735
+ # add these here.
736
+ metadata = tuple(metadata) + (
737
+ gapic_v1.routing_header.to_grpc_metadata(
738
+ (
739
+ ("project", request.project),
740
+ ("instance", request.instance),
741
+ ("id", request.id),
742
+ )
743
+ ),
744
+ )
745
+
746
+ # Validate the universe domain.
747
+ self._validate_universe_domain()
748
+
749
+ # Send the request.
750
+ response = rpc(
751
+ request,
752
+ retry=retry,
753
+ timeout=timeout,
754
+ metadata=metadata,
755
+ )
756
+
757
+ # Done; return the response.
758
+ return response
759
+
760
+ def insert(
761
+ self,
762
+ request: Optional[
763
+ Union[cloud_sql_backup_runs.SqlBackupRunsInsertRequest, dict]
764
+ ] = None,
765
+ *,
766
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
767
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
768
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
769
+ ) -> cloud_sql_resources.Operation:
770
+ r"""Creates a new backup run on demand.
771
+
772
+ .. code-block:: python
773
+
774
+ # This snippet has been automatically generated and should be regarded as a
775
+ # code template only.
776
+ # It will require modifications to work:
777
+ # - It may require correct/in-range values for request initialization.
778
+ # - It may require specifying regional endpoints when creating the service
779
+ # client as shown in:
780
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
781
+ from google.cloud import sqladmin_v1
782
+
783
+ def sample_insert():
784
+ # Create a client
785
+ client = sqladmin_v1.SqlBackupRunsServiceClient()
786
+
787
+ # Initialize request argument(s)
788
+ request = sqladmin_v1.SqlBackupRunsInsertRequest(
789
+ )
790
+
791
+ # Make the request
792
+ response = client.insert(request=request)
793
+
794
+ # Handle the response
795
+ print(response)
796
+
797
+ Args:
798
+ request (Union[google.cloud.sqladmin_v1.types.SqlBackupRunsInsertRequest, dict]):
799
+ The request object. Backup runs insert request.
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.Operation:
810
+ An Operation resource.&nbsp;For
811
+ successful operations that return an
812
+ Operation resource, only the fields
813
+ relevant to the operation are populated
814
+ in the resource.
815
+
816
+ """
817
+ # Create or coerce a protobuf request object.
818
+ # - Use the request object if provided (there's no risk of modifying the input as
819
+ # there are no flattened fields), or create one.
820
+ if not isinstance(request, cloud_sql_backup_runs.SqlBackupRunsInsertRequest):
821
+ request = cloud_sql_backup_runs.SqlBackupRunsInsertRequest(request)
822
+
823
+ # Wrap the RPC method; this adds retry and timeout information,
824
+ # and friendly error handling.
825
+ rpc = self._transport._wrapped_methods[self._transport.insert]
826
+
827
+ # Certain fields should be provided within the metadata header;
828
+ # add these here.
829
+ metadata = tuple(metadata) + (
830
+ gapic_v1.routing_header.to_grpc_metadata(
831
+ (
832
+ ("project", request.project),
833
+ ("instance", request.instance),
834
+ )
835
+ ),
836
+ )
837
+
838
+ # Validate the universe domain.
839
+ self._validate_universe_domain()
840
+
841
+ # Send the request.
842
+ response = rpc(
843
+ request,
844
+ retry=retry,
845
+ timeout=timeout,
846
+ metadata=metadata,
847
+ )
848
+
849
+ # Done; return the response.
850
+ return response
851
+
852
+ def list(
853
+ self,
854
+ request: Optional[
855
+ Union[cloud_sql_backup_runs.SqlBackupRunsListRequest, dict]
856
+ ] = None,
857
+ *,
858
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
859
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
860
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
861
+ ) -> pagers.ListPager:
862
+ r"""Lists all backup runs associated with the project or
863
+ a given instance and configuration in the reverse
864
+ chronological order of the backup initiation time.
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_v1
876
+
877
+ def sample_list():
878
+ # Create a client
879
+ client = sqladmin_v1.SqlBackupRunsServiceClient()
880
+
881
+ # Initialize request argument(s)
882
+ request = sqladmin_v1.SqlBackupRunsListRequest(
883
+ )
884
+
885
+ # Make the request
886
+ page_result = client.list(request=request)
887
+
888
+ # Handle the response
889
+ for response in page_result:
890
+ print(response)
891
+
892
+ Args:
893
+ request (Union[google.cloud.sqladmin_v1.types.SqlBackupRunsListRequest, dict]):
894
+ The request object. Backup runs list request.
895
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
896
+ should be retried.
897
+ timeout (float): The timeout for this request.
898
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
899
+ sent along with the request as metadata. Normally, each value must be of type `str`,
900
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
901
+ be of type `bytes`.
902
+
903
+ Returns:
904
+ google.cloud.sqladmin_v1.services.sql_backup_runs_service.pagers.ListPager:
905
+ Backup run list results.
906
+
907
+ Iterating over this object will yield
908
+ results and resolve additional pages
909
+ automatically.
910
+
911
+ """
912
+ # Create or coerce a protobuf request object.
913
+ # - Use the request object if provided (there's no risk of modifying the input as
914
+ # there are no flattened fields), or create one.
915
+ if not isinstance(request, cloud_sql_backup_runs.SqlBackupRunsListRequest):
916
+ request = cloud_sql_backup_runs.SqlBackupRunsListRequest(request)
917
+
918
+ # Wrap the RPC method; this adds retry and timeout information,
919
+ # and friendly error handling.
920
+ rpc = self._transport._wrapped_methods[self._transport.list]
921
+
922
+ # Certain fields should be provided within the metadata header;
923
+ # add these here.
924
+ metadata = tuple(metadata) + (
925
+ gapic_v1.routing_header.to_grpc_metadata(
926
+ (
927
+ ("project", request.project),
928
+ ("instance", request.instance),
929
+ )
930
+ ),
931
+ )
932
+
933
+ # Validate the universe domain.
934
+ self._validate_universe_domain()
935
+
936
+ # Send the request.
937
+ response = rpc(
938
+ request,
939
+ retry=retry,
940
+ timeout=timeout,
941
+ metadata=metadata,
942
+ )
943
+
944
+ # This method is paged; wrap the response in a pager, which provides
945
+ # an `__iter__` convenience method.
946
+ response = pagers.ListPager(
947
+ method=rpc,
948
+ request=request,
949
+ response=response,
950
+ retry=retry,
951
+ timeout=timeout,
952
+ metadata=metadata,
953
+ )
954
+
955
+ # Done; return the response.
956
+ return response
957
+
958
+ def __enter__(self) -> "SqlBackupRunsServiceClient":
959
+ return self
960
+
961
+ def __exit__(self, type, value, traceback):
962
+ """Releases underlying transport's resources.
963
+
964
+ .. warning::
965
+ ONLY use as a context manager if the transport is NOT shared
966
+ with other clients! Exiting the with block will CLOSE the transport
967
+ and may cause errors in other clients!
968
+ """
969
+ self.transport.close()
970
+
971
+
972
+ DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
973
+ gapic_version=package_version.__version__
974
+ )
975
+ DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
976
+
977
+ __all__ = ("SqlBackupRunsServiceClient",)