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,4715 @@
1
+ # -*- coding: utf-8 -*-
2
+ # Copyright 2026 Google LLC
3
+ #
4
+ # Licensed under the Apache License, Version 2.0 (the "License");
5
+ # you may not use this file except in compliance with the License.
6
+ # You may obtain a copy of the License at
7
+ #
8
+ # http://www.apache.org/licenses/LICENSE-2.0
9
+ #
10
+ # Unless required by applicable law or agreed to in writing, software
11
+ # distributed under the License is distributed on an "AS IS" BASIS,
12
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+ # See the License for the specific language governing permissions and
14
+ # limitations under the License.
15
+ #
16
+ import json
17
+ import logging as std_logging
18
+ import os
19
+ import re
20
+ import warnings
21
+ from collections import OrderedDict
22
+ from http import HTTPStatus
23
+ from typing import (
24
+ Callable,
25
+ Dict,
26
+ Mapping,
27
+ MutableMapping,
28
+ MutableSequence,
29
+ Optional,
30
+ Sequence,
31
+ Tuple,
32
+ Type,
33
+ Union,
34
+ cast,
35
+ )
36
+
37
+ import google.protobuf
38
+ from google.api_core import client_options as client_options_lib
39
+ from google.api_core import exceptions as core_exceptions
40
+ from google.api_core import gapic_v1
41
+ from google.api_core import retry as retries
42
+ from google.auth import credentials as ga_credentials # type: ignore
43
+ from google.auth.exceptions import MutualTLSChannelError # type: ignore
44
+ from google.auth.transport import mtls # type: ignore
45
+ from google.auth.transport.grpc import SslCredentials # type: ignore
46
+ from google.oauth2 import service_account # type: ignore
47
+
48
+ from google.cloud.sqladmin_v1beta4 import gapic_version as package_version
49
+ from google.cloud.sqladmin_v1beta4._compat import (
50
+ get_api_endpoint,
51
+ get_default_mtls_endpoint,
52
+ get_universe_domain,
53
+ read_environment_variables,
54
+ should_use_client_cert,
55
+ )
56
+
57
+ try:
58
+ OptionalRetry = Union[retries.Retry, gapic_v1.method._MethodDefault, None]
59
+ except AttributeError: # pragma: NO COVER
60
+ OptionalRetry = Union[retries.Retry, object, None] # type: ignore
61
+
62
+ try:
63
+ from google.api_core import client_logging # type: ignore
64
+
65
+ CLIENT_LOGGING_SUPPORTED = True # pragma: NO COVER
66
+ except ImportError: # pragma: NO COVER
67
+ CLIENT_LOGGING_SUPPORTED = False
68
+
69
+ _LOGGER = std_logging.getLogger(__name__)
70
+
71
+ import google.protobuf.timestamp_pb2 as timestamp_pb2 # type: ignore
72
+ import google.protobuf.wrappers_pb2 as wrappers_pb2 # type: ignore
73
+ import google.rpc.status_pb2 as status_pb2 # type: ignore
74
+ from google.cloud.location import locations_pb2 # type: ignore
75
+ from google.longrunning import operations_pb2 # type: ignore
76
+
77
+ from google.cloud.sqladmin_v1beta4.services.sql_instances_service import pagers
78
+ from google.cloud.sqladmin_v1beta4.types import cloud_sql, cloud_sql_resources
79
+
80
+ from .transports.base import DEFAULT_CLIENT_INFO, SqlInstancesServiceTransport
81
+ from .transports.grpc import SqlInstancesServiceGrpcTransport
82
+ from .transports.grpc_asyncio import SqlInstancesServiceGrpcAsyncIOTransport
83
+ from .transports.rest import SqlInstancesServiceRestTransport
84
+
85
+
86
+ class SqlInstancesServiceClientMeta(type):
87
+ """Metaclass for the SqlInstancesService client.
88
+
89
+ This provides class-level methods for building and retrieving
90
+ support objects (e.g. transport) without polluting the client instance
91
+ objects.
92
+ """
93
+
94
+ _transport_registry = OrderedDict() # type: Dict[str, Type[SqlInstancesServiceTransport]]
95
+ _transport_registry["grpc"] = SqlInstancesServiceGrpcTransport
96
+ _transport_registry["grpc_asyncio"] = SqlInstancesServiceGrpcAsyncIOTransport
97
+ _transport_registry["rest"] = SqlInstancesServiceRestTransport
98
+
99
+ def get_transport_class(
100
+ cls,
101
+ label: Optional[str] = None,
102
+ ) -> Type[SqlInstancesServiceTransport]:
103
+ """Returns an appropriate transport class.
104
+
105
+ Args:
106
+ label: The name of the desired transport. If none is
107
+ provided, then the first transport in the registry is used.
108
+
109
+ Returns:
110
+ The transport class to use.
111
+ """
112
+ # If a specific transport is requested, return that one.
113
+ if label:
114
+ return cls._transport_registry[label]
115
+
116
+ # No transport is requested; return the default (that is, the first one
117
+ # in the dictionary).
118
+ return next(iter(cls._transport_registry.values()))
119
+
120
+
121
+ class SqlInstancesServiceClient(metaclass=SqlInstancesServiceClientMeta):
122
+ """"""
123
+
124
+ # Note: DEFAULT_ENDPOINT is deprecated. Use _DEFAULT_ENDPOINT_TEMPLATE instead.
125
+ DEFAULT_ENDPOINT = "sqladmin.googleapis.com"
126
+ DEFAULT_MTLS_ENDPOINT = get_default_mtls_endpoint(DEFAULT_ENDPOINT)
127
+
128
+ _DEFAULT_ENDPOINT_TEMPLATE = "sqladmin.{UNIVERSE_DOMAIN}"
129
+ _DEFAULT_UNIVERSE = "googleapis.com"
130
+
131
+ @classmethod
132
+ def from_service_account_info(cls, info: dict, *args, **kwargs):
133
+ """Creates an instance of this client using the provided credentials
134
+ info.
135
+
136
+ Args:
137
+ info (dict): The service account private key info.
138
+ args: Additional arguments to pass to the constructor.
139
+ kwargs: Additional arguments to pass to the constructor.
140
+
141
+ Returns:
142
+ SqlInstancesServiceClient: The constructed client.
143
+ """
144
+ credentials = service_account.Credentials.from_service_account_info(info)
145
+ kwargs["credentials"] = credentials
146
+ return cls(*args, **kwargs)
147
+
148
+ @classmethod
149
+ def from_service_account_file(cls, filename: str, *args, **kwargs):
150
+ """Creates an instance of this client using the provided credentials
151
+ file.
152
+
153
+ Args:
154
+ filename (str): The path to the service account private key json
155
+ file.
156
+ args: Additional arguments to pass to the constructor.
157
+ kwargs: Additional arguments to pass to the constructor.
158
+
159
+ Returns:
160
+ SqlInstancesServiceClient: The constructed client.
161
+ """
162
+ credentials = service_account.Credentials.from_service_account_file(filename)
163
+ kwargs["credentials"] = credentials
164
+ return cls(*args, **kwargs)
165
+
166
+ from_service_account_json = from_service_account_file
167
+
168
+ @property
169
+ def transport(self) -> SqlInstancesServiceTransport:
170
+ """Returns the transport used by the client instance.
171
+
172
+ Returns:
173
+ SqlInstancesServiceTransport: The transport used by the client
174
+ instance.
175
+ """
176
+ return self._transport
177
+
178
+ @staticmethod
179
+ def backup_path(
180
+ project: str,
181
+ backup: str,
182
+ ) -> str:
183
+ """Returns a fully-qualified backup string."""
184
+ return "projects/{project}/backups/{backup}".format(
185
+ project=project,
186
+ backup=backup,
187
+ )
188
+
189
+ @staticmethod
190
+ def parse_backup_path(path: str) -> Dict[str, str]:
191
+ """Parses a backup path into its component segments."""
192
+ m = re.match(r"^projects/(?P<project>.+?)/backups/(?P<backup>.+?)$", path)
193
+ return m.groupdict() if m else {}
194
+
195
+ @staticmethod
196
+ def backup_dr_backup_path(
197
+ project: str,
198
+ location: str,
199
+ backupvault: str,
200
+ datasource: str,
201
+ backup: str,
202
+ ) -> str:
203
+ """Returns a fully-qualified backup_dr_backup string."""
204
+ return "projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}".format(
205
+ project=project,
206
+ location=location,
207
+ backupvault=backupvault,
208
+ datasource=datasource,
209
+ backup=backup,
210
+ )
211
+
212
+ @staticmethod
213
+ def parse_backup_dr_backup_path(path: str) -> Dict[str, str]:
214
+ """Parses a backup_dr_backup path into its component segments."""
215
+ m = re.match(
216
+ r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/backupVaults/(?P<backupvault>.+?)/dataSources/(?P<datasource>.+?)/backups/(?P<backup>.+?)$",
217
+ path,
218
+ )
219
+ return m.groupdict() if m else {}
220
+
221
+ @staticmethod
222
+ def network_path(
223
+ project: str,
224
+ network: str,
225
+ ) -> str:
226
+ """Returns a fully-qualified network string."""
227
+ return "projects/{project}/global/networks/{network}".format(
228
+ project=project,
229
+ network=network,
230
+ )
231
+
232
+ @staticmethod
233
+ def parse_network_path(path: str) -> Dict[str, str]:
234
+ """Parses a network path into its component segments."""
235
+ m = re.match(
236
+ r"^projects/(?P<project>.+?)/global/networks/(?P<network>.+?)$", path
237
+ )
238
+ return m.groupdict() if m else {}
239
+
240
+ @staticmethod
241
+ def secret_version_path(
242
+ project: str,
243
+ secret: str,
244
+ secret_version: str,
245
+ ) -> str:
246
+ """Returns a fully-qualified secret_version string."""
247
+ return "projects/{project}/secrets/{secret}/versions/{secret_version}".format(
248
+ project=project,
249
+ secret=secret,
250
+ secret_version=secret_version,
251
+ )
252
+
253
+ @staticmethod
254
+ def parse_secret_version_path(path: str) -> Dict[str, str]:
255
+ """Parses a secret_version path into its component segments."""
256
+ m = re.match(
257
+ r"^projects/(?P<project>.+?)/secrets/(?P<secret>.+?)/versions/(?P<secret_version>.+?)$",
258
+ path,
259
+ )
260
+ return m.groupdict() if m else {}
261
+
262
+ @staticmethod
263
+ def service_connection_policy_path(
264
+ project: str,
265
+ region: str,
266
+ service_connection_policy: str,
267
+ ) -> str:
268
+ """Returns a fully-qualified service_connection_policy string."""
269
+ return "projects/{project}/regions/{region}/serviceConnectionPolicies/{service_connection_policy}".format(
270
+ project=project,
271
+ region=region,
272
+ service_connection_policy=service_connection_policy,
273
+ )
274
+
275
+ @staticmethod
276
+ def parse_service_connection_policy_path(path: str) -> Dict[str, str]:
277
+ """Parses a service_connection_policy path into its component segments."""
278
+ m = re.match(
279
+ r"^projects/(?P<project>.+?)/regions/(?P<region>.+?)/serviceConnectionPolicies/(?P<service_connection_policy>.+?)$",
280
+ path,
281
+ )
282
+ return m.groupdict() if m else {}
283
+
284
+ @staticmethod
285
+ def common_billing_account_path(
286
+ billing_account: str,
287
+ ) -> str:
288
+ """Returns a fully-qualified billing_account string."""
289
+ return "billingAccounts/{billing_account}".format(
290
+ billing_account=billing_account,
291
+ )
292
+
293
+ @staticmethod
294
+ def parse_common_billing_account_path(path: str) -> Dict[str, str]:
295
+ """Parse a billing_account path into its component segments."""
296
+ m = re.match(r"^billingAccounts/(?P<billing_account>.+?)$", path)
297
+ return m.groupdict() if m else {}
298
+
299
+ @staticmethod
300
+ def common_folder_path(
301
+ folder: str,
302
+ ) -> str:
303
+ """Returns a fully-qualified folder string."""
304
+ return "folders/{folder}".format(
305
+ folder=folder,
306
+ )
307
+
308
+ @staticmethod
309
+ def parse_common_folder_path(path: str) -> Dict[str, str]:
310
+ """Parse a folder path into its component segments."""
311
+ m = re.match(r"^folders/(?P<folder>.+?)$", path)
312
+ return m.groupdict() if m else {}
313
+
314
+ @staticmethod
315
+ def common_organization_path(
316
+ organization: str,
317
+ ) -> str:
318
+ """Returns a fully-qualified organization string."""
319
+ return "organizations/{organization}".format(
320
+ organization=organization,
321
+ )
322
+
323
+ @staticmethod
324
+ def parse_common_organization_path(path: str) -> Dict[str, str]:
325
+ """Parse a organization path into its component segments."""
326
+ m = re.match(r"^organizations/(?P<organization>.+?)$", path)
327
+ return m.groupdict() if m else {}
328
+
329
+ @staticmethod
330
+ def common_project_path(
331
+ project: str,
332
+ ) -> str:
333
+ """Returns a fully-qualified project string."""
334
+ return "projects/{project}".format(
335
+ project=project,
336
+ )
337
+
338
+ @staticmethod
339
+ def parse_common_project_path(path: str) -> Dict[str, str]:
340
+ """Parse a project path into its component segments."""
341
+ m = re.match(r"^projects/(?P<project>.+?)$", path)
342
+ return m.groupdict() if m else {}
343
+
344
+ @staticmethod
345
+ def common_location_path(
346
+ project: str,
347
+ location: str,
348
+ ) -> str:
349
+ """Returns a fully-qualified location string."""
350
+ return "projects/{project}/locations/{location}".format(
351
+ project=project,
352
+ location=location,
353
+ )
354
+
355
+ @staticmethod
356
+ def parse_common_location_path(path: str) -> Dict[str, str]:
357
+ """Parse a location path into its component segments."""
358
+ m = re.match(r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)$", path)
359
+ return m.groupdict() if m else {}
360
+
361
+ @classmethod
362
+ def get_mtls_endpoint_and_cert_source(
363
+ cls, client_options: Optional[client_options_lib.ClientOptions] = None
364
+ ):
365
+ """Deprecated. Return the API endpoint and client cert source for mutual TLS.
366
+
367
+ The client cert source is determined in the following order:
368
+ (1) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is not "true", the
369
+ client cert source is None.
370
+ (2) if `client_options.client_cert_source` is provided, use the provided one; if the
371
+ default client cert source exists, use the default one; otherwise the client cert
372
+ source is None.
373
+
374
+ The API endpoint is determined in the following order:
375
+ (1) if `client_options.api_endpoint` if provided, use the provided one.
376
+ (2) if `GOOGLE_API_USE_CLIENT_CERTIFICATE` environment variable is "always", use the
377
+ default mTLS endpoint; if the environment variable is "never", use the default API
378
+ endpoint; otherwise if client cert source exists, use the default mTLS endpoint, otherwise
379
+ use the default API endpoint.
380
+
381
+ More details can be found at https://google.aip.dev/auth/4114.
382
+
383
+ Args:
384
+ client_options (google.api_core.client_options.ClientOptions): Custom options for the
385
+ client. Only the `api_endpoint` and `client_cert_source` properties may be used
386
+ in this method.
387
+
388
+ Returns:
389
+ Tuple[str, Callable[[], Tuple[bytes, bytes]]]: returns the API endpoint and the
390
+ client cert source to use.
391
+
392
+ Raises:
393
+ google.auth.exceptions.MutualTLSChannelError: If any errors happen.
394
+ """
395
+
396
+ warnings.warn(
397
+ "get_mtls_endpoint_and_cert_source is deprecated. Use the api_endpoint property instead.",
398
+ DeprecationWarning,
399
+ )
400
+ if client_options is None:
401
+ client_options = client_options_lib.ClientOptions()
402
+ use_client_cert = should_use_client_cert()
403
+ use_mtls_endpoint = os.getenv("GOOGLE_API_USE_MTLS_ENDPOINT", "auto")
404
+ if use_mtls_endpoint not in ("auto", "never", "always"):
405
+ raise MutualTLSChannelError(
406
+ "Environment variable `GOOGLE_API_USE_MTLS_ENDPOINT` must be `never`, `auto` or `always`"
407
+ )
408
+
409
+ # Figure out the client cert source to use.
410
+ client_cert_source = None
411
+ if use_client_cert:
412
+ if client_options.client_cert_source:
413
+ client_cert_source = client_options.client_cert_source
414
+ elif mtls.has_default_client_cert_source():
415
+ client_cert_source = mtls.default_client_cert_source()
416
+
417
+ # Figure out which api endpoint to use.
418
+ if client_options.api_endpoint is not None:
419
+ api_endpoint = client_options.api_endpoint
420
+ elif use_mtls_endpoint == "always" or (
421
+ use_mtls_endpoint == "auto" and client_cert_source
422
+ ):
423
+ api_endpoint = cls.DEFAULT_MTLS_ENDPOINT # type: ignore
424
+ else:
425
+ api_endpoint = cls.DEFAULT_ENDPOINT
426
+
427
+ return api_endpoint, client_cert_source
428
+
429
+ @staticmethod
430
+ def _get_client_cert_source(provided_cert_source, use_cert_flag):
431
+ """Return the client cert source to be used by the client.
432
+
433
+ Args:
434
+ provided_cert_source (bytes): The client certificate source provided.
435
+ use_cert_flag (bool): A flag indicating whether to use the client certificate.
436
+
437
+ Returns:
438
+ bytes or None: The client cert source to be used by the client.
439
+ """
440
+ client_cert_source = None
441
+ if use_cert_flag:
442
+ if provided_cert_source:
443
+ client_cert_source = provided_cert_source
444
+ elif mtls.has_default_client_cert_source():
445
+ client_cert_source = mtls.default_client_cert_source()
446
+ return client_cert_source
447
+
448
+ def _validate_universe_domain(self):
449
+ """Validates client's and credentials' universe domains are consistent.
450
+
451
+ Returns:
452
+ bool: True iff the configured universe domain is valid.
453
+
454
+ Raises:
455
+ ValueError: If the configured universe domain is not valid.
456
+ """
457
+
458
+ # NOTE (b/349488459): universe validation is disabled until further notice.
459
+ return True
460
+
461
+ def _add_cred_info_for_auth_errors(
462
+ self, error: core_exceptions.GoogleAPICallError
463
+ ) -> None:
464
+ """Adds credential info string to error details for 401/403/404 errors.
465
+
466
+ Args:
467
+ error (google.api_core.exceptions.GoogleAPICallError): The error to add the cred info.
468
+ """
469
+ if error.code not in [
470
+ HTTPStatus.UNAUTHORIZED,
471
+ HTTPStatus.FORBIDDEN,
472
+ HTTPStatus.NOT_FOUND,
473
+ ]:
474
+ return
475
+
476
+ cred = self._transport._credentials
477
+
478
+ # get_cred_info is only available in google-auth>=2.35.0
479
+ if not hasattr(cred, "get_cred_info"):
480
+ return
481
+
482
+ # ignore the type check since pypy test fails when get_cred_info
483
+ # is not available
484
+ cred_info = cred.get_cred_info() # type: ignore
485
+ if cred_info and hasattr(error._details, "append"):
486
+ error._details.append(json.dumps(cred_info))
487
+
488
+ @property
489
+ def api_endpoint(self) -> str:
490
+ """Return the API endpoint used by the client instance.
491
+
492
+ Returns:
493
+ str: The API endpoint used by the client instance.
494
+ """
495
+ return self._api_endpoint
496
+
497
+ @property
498
+ def universe_domain(self) -> str:
499
+ """Return the universe domain used by the client instance.
500
+
501
+ Returns:
502
+ str: The universe domain used by the client instance.
503
+ """
504
+ return self._universe_domain
505
+
506
+ def __init__(
507
+ self,
508
+ *,
509
+ credentials: Optional[ga_credentials.Credentials] = None,
510
+ transport: Optional[
511
+ Union[
512
+ str,
513
+ SqlInstancesServiceTransport,
514
+ Callable[..., SqlInstancesServiceTransport],
515
+ ]
516
+ ] = None,
517
+ client_options: Optional[Union[client_options_lib.ClientOptions, dict]] = None,
518
+ client_info: gapic_v1.client_info.ClientInfo = DEFAULT_CLIENT_INFO,
519
+ ) -> None:
520
+ """Instantiates the sql instances service client.
521
+
522
+ Args:
523
+ credentials (Optional[google.auth.credentials.Credentials]): The
524
+ authorization credentials to attach to requests. These
525
+ credentials identify the application to the service; if none
526
+ are specified, the client will attempt to ascertain the
527
+ credentials from the environment.
528
+ transport (Optional[Union[str,SqlInstancesServiceTransport,Callable[..., SqlInstancesServiceTransport]]]):
529
+ The transport to use, or a Callable that constructs and returns a new transport.
530
+ If a Callable is given, it will be called with the same set of initialization
531
+ arguments as used in the SqlInstancesServiceTransport constructor.
532
+ If set to None, a transport is chosen automatically.
533
+ client_options (Optional[Union[google.api_core.client_options.ClientOptions, dict]]):
534
+ Custom options for the client.
535
+
536
+ 1. The ``api_endpoint`` property can be used to override the
537
+ default endpoint provided by the client when ``transport`` is
538
+ not explicitly provided. Only if this property is not set and
539
+ ``transport`` was not explicitly provided, the endpoint is
540
+ determined by the GOOGLE_API_USE_MTLS_ENDPOINT environment
541
+ variable, which have one of the following values:
542
+ "always" (always use the default mTLS endpoint), "never" (always
543
+ use the default regular endpoint) and "auto" (auto-switch to the
544
+ default mTLS endpoint if client certificate is present; this is
545
+ the default value).
546
+
547
+ 2. If the GOOGLE_API_USE_CLIENT_CERTIFICATE environment variable
548
+ is "true", then the ``client_cert_source`` property can be used
549
+ to provide a client certificate for mTLS transport. If
550
+ not provided, the default SSL client certificate will be used if
551
+ present. If GOOGLE_API_USE_CLIENT_CERTIFICATE is "false" or not
552
+ set, no client certificate will be used.
553
+
554
+ 3. The ``universe_domain`` property can be used to override the
555
+ default "googleapis.com" universe. Note that the ``api_endpoint``
556
+ property still takes precedence; and ``universe_domain`` is
557
+ currently not supported for mTLS.
558
+
559
+ client_info (google.api_core.gapic_v1.client_info.ClientInfo):
560
+ The client info used to send a user-agent string along with
561
+ API requests. If ``None``, then default info will be used.
562
+ Generally, you only need to set this if you're developing
563
+ your own client library.
564
+
565
+ Raises:
566
+ google.auth.exceptions.MutualTLSChannelError: If mutual TLS transport
567
+ creation failed for any reason.
568
+ """
569
+ self._client_options = client_options
570
+ if isinstance(self._client_options, dict):
571
+ self._client_options = client_options_lib.from_dict(self._client_options)
572
+ if self._client_options is None:
573
+ self._client_options = client_options_lib.ClientOptions()
574
+ self._client_options = cast(
575
+ client_options_lib.ClientOptions, self._client_options
576
+ )
577
+
578
+ universe_domain_opt = getattr(self._client_options, "universe_domain", None)
579
+
580
+ self._use_client_cert, self._use_mtls_endpoint, self._universe_domain_env = (
581
+ read_environment_variables()
582
+ )
583
+ self._client_cert_source = SqlInstancesServiceClient._get_client_cert_source(
584
+ self._client_options.client_cert_source, self._use_client_cert
585
+ )
586
+ self._universe_domain = get_universe_domain(
587
+ universe_domain_opt,
588
+ self._universe_domain_env,
589
+ default_universe=SqlInstancesServiceClient._DEFAULT_UNIVERSE,
590
+ )
591
+ self._api_endpoint: str = "" # updated below, depending on `transport`
592
+
593
+ # Initialize the universe domain validation.
594
+ self._is_universe_domain_valid = False
595
+
596
+ if CLIENT_LOGGING_SUPPORTED: # pragma: NO COVER
597
+ # Setup logging.
598
+ client_logging.initialize_logging()
599
+
600
+ api_key_value = getattr(self._client_options, "api_key", None)
601
+ if api_key_value and credentials:
602
+ raise ValueError(
603
+ "client_options.api_key and credentials are mutually exclusive"
604
+ )
605
+
606
+ # Save or instantiate the transport.
607
+ # Ordinarily, we provide the transport, but allowing a custom transport
608
+ # instance provides an extensibility point for unusual situations.
609
+ transport_provided = isinstance(transport, SqlInstancesServiceTransport)
610
+ if transport_provided:
611
+ # transport is a SqlInstancesServiceTransport instance.
612
+ if credentials or self._client_options.credentials_file or api_key_value:
613
+ raise ValueError(
614
+ "When providing a transport instance, "
615
+ "provide its credentials directly."
616
+ )
617
+ if self._client_options.scopes:
618
+ raise ValueError(
619
+ "When providing a transport instance, provide its scopes directly."
620
+ )
621
+ self._transport = cast(SqlInstancesServiceTransport, transport)
622
+ self._api_endpoint = self._transport.host
623
+
624
+ self._api_endpoint = self._api_endpoint or get_api_endpoint(
625
+ api_override=self._client_options.api_endpoint,
626
+ universe_domain=self._universe_domain,
627
+ default_universe=SqlInstancesServiceClient._DEFAULT_UNIVERSE,
628
+ default_mtls_endpoint=SqlInstancesServiceClient.DEFAULT_MTLS_ENDPOINT,
629
+ default_endpoint_template=SqlInstancesServiceClient._DEFAULT_ENDPOINT_TEMPLATE,
630
+ use_mtls=self._use_mtls_endpoint == "always"
631
+ or (self._use_mtls_endpoint == "auto" and self._client_cert_source),
632
+ )
633
+
634
+ if not transport_provided:
635
+ import google.auth._default # type: ignore
636
+
637
+ if api_key_value and hasattr(
638
+ google.auth._default, "get_api_key_credentials"
639
+ ):
640
+ credentials = google.auth._default.get_api_key_credentials(
641
+ api_key_value
642
+ )
643
+
644
+ transport_init: Union[
645
+ Type[SqlInstancesServiceTransport],
646
+ Callable[..., SqlInstancesServiceTransport],
647
+ ] = (
648
+ SqlInstancesServiceClient.get_transport_class(transport)
649
+ if isinstance(transport, str) or transport is None
650
+ else cast(Callable[..., SqlInstancesServiceTransport], transport)
651
+ )
652
+ # initialize with the provided callable or the passed in class
653
+ self._transport = transport_init(
654
+ credentials=credentials,
655
+ credentials_file=self._client_options.credentials_file,
656
+ host=self._api_endpoint,
657
+ scopes=self._client_options.scopes,
658
+ client_cert_source_for_mtls=self._client_cert_source,
659
+ quota_project_id=self._client_options.quota_project_id,
660
+ client_info=client_info,
661
+ always_use_jwt_access=True,
662
+ api_audience=self._client_options.api_audience,
663
+ )
664
+
665
+ if "async" not in str(self._transport):
666
+ if CLIENT_LOGGING_SUPPORTED and _LOGGER.isEnabledFor(
667
+ std_logging.DEBUG
668
+ ): # pragma: NO COVER
669
+ _LOGGER.debug(
670
+ "Created client `google.cloud.sql_v1beta4.SqlInstancesServiceClient`.",
671
+ extra={
672
+ "serviceName": "google.cloud.sql.v1beta4.SqlInstancesService",
673
+ "universeDomain": getattr(
674
+ self._transport._credentials, "universe_domain", ""
675
+ ),
676
+ "credentialsType": f"{type(self._transport._credentials).__module__}.{type(self._transport._credentials).__qualname__}",
677
+ "credentialsInfo": getattr(
678
+ self.transport._credentials, "get_cred_info", lambda: None
679
+ )(),
680
+ }
681
+ if hasattr(self._transport, "_credentials")
682
+ else {
683
+ "serviceName": "google.cloud.sql.v1beta4.SqlInstancesService",
684
+ "credentialsType": None,
685
+ },
686
+ )
687
+
688
+ def add_server_ca(
689
+ self,
690
+ request: Optional[Union[cloud_sql.SqlInstancesAddServerCaRequest, dict]] = None,
691
+ *,
692
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
693
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
694
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
695
+ ) -> cloud_sql_resources.Operation:
696
+ r"""Add a new trusted Certificate Authority (CA) version
697
+ for the specified instance. Required to prepare for a
698
+ certificate rotation. If a CA version was previously
699
+ added but never used in a certificate rotation, this
700
+ operation replaces that version. There cannot be more
701
+ than one CA version waiting to be rotated in. For
702
+ instances that have enabled Certificate Authority
703
+ Service (CAS) based server CA, use AddServerCertificate
704
+ to add a new server certificate.
705
+
706
+ .. code-block:: python
707
+
708
+ # This snippet has been automatically generated and should be regarded as a
709
+ # code template only.
710
+ # It will require modifications to work:
711
+ # - It may require correct/in-range values for request initialization.
712
+ # - It may require specifying regional endpoints when creating the service
713
+ # client as shown in:
714
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
715
+ from google.cloud import sqladmin_v1beta4
716
+
717
+ def sample_add_server_ca():
718
+ # Create a client
719
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
720
+
721
+ # Initialize request argument(s)
722
+ request = sqladmin_v1beta4.SqlInstancesAddServerCaRequest(
723
+ )
724
+
725
+ # Make the request
726
+ response = client.add_server_ca(request=request)
727
+
728
+ # Handle the response
729
+ print(response)
730
+
731
+ Args:
732
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesAddServerCaRequest, dict]):
733
+ The request object.
734
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
735
+ should be retried.
736
+ timeout (float): The timeout for this request.
737
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
738
+ sent along with the request as metadata. Normally, each value must be of type `str`,
739
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
740
+ be of type `bytes`.
741
+
742
+ Returns:
743
+ google.cloud.sqladmin_v1beta4.types.Operation:
744
+ An Operation resource.&nbsp;For
745
+ successful operations that return an
746
+ Operation resource, only the fields
747
+ relevant to the operation are populated
748
+ in the resource.
749
+
750
+ """
751
+ # Create or coerce a protobuf request object.
752
+ # - Use the request object if provided (there's no risk of modifying the input as
753
+ # there are no flattened fields), or create one.
754
+ if not isinstance(request, cloud_sql.SqlInstancesAddServerCaRequest):
755
+ request = cloud_sql.SqlInstancesAddServerCaRequest(request)
756
+
757
+ # Wrap the RPC method; this adds retry and timeout information,
758
+ # and friendly error handling.
759
+ rpc = self._transport._wrapped_methods[self._transport.add_server_ca]
760
+
761
+ # Certain fields should be provided within the metadata header;
762
+ # add these here.
763
+ metadata = tuple(metadata) + (
764
+ gapic_v1.routing_header.to_grpc_metadata(
765
+ (
766
+ ("project", request.project),
767
+ ("instance", request.instance),
768
+ )
769
+ ),
770
+ )
771
+
772
+ # Validate the universe domain.
773
+ self._validate_universe_domain()
774
+
775
+ # Send the request.
776
+ response = rpc(
777
+ request,
778
+ retry=retry,
779
+ timeout=timeout,
780
+ metadata=metadata,
781
+ )
782
+
783
+ # Done; return the response.
784
+ return response
785
+
786
+ def add_server_certificate(
787
+ self,
788
+ request: Optional[
789
+ Union[cloud_sql.SqlInstancesAddServerCertificateRequest, dict]
790
+ ] = None,
791
+ *,
792
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
793
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
794
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
795
+ ) -> cloud_sql_resources.Operation:
796
+ r"""Add a new trusted server certificate version for the
797
+ specified instance using Certificate Authority Service
798
+ (CAS) server CA. Required to prepare for a certificate
799
+ rotation. If a server certificate version was previously
800
+ added but never used in a certificate rotation, this
801
+ operation replaces that version. There cannot be more
802
+ than one certificate version waiting to be rotated in.
803
+ For instances not using CAS server CA, use AddServerCa
804
+ instead.
805
+
806
+ .. code-block:: python
807
+
808
+ # This snippet has been automatically generated and should be regarded as a
809
+ # code template only.
810
+ # It will require modifications to work:
811
+ # - It may require correct/in-range values for request initialization.
812
+ # - It may require specifying regional endpoints when creating the service
813
+ # client as shown in:
814
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
815
+ from google.cloud import sqladmin_v1beta4
816
+
817
+ def sample_add_server_certificate():
818
+ # Create a client
819
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
820
+
821
+ # Initialize request argument(s)
822
+ request = sqladmin_v1beta4.SqlInstancesAddServerCertificateRequest(
823
+ instance="instance_value",
824
+ project="project_value",
825
+ )
826
+
827
+ # Make the request
828
+ response = client.add_server_certificate(request=request)
829
+
830
+ # Handle the response
831
+ print(response)
832
+
833
+ Args:
834
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesAddServerCertificateRequest, dict]):
835
+ The request object. Request for AddServerCertificate RPC.
836
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
837
+ should be retried.
838
+ timeout (float): The timeout for this request.
839
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
840
+ sent along with the request as metadata. Normally, each value must be of type `str`,
841
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
842
+ be of type `bytes`.
843
+
844
+ Returns:
845
+ google.cloud.sqladmin_v1beta4.types.Operation:
846
+ An Operation resource.&nbsp;For
847
+ successful operations that return an
848
+ Operation resource, only the fields
849
+ relevant to the operation are populated
850
+ in the resource.
851
+
852
+ """
853
+ # Create or coerce a protobuf request object.
854
+ # - Use the request object if provided (there's no risk of modifying the input as
855
+ # there are no flattened fields), or create one.
856
+ if not isinstance(request, cloud_sql.SqlInstancesAddServerCertificateRequest):
857
+ request = cloud_sql.SqlInstancesAddServerCertificateRequest(request)
858
+
859
+ # Wrap the RPC method; this adds retry and timeout information,
860
+ # and friendly error handling.
861
+ rpc = self._transport._wrapped_methods[self._transport.add_server_certificate]
862
+
863
+ # Certain fields should be provided within the metadata header;
864
+ # add these here.
865
+ metadata = tuple(metadata) + (
866
+ gapic_v1.routing_header.to_grpc_metadata(
867
+ (
868
+ ("project", request.project),
869
+ ("instance", request.instance),
870
+ )
871
+ ),
872
+ )
873
+
874
+ # Validate the universe domain.
875
+ self._validate_universe_domain()
876
+
877
+ # Send the request.
878
+ response = rpc(
879
+ request,
880
+ retry=retry,
881
+ timeout=timeout,
882
+ metadata=metadata,
883
+ )
884
+
885
+ # Done; return the response.
886
+ return response
887
+
888
+ def add_entra_id_certificate(
889
+ self,
890
+ request: Optional[
891
+ Union[cloud_sql.SqlInstancesAddEntraIdCertificateRequest, dict]
892
+ ] = None,
893
+ *,
894
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
895
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
896
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
897
+ ) -> cloud_sql_resources.Operation:
898
+ r"""Adds a new Entra ID certificate for the specified
899
+ instance. If an Entra ID certificate was previously
900
+ added but never used in a certificate rotation, this
901
+ operation replaces that version.
902
+
903
+ .. code-block:: python
904
+
905
+ # This snippet has been automatically generated and should be regarded as a
906
+ # code template only.
907
+ # It will require modifications to work:
908
+ # - It may require correct/in-range values for request initialization.
909
+ # - It may require specifying regional endpoints when creating the service
910
+ # client as shown in:
911
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
912
+ from google.cloud import sqladmin_v1beta4
913
+
914
+ def sample_add_entra_id_certificate():
915
+ # Create a client
916
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
917
+
918
+ # Initialize request argument(s)
919
+ request = sqladmin_v1beta4.SqlInstancesAddEntraIdCertificateRequest(
920
+ instance="instance_value",
921
+ project="project_value",
922
+ )
923
+
924
+ # Make the request
925
+ response = client.add_entra_id_certificate(request=request)
926
+
927
+ # Handle the response
928
+ print(response)
929
+
930
+ Args:
931
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesAddEntraIdCertificateRequest, dict]):
932
+ The request object. Request for AddEntraIdCertificate
933
+ RPC.
934
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
935
+ should be retried.
936
+ timeout (float): The timeout for this request.
937
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
938
+ sent along with the request as metadata. Normally, each value must be of type `str`,
939
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
940
+ be of type `bytes`.
941
+
942
+ Returns:
943
+ google.cloud.sqladmin_v1beta4.types.Operation:
944
+ An Operation resource.&nbsp;For
945
+ successful operations that return an
946
+ Operation resource, only the fields
947
+ relevant to the operation are populated
948
+ in the resource.
949
+
950
+ """
951
+ # Create or coerce a protobuf request object.
952
+ # - Use the request object if provided (there's no risk of modifying the input as
953
+ # there are no flattened fields), or create one.
954
+ if not isinstance(request, cloud_sql.SqlInstancesAddEntraIdCertificateRequest):
955
+ request = cloud_sql.SqlInstancesAddEntraIdCertificateRequest(request)
956
+
957
+ # Wrap the RPC method; this adds retry and timeout information,
958
+ # and friendly error handling.
959
+ rpc = self._transport._wrapped_methods[self._transport.add_entra_id_certificate]
960
+
961
+ # Certain fields should be provided within the metadata header;
962
+ # add these here.
963
+ metadata = tuple(metadata) + (
964
+ gapic_v1.routing_header.to_grpc_metadata(
965
+ (
966
+ ("project", request.project),
967
+ ("instance", request.instance),
968
+ )
969
+ ),
970
+ )
971
+
972
+ # Validate the universe domain.
973
+ self._validate_universe_domain()
974
+
975
+ # Send the request.
976
+ response = rpc(
977
+ request,
978
+ retry=retry,
979
+ timeout=timeout,
980
+ metadata=metadata,
981
+ )
982
+
983
+ # Done; return the response.
984
+ return response
985
+
986
+ def clone(
987
+ self,
988
+ request: Optional[Union[cloud_sql.SqlInstancesCloneRequest, dict]] = None,
989
+ *,
990
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
991
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
992
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
993
+ ) -> cloud_sql_resources.Operation:
994
+ r"""Creates a Cloud SQL instance as a clone of the source
995
+ instance. Using this operation might cause your instance
996
+ to restart.
997
+
998
+ .. code-block:: python
999
+
1000
+ # This snippet has been automatically generated and should be regarded as a
1001
+ # code template only.
1002
+ # It will require modifications to work:
1003
+ # - It may require correct/in-range values for request initialization.
1004
+ # - It may require specifying regional endpoints when creating the service
1005
+ # client as shown in:
1006
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
1007
+ from google.cloud import sqladmin_v1beta4
1008
+
1009
+ def sample_clone():
1010
+ # Create a client
1011
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
1012
+
1013
+ # Initialize request argument(s)
1014
+ request = sqladmin_v1beta4.SqlInstancesCloneRequest(
1015
+ )
1016
+
1017
+ # Make the request
1018
+ response = client.clone(request=request)
1019
+
1020
+ # Handle the response
1021
+ print(response)
1022
+
1023
+ Args:
1024
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesCloneRequest, dict]):
1025
+ The request object.
1026
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
1027
+ should be retried.
1028
+ timeout (float): The timeout for this request.
1029
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1030
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1031
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1032
+ be of type `bytes`.
1033
+
1034
+ Returns:
1035
+ google.cloud.sqladmin_v1beta4.types.Operation:
1036
+ An Operation resource.&nbsp;For
1037
+ successful operations that return an
1038
+ Operation resource, only the fields
1039
+ relevant to the operation are populated
1040
+ in the resource.
1041
+
1042
+ """
1043
+ # Create or coerce a protobuf request object.
1044
+ # - Use the request object if provided (there's no risk of modifying the input as
1045
+ # there are no flattened fields), or create one.
1046
+ if not isinstance(request, cloud_sql.SqlInstancesCloneRequest):
1047
+ request = cloud_sql.SqlInstancesCloneRequest(request)
1048
+
1049
+ # Wrap the RPC method; this adds retry and timeout information,
1050
+ # and friendly error handling.
1051
+ rpc = self._transport._wrapped_methods[self._transport.clone]
1052
+
1053
+ # Certain fields should be provided within the metadata header;
1054
+ # add these here.
1055
+ metadata = tuple(metadata) + (
1056
+ gapic_v1.routing_header.to_grpc_metadata(
1057
+ (
1058
+ ("project", request.project),
1059
+ ("instance", request.instance),
1060
+ )
1061
+ ),
1062
+ )
1063
+
1064
+ # Validate the universe domain.
1065
+ self._validate_universe_domain()
1066
+
1067
+ # Send the request.
1068
+ response = rpc(
1069
+ request,
1070
+ retry=retry,
1071
+ timeout=timeout,
1072
+ metadata=metadata,
1073
+ )
1074
+
1075
+ # Done; return the response.
1076
+ return response
1077
+
1078
+ def delete(
1079
+ self,
1080
+ request: Optional[Union[cloud_sql.SqlInstancesDeleteRequest, dict]] = None,
1081
+ *,
1082
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1083
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1084
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1085
+ ) -> cloud_sql_resources.Operation:
1086
+ r"""Deletes a Cloud SQL instance.
1087
+
1088
+ .. code-block:: python
1089
+
1090
+ # This snippet has been automatically generated and should be regarded as a
1091
+ # code template only.
1092
+ # It will require modifications to work:
1093
+ # - It may require correct/in-range values for request initialization.
1094
+ # - It may require specifying regional endpoints when creating the service
1095
+ # client as shown in:
1096
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
1097
+ from google.cloud import sqladmin_v1beta4
1098
+
1099
+ def sample_delete():
1100
+ # Create a client
1101
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
1102
+
1103
+ # Initialize request argument(s)
1104
+ request = sqladmin_v1beta4.SqlInstancesDeleteRequest(
1105
+ final_backup_ttl_days=2210,
1106
+ )
1107
+
1108
+ # Make the request
1109
+ response = client.delete(request=request)
1110
+
1111
+ # Handle the response
1112
+ print(response)
1113
+
1114
+ Args:
1115
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesDeleteRequest, dict]):
1116
+ The request object.
1117
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
1118
+ should be retried.
1119
+ timeout (float): The timeout for this request.
1120
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1121
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1122
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1123
+ be of type `bytes`.
1124
+
1125
+ Returns:
1126
+ google.cloud.sqladmin_v1beta4.types.Operation:
1127
+ An Operation resource.&nbsp;For
1128
+ successful operations that return an
1129
+ Operation resource, only the fields
1130
+ relevant to the operation are populated
1131
+ in the resource.
1132
+
1133
+ """
1134
+ # Create or coerce a protobuf request object.
1135
+ # - Use the request object if provided (there's no risk of modifying the input as
1136
+ # there are no flattened fields), or create one.
1137
+ if not isinstance(request, cloud_sql.SqlInstancesDeleteRequest):
1138
+ request = cloud_sql.SqlInstancesDeleteRequest(request)
1139
+
1140
+ # Wrap the RPC method; this adds retry and timeout information,
1141
+ # and friendly error handling.
1142
+ rpc = self._transport._wrapped_methods[self._transport.delete]
1143
+
1144
+ # Certain fields should be provided within the metadata header;
1145
+ # add these here.
1146
+ metadata = tuple(metadata) + (
1147
+ gapic_v1.routing_header.to_grpc_metadata(
1148
+ (
1149
+ ("project", request.project),
1150
+ ("instance", request.instance),
1151
+ )
1152
+ ),
1153
+ )
1154
+
1155
+ # Validate the universe domain.
1156
+ self._validate_universe_domain()
1157
+
1158
+ # Send the request.
1159
+ response = rpc(
1160
+ request,
1161
+ retry=retry,
1162
+ timeout=timeout,
1163
+ metadata=metadata,
1164
+ )
1165
+
1166
+ # Done; return the response.
1167
+ return response
1168
+
1169
+ def demote_master(
1170
+ self,
1171
+ request: Optional[
1172
+ Union[cloud_sql.SqlInstancesDemoteMasterRequest, dict]
1173
+ ] = None,
1174
+ *,
1175
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1176
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1177
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1178
+ ) -> cloud_sql_resources.Operation:
1179
+ r"""Demotes the stand-alone instance to be a Cloud SQL
1180
+ read replica for an external database server.
1181
+
1182
+ .. code-block:: python
1183
+
1184
+ # This snippet has been automatically generated and should be regarded as a
1185
+ # code template only.
1186
+ # It will require modifications to work:
1187
+ # - It may require correct/in-range values for request initialization.
1188
+ # - It may require specifying regional endpoints when creating the service
1189
+ # client as shown in:
1190
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
1191
+ from google.cloud import sqladmin_v1beta4
1192
+
1193
+ def sample_demote_master():
1194
+ # Create a client
1195
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
1196
+
1197
+ # Initialize request argument(s)
1198
+ request = sqladmin_v1beta4.SqlInstancesDemoteMasterRequest(
1199
+ )
1200
+
1201
+ # Make the request
1202
+ response = client.demote_master(request=request)
1203
+
1204
+ # Handle the response
1205
+ print(response)
1206
+
1207
+ Args:
1208
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesDemoteMasterRequest, dict]):
1209
+ The request object.
1210
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
1211
+ should be retried.
1212
+ timeout (float): The timeout for this request.
1213
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1214
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1215
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1216
+ be of type `bytes`.
1217
+
1218
+ Returns:
1219
+ google.cloud.sqladmin_v1beta4.types.Operation:
1220
+ An Operation resource.&nbsp;For
1221
+ successful operations that return an
1222
+ Operation resource, only the fields
1223
+ relevant to the operation are populated
1224
+ in the resource.
1225
+
1226
+ """
1227
+ # Create or coerce a protobuf request object.
1228
+ # - Use the request object if provided (there's no risk of modifying the input as
1229
+ # there are no flattened fields), or create one.
1230
+ if not isinstance(request, cloud_sql.SqlInstancesDemoteMasterRequest):
1231
+ request = cloud_sql.SqlInstancesDemoteMasterRequest(request)
1232
+
1233
+ # Wrap the RPC method; this adds retry and timeout information,
1234
+ # and friendly error handling.
1235
+ rpc = self._transport._wrapped_methods[self._transport.demote_master]
1236
+
1237
+ # Certain fields should be provided within the metadata header;
1238
+ # add these here.
1239
+ metadata = tuple(metadata) + (
1240
+ gapic_v1.routing_header.to_grpc_metadata(
1241
+ (
1242
+ ("project", request.project),
1243
+ ("instance", request.instance),
1244
+ )
1245
+ ),
1246
+ )
1247
+
1248
+ # Validate the universe domain.
1249
+ self._validate_universe_domain()
1250
+
1251
+ # Send the request.
1252
+ response = rpc(
1253
+ request,
1254
+ retry=retry,
1255
+ timeout=timeout,
1256
+ metadata=metadata,
1257
+ )
1258
+
1259
+ # Done; return the response.
1260
+ return response
1261
+
1262
+ def demote(
1263
+ self,
1264
+ request: Optional[Union[cloud_sql.SqlInstancesDemoteRequest, dict]] = None,
1265
+ *,
1266
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1267
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1268
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1269
+ ) -> cloud_sql_resources.Operation:
1270
+ r"""Demotes an existing standalone instance to be a Cloud
1271
+ SQL read replica for an external database server.
1272
+
1273
+ .. code-block:: python
1274
+
1275
+ # This snippet has been automatically generated and should be regarded as a
1276
+ # code template only.
1277
+ # It will require modifications to work:
1278
+ # - It may require correct/in-range values for request initialization.
1279
+ # - It may require specifying regional endpoints when creating the service
1280
+ # client as shown in:
1281
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
1282
+ from google.cloud import sqladmin_v1beta4
1283
+
1284
+ def sample_demote():
1285
+ # Create a client
1286
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
1287
+
1288
+ # Initialize request argument(s)
1289
+ request = sqladmin_v1beta4.SqlInstancesDemoteRequest(
1290
+ instance="instance_value",
1291
+ project="project_value",
1292
+ )
1293
+
1294
+ # Make the request
1295
+ response = client.demote(request=request)
1296
+
1297
+ # Handle the response
1298
+ print(response)
1299
+
1300
+ Args:
1301
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesDemoteRequest, dict]):
1302
+ The request object. Instance demote request.
1303
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
1304
+ should be retried.
1305
+ timeout (float): The timeout for this request.
1306
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1307
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1308
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1309
+ be of type `bytes`.
1310
+
1311
+ Returns:
1312
+ google.cloud.sqladmin_v1beta4.types.Operation:
1313
+ An Operation resource.&nbsp;For
1314
+ successful operations that return an
1315
+ Operation resource, only the fields
1316
+ relevant to the operation are populated
1317
+ in the resource.
1318
+
1319
+ """
1320
+ # Create or coerce a protobuf request object.
1321
+ # - Use the request object if provided (there's no risk of modifying the input as
1322
+ # there are no flattened fields), or create one.
1323
+ if not isinstance(request, cloud_sql.SqlInstancesDemoteRequest):
1324
+ request = cloud_sql.SqlInstancesDemoteRequest(request)
1325
+
1326
+ # Wrap the RPC method; this adds retry and timeout information,
1327
+ # and friendly error handling.
1328
+ rpc = self._transport._wrapped_methods[self._transport.demote]
1329
+
1330
+ # Certain fields should be provided within the metadata header;
1331
+ # add these here.
1332
+ metadata = tuple(metadata) + (
1333
+ gapic_v1.routing_header.to_grpc_metadata(
1334
+ (
1335
+ ("project", request.project),
1336
+ ("instance", request.instance),
1337
+ )
1338
+ ),
1339
+ )
1340
+
1341
+ # Validate the universe domain.
1342
+ self._validate_universe_domain()
1343
+
1344
+ # Send the request.
1345
+ response = rpc(
1346
+ request,
1347
+ retry=retry,
1348
+ timeout=timeout,
1349
+ metadata=metadata,
1350
+ )
1351
+
1352
+ # Done; return the response.
1353
+ return response
1354
+
1355
+ def export(
1356
+ self,
1357
+ request: Optional[Union[cloud_sql.SqlInstancesExportRequest, dict]] = None,
1358
+ *,
1359
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1360
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1361
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1362
+ ) -> cloud_sql_resources.Operation:
1363
+ r"""Exports data from a Cloud SQL instance to a Cloud
1364
+ Storage bucket as a SQL dump or CSV file.
1365
+
1366
+ .. code-block:: python
1367
+
1368
+ # This snippet has been automatically generated and should be regarded as a
1369
+ # code template only.
1370
+ # It will require modifications to work:
1371
+ # - It may require correct/in-range values for request initialization.
1372
+ # - It may require specifying regional endpoints when creating the service
1373
+ # client as shown in:
1374
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
1375
+ from google.cloud import sqladmin_v1beta4
1376
+
1377
+ def sample_export():
1378
+ # Create a client
1379
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
1380
+
1381
+ # Initialize request argument(s)
1382
+ request = sqladmin_v1beta4.SqlInstancesExportRequest(
1383
+ )
1384
+
1385
+ # Make the request
1386
+ response = client.export(request=request)
1387
+
1388
+ # Handle the response
1389
+ print(response)
1390
+
1391
+ Args:
1392
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesExportRequest, dict]):
1393
+ The request object.
1394
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
1395
+ should be retried.
1396
+ timeout (float): The timeout for this request.
1397
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1398
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1399
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1400
+ be of type `bytes`.
1401
+
1402
+ Returns:
1403
+ google.cloud.sqladmin_v1beta4.types.Operation:
1404
+ An Operation resource.&nbsp;For
1405
+ successful operations that return an
1406
+ Operation resource, only the fields
1407
+ relevant to the operation are populated
1408
+ in the resource.
1409
+
1410
+ """
1411
+ # Create or coerce a protobuf request object.
1412
+ # - Use the request object if provided (there's no risk of modifying the input as
1413
+ # there are no flattened fields), or create one.
1414
+ if not isinstance(request, cloud_sql.SqlInstancesExportRequest):
1415
+ request = cloud_sql.SqlInstancesExportRequest(request)
1416
+
1417
+ # Wrap the RPC method; this adds retry and timeout information,
1418
+ # and friendly error handling.
1419
+ rpc = self._transport._wrapped_methods[self._transport.export]
1420
+
1421
+ # Certain fields should be provided within the metadata header;
1422
+ # add these here.
1423
+ metadata = tuple(metadata) + (
1424
+ gapic_v1.routing_header.to_grpc_metadata(
1425
+ (
1426
+ ("project", request.project),
1427
+ ("instance", request.instance),
1428
+ )
1429
+ ),
1430
+ )
1431
+
1432
+ # Validate the universe domain.
1433
+ self._validate_universe_domain()
1434
+
1435
+ # Send the request.
1436
+ response = rpc(
1437
+ request,
1438
+ retry=retry,
1439
+ timeout=timeout,
1440
+ metadata=metadata,
1441
+ )
1442
+
1443
+ # Done; return the response.
1444
+ return response
1445
+
1446
+ def failover(
1447
+ self,
1448
+ request: Optional[Union[cloud_sql.SqlInstancesFailoverRequest, dict]] = None,
1449
+ *,
1450
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1451
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1452
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1453
+ ) -> cloud_sql_resources.Operation:
1454
+ r"""Initiates a manual failover of a high availability (HA) primary
1455
+ instance to a standby instance, which becomes the primary
1456
+ instance. Users are then rerouted to the new primary. For more
1457
+ information, see the `Overview of high
1458
+ availability <https://cloud.google.com/sql/docs/mysql/high-availability>`__
1459
+ page in the Cloud SQL documentation. If using Legacy HA (MySQL
1460
+ only), this causes the instance to failover to its failover
1461
+ replica instance.
1462
+
1463
+ .. code-block:: python
1464
+
1465
+ # This snippet has been automatically generated and should be regarded as a
1466
+ # code template only.
1467
+ # It will require modifications to work:
1468
+ # - It may require correct/in-range values for request initialization.
1469
+ # - It may require specifying regional endpoints when creating the service
1470
+ # client as shown in:
1471
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
1472
+ from google.cloud import sqladmin_v1beta4
1473
+
1474
+ def sample_failover():
1475
+ # Create a client
1476
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
1477
+
1478
+ # Initialize request argument(s)
1479
+ request = sqladmin_v1beta4.SqlInstancesFailoverRequest(
1480
+ )
1481
+
1482
+ # Make the request
1483
+ response = client.failover(request=request)
1484
+
1485
+ # Handle the response
1486
+ print(response)
1487
+
1488
+ Args:
1489
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesFailoverRequest, dict]):
1490
+ The request object.
1491
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
1492
+ should be retried.
1493
+ timeout (float): The timeout for this request.
1494
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1495
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1496
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1497
+ be of type `bytes`.
1498
+
1499
+ Returns:
1500
+ google.cloud.sqladmin_v1beta4.types.Operation:
1501
+ An Operation resource.&nbsp;For
1502
+ successful operations that return an
1503
+ Operation resource, only the fields
1504
+ relevant to the operation are populated
1505
+ in the resource.
1506
+
1507
+ """
1508
+ # Create or coerce a protobuf request object.
1509
+ # - Use the request object if provided (there's no risk of modifying the input as
1510
+ # there are no flattened fields), or create one.
1511
+ if not isinstance(request, cloud_sql.SqlInstancesFailoverRequest):
1512
+ request = cloud_sql.SqlInstancesFailoverRequest(request)
1513
+
1514
+ # Wrap the RPC method; this adds retry and timeout information,
1515
+ # and friendly error handling.
1516
+ rpc = self._transport._wrapped_methods[self._transport.failover]
1517
+
1518
+ # Certain fields should be provided within the metadata header;
1519
+ # add these here.
1520
+ metadata = tuple(metadata) + (
1521
+ gapic_v1.routing_header.to_grpc_metadata(
1522
+ (
1523
+ ("project", request.project),
1524
+ ("instance", request.instance),
1525
+ )
1526
+ ),
1527
+ )
1528
+
1529
+ # Validate the universe domain.
1530
+ self._validate_universe_domain()
1531
+
1532
+ # Send the request.
1533
+ response = rpc(
1534
+ request,
1535
+ retry=retry,
1536
+ timeout=timeout,
1537
+ metadata=metadata,
1538
+ )
1539
+
1540
+ # Done; return the response.
1541
+ return response
1542
+
1543
+ def reencrypt(
1544
+ self,
1545
+ request: Optional[Union[cloud_sql.SqlInstancesReencryptRequest, dict]] = None,
1546
+ *,
1547
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1548
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1549
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1550
+ ) -> cloud_sql_resources.Operation:
1551
+ r"""Reencrypt CMEK instance with latest key version.
1552
+
1553
+ .. code-block:: python
1554
+
1555
+ # This snippet has been automatically generated and should be regarded as a
1556
+ # code template only.
1557
+ # It will require modifications to work:
1558
+ # - It may require correct/in-range values for request initialization.
1559
+ # - It may require specifying regional endpoints when creating the service
1560
+ # client as shown in:
1561
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
1562
+ from google.cloud import sqladmin_v1beta4
1563
+
1564
+ def sample_reencrypt():
1565
+ # Create a client
1566
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
1567
+
1568
+ # Initialize request argument(s)
1569
+ request = sqladmin_v1beta4.SqlInstancesReencryptRequest(
1570
+ )
1571
+
1572
+ # Make the request
1573
+ response = client.reencrypt(request=request)
1574
+
1575
+ # Handle the response
1576
+ print(response)
1577
+
1578
+ Args:
1579
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesReencryptRequest, dict]):
1580
+ The request object. Instance reencrypt request.
1581
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
1582
+ should be retried.
1583
+ timeout (float): The timeout for this request.
1584
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1585
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1586
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1587
+ be of type `bytes`.
1588
+
1589
+ Returns:
1590
+ google.cloud.sqladmin_v1beta4.types.Operation:
1591
+ An Operation resource.&nbsp;For
1592
+ successful operations that return an
1593
+ Operation resource, only the fields
1594
+ relevant to the operation are populated
1595
+ in the resource.
1596
+
1597
+ """
1598
+ # Create or coerce a protobuf request object.
1599
+ # - Use the request object if provided (there's no risk of modifying the input as
1600
+ # there are no flattened fields), or create one.
1601
+ if not isinstance(request, cloud_sql.SqlInstancesReencryptRequest):
1602
+ request = cloud_sql.SqlInstancesReencryptRequest(request)
1603
+
1604
+ # Wrap the RPC method; this adds retry and timeout information,
1605
+ # and friendly error handling.
1606
+ rpc = self._transport._wrapped_methods[self._transport.reencrypt]
1607
+
1608
+ # Certain fields should be provided within the metadata header;
1609
+ # add these here.
1610
+ metadata = tuple(metadata) + (
1611
+ gapic_v1.routing_header.to_grpc_metadata(
1612
+ (
1613
+ ("project", request.project),
1614
+ ("instance", request.instance),
1615
+ )
1616
+ ),
1617
+ )
1618
+
1619
+ # Validate the universe domain.
1620
+ self._validate_universe_domain()
1621
+
1622
+ # Send the request.
1623
+ response = rpc(
1624
+ request,
1625
+ retry=retry,
1626
+ timeout=timeout,
1627
+ metadata=metadata,
1628
+ )
1629
+
1630
+ # Done; return the response.
1631
+ return response
1632
+
1633
+ def get(
1634
+ self,
1635
+ request: Optional[Union[cloud_sql.SqlInstancesGetRequest, dict]] = None,
1636
+ *,
1637
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1638
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1639
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1640
+ ) -> cloud_sql_resources.DatabaseInstance:
1641
+ r"""Retrieves a resource containing information about a
1642
+ Cloud SQL instance.
1643
+
1644
+ .. code-block:: python
1645
+
1646
+ # This snippet has been automatically generated and should be regarded as a
1647
+ # code template only.
1648
+ # It will require modifications to work:
1649
+ # - It may require correct/in-range values for request initialization.
1650
+ # - It may require specifying regional endpoints when creating the service
1651
+ # client as shown in:
1652
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
1653
+ from google.cloud import sqladmin_v1beta4
1654
+
1655
+ def sample_get():
1656
+ # Create a client
1657
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
1658
+
1659
+ # Initialize request argument(s)
1660
+ request = sqladmin_v1beta4.SqlInstancesGetRequest(
1661
+ )
1662
+
1663
+ # Make the request
1664
+ response = client.get(request=request)
1665
+
1666
+ # Handle the response
1667
+ print(response)
1668
+
1669
+ Args:
1670
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesGetRequest, dict]):
1671
+ The request object.
1672
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
1673
+ should be retried.
1674
+ timeout (float): The timeout for this request.
1675
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1676
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1677
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1678
+ be of type `bytes`.
1679
+
1680
+ Returns:
1681
+ google.cloud.sqladmin_v1beta4.types.DatabaseInstance:
1682
+ A Cloud SQL instance resource.
1683
+ """
1684
+ # Create or coerce a protobuf request object.
1685
+ # - Use the request object if provided (there's no risk of modifying the input as
1686
+ # there are no flattened fields), or create one.
1687
+ if not isinstance(request, cloud_sql.SqlInstancesGetRequest):
1688
+ request = cloud_sql.SqlInstancesGetRequest(request)
1689
+
1690
+ # Wrap the RPC method; this adds retry and timeout information,
1691
+ # and friendly error handling.
1692
+ rpc = self._transport._wrapped_methods[self._transport.get]
1693
+
1694
+ # Certain fields should be provided within the metadata header;
1695
+ # add these here.
1696
+ metadata = tuple(metadata) + (
1697
+ gapic_v1.routing_header.to_grpc_metadata(
1698
+ (
1699
+ ("project", request.project),
1700
+ ("instance", request.instance),
1701
+ )
1702
+ ),
1703
+ )
1704
+
1705
+ # Validate the universe domain.
1706
+ self._validate_universe_domain()
1707
+
1708
+ # Send the request.
1709
+ response = rpc(
1710
+ request,
1711
+ retry=retry,
1712
+ timeout=timeout,
1713
+ metadata=metadata,
1714
+ )
1715
+
1716
+ # Done; return the response.
1717
+ return response
1718
+
1719
+ def import_(
1720
+ self,
1721
+ request: Optional[Union[cloud_sql.SqlInstancesImportRequest, dict]] = None,
1722
+ *,
1723
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1724
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1725
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1726
+ ) -> cloud_sql_resources.Operation:
1727
+ r"""Imports data into a Cloud SQL instance from a SQL
1728
+ dump or CSV file in Cloud Storage.
1729
+
1730
+ .. code-block:: python
1731
+
1732
+ # This snippet has been automatically generated and should be regarded as a
1733
+ # code template only.
1734
+ # It will require modifications to work:
1735
+ # - It may require correct/in-range values for request initialization.
1736
+ # - It may require specifying regional endpoints when creating the service
1737
+ # client as shown in:
1738
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
1739
+ from google.cloud import sqladmin_v1beta4
1740
+
1741
+ def sample_import():
1742
+ # Create a client
1743
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
1744
+
1745
+ # Initialize request argument(s)
1746
+ request = sqladmin_v1beta4.SqlInstancesImportRequest(
1747
+ )
1748
+
1749
+ # Make the request
1750
+ response = client.import_(request=request)
1751
+
1752
+ # Handle the response
1753
+ print(response)
1754
+
1755
+ Args:
1756
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesImportRequest, dict]):
1757
+ The request object.
1758
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
1759
+ should be retried.
1760
+ timeout (float): The timeout for this request.
1761
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1762
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1763
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1764
+ be of type `bytes`.
1765
+
1766
+ Returns:
1767
+ google.cloud.sqladmin_v1beta4.types.Operation:
1768
+ An Operation resource.&nbsp;For
1769
+ successful operations that return an
1770
+ Operation resource, only the fields
1771
+ relevant to the operation are populated
1772
+ in the resource.
1773
+
1774
+ """
1775
+ # Create or coerce a protobuf request object.
1776
+ # - Use the request object if provided (there's no risk of modifying the input as
1777
+ # there are no flattened fields), or create one.
1778
+ if not isinstance(request, cloud_sql.SqlInstancesImportRequest):
1779
+ request = cloud_sql.SqlInstancesImportRequest(request)
1780
+
1781
+ # Wrap the RPC method; this adds retry and timeout information,
1782
+ # and friendly error handling.
1783
+ rpc = self._transport._wrapped_methods[self._transport.import_]
1784
+
1785
+ # Certain fields should be provided within the metadata header;
1786
+ # add these here.
1787
+ metadata = tuple(metadata) + (
1788
+ gapic_v1.routing_header.to_grpc_metadata(
1789
+ (
1790
+ ("project", request.project),
1791
+ ("instance", request.instance),
1792
+ )
1793
+ ),
1794
+ )
1795
+
1796
+ # Validate the universe domain.
1797
+ self._validate_universe_domain()
1798
+
1799
+ # Send the request.
1800
+ response = rpc(
1801
+ request,
1802
+ retry=retry,
1803
+ timeout=timeout,
1804
+ metadata=metadata,
1805
+ )
1806
+
1807
+ # Done; return the response.
1808
+ return response
1809
+
1810
+ def insert(
1811
+ self,
1812
+ request: Optional[Union[cloud_sql.SqlInstancesInsertRequest, dict]] = None,
1813
+ *,
1814
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1815
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1816
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1817
+ ) -> cloud_sql_resources.Operation:
1818
+ r"""Creates a new Cloud SQL instance.
1819
+
1820
+ .. code-block:: python
1821
+
1822
+ # This snippet has been automatically generated and should be regarded as a
1823
+ # code template only.
1824
+ # It will require modifications to work:
1825
+ # - It may require correct/in-range values for request initialization.
1826
+ # - It may require specifying regional endpoints when creating the service
1827
+ # client as shown in:
1828
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
1829
+ from google.cloud import sqladmin_v1beta4
1830
+
1831
+ def sample_insert():
1832
+ # Create a client
1833
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
1834
+
1835
+ # Initialize request argument(s)
1836
+ request = sqladmin_v1beta4.SqlInstancesInsertRequest(
1837
+ )
1838
+
1839
+ # Make the request
1840
+ response = client.insert(request=request)
1841
+
1842
+ # Handle the response
1843
+ print(response)
1844
+
1845
+ Args:
1846
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesInsertRequest, dict]):
1847
+ The request object.
1848
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
1849
+ should be retried.
1850
+ timeout (float): The timeout for this request.
1851
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1852
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1853
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1854
+ be of type `bytes`.
1855
+
1856
+ Returns:
1857
+ google.cloud.sqladmin_v1beta4.types.Operation:
1858
+ An Operation resource.&nbsp;For
1859
+ successful operations that return an
1860
+ Operation resource, only the fields
1861
+ relevant to the operation are populated
1862
+ in the resource.
1863
+
1864
+ """
1865
+ # Create or coerce a protobuf request object.
1866
+ # - Use the request object if provided (there's no risk of modifying the input as
1867
+ # there are no flattened fields), or create one.
1868
+ if not isinstance(request, cloud_sql.SqlInstancesInsertRequest):
1869
+ request = cloud_sql.SqlInstancesInsertRequest(request)
1870
+
1871
+ # Wrap the RPC method; this adds retry and timeout information,
1872
+ # and friendly error handling.
1873
+ rpc = self._transport._wrapped_methods[self._transport.insert]
1874
+
1875
+ # Certain fields should be provided within the metadata header;
1876
+ # add these here.
1877
+ metadata = tuple(metadata) + (
1878
+ gapic_v1.routing_header.to_grpc_metadata((("project", request.project),)),
1879
+ )
1880
+
1881
+ # Validate the universe domain.
1882
+ self._validate_universe_domain()
1883
+
1884
+ # Send the request.
1885
+ response = rpc(
1886
+ request,
1887
+ retry=retry,
1888
+ timeout=timeout,
1889
+ metadata=metadata,
1890
+ )
1891
+
1892
+ # Done; return the response.
1893
+ return response
1894
+
1895
+ def list(
1896
+ self,
1897
+ request: Optional[Union[cloud_sql.SqlInstancesListRequest, dict]] = None,
1898
+ *,
1899
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1900
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1901
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
1902
+ ) -> pagers.ListPager:
1903
+ r"""Lists instances under a given project.
1904
+
1905
+ .. code-block:: python
1906
+
1907
+ # This snippet has been automatically generated and should be regarded as a
1908
+ # code template only.
1909
+ # It will require modifications to work:
1910
+ # - It may require correct/in-range values for request initialization.
1911
+ # - It may require specifying regional endpoints when creating the service
1912
+ # client as shown in:
1913
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
1914
+ from google.cloud import sqladmin_v1beta4
1915
+
1916
+ def sample_list():
1917
+ # Create a client
1918
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
1919
+
1920
+ # Initialize request argument(s)
1921
+ request = sqladmin_v1beta4.SqlInstancesListRequest(
1922
+ )
1923
+
1924
+ # Make the request
1925
+ page_result = client.list(request=request)
1926
+
1927
+ # Handle the response
1928
+ for response in page_result:
1929
+ print(response)
1930
+
1931
+ Args:
1932
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesListRequest, dict]):
1933
+ The request object.
1934
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
1935
+ should be retried.
1936
+ timeout (float): The timeout for this request.
1937
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
1938
+ sent along with the request as metadata. Normally, each value must be of type `str`,
1939
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
1940
+ be of type `bytes`.
1941
+
1942
+ Returns:
1943
+ google.cloud.sqladmin_v1beta4.services.sql_instances_service.pagers.ListPager:
1944
+ Database instances list response.
1945
+
1946
+ Iterating over this object will yield
1947
+ results and resolve additional pages
1948
+ automatically.
1949
+
1950
+ """
1951
+ # Create or coerce a protobuf request object.
1952
+ # - Use the request object if provided (there's no risk of modifying the input as
1953
+ # there are no flattened fields), or create one.
1954
+ if not isinstance(request, cloud_sql.SqlInstancesListRequest):
1955
+ request = cloud_sql.SqlInstancesListRequest(request)
1956
+
1957
+ # Wrap the RPC method; this adds retry and timeout information,
1958
+ # and friendly error handling.
1959
+ rpc = self._transport._wrapped_methods[self._transport.list]
1960
+
1961
+ # Certain fields should be provided within the metadata header;
1962
+ # add these here.
1963
+ metadata = tuple(metadata) + (
1964
+ gapic_v1.routing_header.to_grpc_metadata((("project", request.project),)),
1965
+ )
1966
+
1967
+ # Validate the universe domain.
1968
+ self._validate_universe_domain()
1969
+
1970
+ # Send the request.
1971
+ response = rpc(
1972
+ request,
1973
+ retry=retry,
1974
+ timeout=timeout,
1975
+ metadata=metadata,
1976
+ )
1977
+
1978
+ # This method is paged; wrap the response in a pager, which provides
1979
+ # an `__iter__` convenience method.
1980
+ response = pagers.ListPager(
1981
+ method=rpc,
1982
+ request=request,
1983
+ response=response,
1984
+ retry=retry,
1985
+ timeout=timeout,
1986
+ metadata=metadata,
1987
+ )
1988
+
1989
+ # Done; return the response.
1990
+ return response
1991
+
1992
+ def list_server_cas(
1993
+ self,
1994
+ request: Optional[
1995
+ Union[cloud_sql.SqlInstancesListServerCasRequest, dict]
1996
+ ] = None,
1997
+ *,
1998
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
1999
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2000
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
2001
+ ) -> cloud_sql_resources.InstancesListServerCasResponse:
2002
+ r"""Lists all of the trusted Certificate Authorities
2003
+ (CAs) for the specified instance. There can be up to
2004
+ three CAs listed: the CA that was used to sign the
2005
+ certificate that is currently in use, a CA that has been
2006
+ added but not yet used to sign a certificate, and a CA
2007
+ used to sign a certificate that has previously rotated
2008
+ out.
2009
+
2010
+ .. code-block:: python
2011
+
2012
+ # This snippet has been automatically generated and should be regarded as a
2013
+ # code template only.
2014
+ # It will require modifications to work:
2015
+ # - It may require correct/in-range values for request initialization.
2016
+ # - It may require specifying regional endpoints when creating the service
2017
+ # client as shown in:
2018
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
2019
+ from google.cloud import sqladmin_v1beta4
2020
+
2021
+ def sample_list_server_cas():
2022
+ # Create a client
2023
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
2024
+
2025
+ # Initialize request argument(s)
2026
+ request = sqladmin_v1beta4.SqlInstancesListServerCasRequest(
2027
+ )
2028
+
2029
+ # Make the request
2030
+ response = client.list_server_cas(request=request)
2031
+
2032
+ # Handle the response
2033
+ print(response)
2034
+
2035
+ Args:
2036
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesListServerCasRequest, dict]):
2037
+ The request object.
2038
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
2039
+ should be retried.
2040
+ timeout (float): The timeout for this request.
2041
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2042
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2043
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2044
+ be of type `bytes`.
2045
+
2046
+ Returns:
2047
+ google.cloud.sqladmin_v1beta4.types.InstancesListServerCasResponse:
2048
+ Instances ListServerCas response.
2049
+ """
2050
+ # Create or coerce a protobuf request object.
2051
+ # - Use the request object if provided (there's no risk of modifying the input as
2052
+ # there are no flattened fields), or create one.
2053
+ if not isinstance(request, cloud_sql.SqlInstancesListServerCasRequest):
2054
+ request = cloud_sql.SqlInstancesListServerCasRequest(request)
2055
+
2056
+ # Wrap the RPC method; this adds retry and timeout information,
2057
+ # and friendly error handling.
2058
+ rpc = self._transport._wrapped_methods[self._transport.list_server_cas]
2059
+
2060
+ # Certain fields should be provided within the metadata header;
2061
+ # add these here.
2062
+ metadata = tuple(metadata) + (
2063
+ gapic_v1.routing_header.to_grpc_metadata(
2064
+ (
2065
+ ("project", request.project),
2066
+ ("instance", request.instance),
2067
+ )
2068
+ ),
2069
+ )
2070
+
2071
+ # Validate the universe domain.
2072
+ self._validate_universe_domain()
2073
+
2074
+ # Send the request.
2075
+ response = rpc(
2076
+ request,
2077
+ retry=retry,
2078
+ timeout=timeout,
2079
+ metadata=metadata,
2080
+ )
2081
+
2082
+ # Done; return the response.
2083
+ return response
2084
+
2085
+ def list_server_certificates(
2086
+ self,
2087
+ request: Optional[
2088
+ Union[cloud_sql.SqlInstancesListServerCertificatesRequest, dict]
2089
+ ] = None,
2090
+ *,
2091
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
2092
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2093
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
2094
+ ) -> cloud_sql_resources.InstancesListServerCertificatesResponse:
2095
+ r"""Lists all versions of server certificates and
2096
+ certificate authorities (CAs) for the specified
2097
+ instance. There can be up to three sets of certs listed:
2098
+
2099
+ the certificate that is currently in use, a future that
2100
+ has been added but not yet used to sign a certificate,
2101
+ and a certificate that has been rotated out. For
2102
+ instances not using Certificate Authority Service (CAS)
2103
+ server CA, use ListServerCas instead.
2104
+
2105
+ .. code-block:: python
2106
+
2107
+ # This snippet has been automatically generated and should be regarded as a
2108
+ # code template only.
2109
+ # It will require modifications to work:
2110
+ # - It may require correct/in-range values for request initialization.
2111
+ # - It may require specifying regional endpoints when creating the service
2112
+ # client as shown in:
2113
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
2114
+ from google.cloud import sqladmin_v1beta4
2115
+
2116
+ def sample_list_server_certificates():
2117
+ # Create a client
2118
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
2119
+
2120
+ # Initialize request argument(s)
2121
+ request = sqladmin_v1beta4.SqlInstancesListServerCertificatesRequest(
2122
+ instance="instance_value",
2123
+ project="project_value",
2124
+ )
2125
+
2126
+ # Make the request
2127
+ response = client.list_server_certificates(request=request)
2128
+
2129
+ # Handle the response
2130
+ print(response)
2131
+
2132
+ Args:
2133
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesListServerCertificatesRequest, dict]):
2134
+ The request object.
2135
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
2136
+ should be retried.
2137
+ timeout (float): The timeout for this request.
2138
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2139
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2140
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2141
+ be of type `bytes`.
2142
+
2143
+ Returns:
2144
+ google.cloud.sqladmin_v1beta4.types.InstancesListServerCertificatesResponse:
2145
+ Instances ListServerCertificatess
2146
+ response.
2147
+
2148
+ """
2149
+ # Create or coerce a protobuf request object.
2150
+ # - Use the request object if provided (there's no risk of modifying the input as
2151
+ # there are no flattened fields), or create one.
2152
+ if not isinstance(request, cloud_sql.SqlInstancesListServerCertificatesRequest):
2153
+ request = cloud_sql.SqlInstancesListServerCertificatesRequest(request)
2154
+
2155
+ # Wrap the RPC method; this adds retry and timeout information,
2156
+ # and friendly error handling.
2157
+ rpc = self._transport._wrapped_methods[self._transport.list_server_certificates]
2158
+
2159
+ # Certain fields should be provided within the metadata header;
2160
+ # add these here.
2161
+ metadata = tuple(metadata) + (
2162
+ gapic_v1.routing_header.to_grpc_metadata(
2163
+ (
2164
+ ("project", request.project),
2165
+ ("instance", request.instance),
2166
+ )
2167
+ ),
2168
+ )
2169
+
2170
+ # Validate the universe domain.
2171
+ self._validate_universe_domain()
2172
+
2173
+ # Send the request.
2174
+ response = rpc(
2175
+ request,
2176
+ retry=retry,
2177
+ timeout=timeout,
2178
+ metadata=metadata,
2179
+ )
2180
+
2181
+ # Done; return the response.
2182
+ return response
2183
+
2184
+ def list_entra_id_certificates(
2185
+ self,
2186
+ request: Optional[
2187
+ Union[cloud_sql.SqlInstancesListEntraIdCertificatesRequest, dict]
2188
+ ] = None,
2189
+ *,
2190
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
2191
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2192
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
2193
+ ) -> cloud_sql_resources.InstancesListEntraIdCertificatesResponse:
2194
+ r"""Lists all versions of EntraID certificates for the
2195
+ specified instance. There can be up to three sets of
2196
+ certificates listed: the certificate that is currently
2197
+ in use, a future that has been added but not yet used to
2198
+ sign a certificate, and a certificate that has been
2199
+ rotated out.
2200
+
2201
+ .. code-block:: python
2202
+
2203
+ # This snippet has been automatically generated and should be regarded as a
2204
+ # code template only.
2205
+ # It will require modifications to work:
2206
+ # - It may require correct/in-range values for request initialization.
2207
+ # - It may require specifying regional endpoints when creating the service
2208
+ # client as shown in:
2209
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
2210
+ from google.cloud import sqladmin_v1beta4
2211
+
2212
+ def sample_list_entra_id_certificates():
2213
+ # Create a client
2214
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
2215
+
2216
+ # Initialize request argument(s)
2217
+ request = sqladmin_v1beta4.SqlInstancesListEntraIdCertificatesRequest(
2218
+ instance="instance_value",
2219
+ project="project_value",
2220
+ )
2221
+
2222
+ # Make the request
2223
+ response = client.list_entra_id_certificates(request=request)
2224
+
2225
+ # Handle the response
2226
+ print(response)
2227
+
2228
+ Args:
2229
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesListEntraIdCertificatesRequest, dict]):
2230
+ The request object. Request message for
2231
+ SqlInstancesService.ListEntraIdCertificates.
2232
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
2233
+ should be retried.
2234
+ timeout (float): The timeout for this request.
2235
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2236
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2237
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2238
+ be of type `bytes`.
2239
+
2240
+ Returns:
2241
+ google.cloud.sqladmin_v1beta4.types.InstancesListEntraIdCertificatesResponse:
2242
+ Instances ListEntraIdCertificates
2243
+ response.
2244
+
2245
+ """
2246
+ # Create or coerce a protobuf request object.
2247
+ # - Use the request object if provided (there's no risk of modifying the input as
2248
+ # there are no flattened fields), or create one.
2249
+ if not isinstance(
2250
+ request, cloud_sql.SqlInstancesListEntraIdCertificatesRequest
2251
+ ):
2252
+ request = cloud_sql.SqlInstancesListEntraIdCertificatesRequest(request)
2253
+
2254
+ # Wrap the RPC method; this adds retry and timeout information,
2255
+ # and friendly error handling.
2256
+ rpc = self._transport._wrapped_methods[
2257
+ self._transport.list_entra_id_certificates
2258
+ ]
2259
+
2260
+ # Certain fields should be provided within the metadata header;
2261
+ # add these here.
2262
+ metadata = tuple(metadata) + (
2263
+ gapic_v1.routing_header.to_grpc_metadata(
2264
+ (
2265
+ ("project", request.project),
2266
+ ("instance", request.instance),
2267
+ )
2268
+ ),
2269
+ )
2270
+
2271
+ # Validate the universe domain.
2272
+ self._validate_universe_domain()
2273
+
2274
+ # Send the request.
2275
+ response = rpc(
2276
+ request,
2277
+ retry=retry,
2278
+ timeout=timeout,
2279
+ metadata=metadata,
2280
+ )
2281
+
2282
+ # Done; return the response.
2283
+ return response
2284
+
2285
+ def patch(
2286
+ self,
2287
+ request: Optional[Union[cloud_sql.SqlInstancesPatchRequest, dict]] = None,
2288
+ *,
2289
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
2290
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2291
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
2292
+ ) -> cloud_sql_resources.Operation:
2293
+ r"""Partially updates settings of a Cloud SQL instance by
2294
+ merging the request with the current configuration. This
2295
+ method supports patch semantics.
2296
+
2297
+ .. code-block:: python
2298
+
2299
+ # This snippet has been automatically generated and should be regarded as a
2300
+ # code template only.
2301
+ # It will require modifications to work:
2302
+ # - It may require correct/in-range values for request initialization.
2303
+ # - It may require specifying regional endpoints when creating the service
2304
+ # client as shown in:
2305
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
2306
+ from google.cloud import sqladmin_v1beta4
2307
+
2308
+ def sample_patch():
2309
+ # Create a client
2310
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
2311
+
2312
+ # Initialize request argument(s)
2313
+ request = sqladmin_v1beta4.SqlInstancesPatchRequest(
2314
+ )
2315
+
2316
+ # Make the request
2317
+ response = client.patch(request=request)
2318
+
2319
+ # Handle the response
2320
+ print(response)
2321
+
2322
+ Args:
2323
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesPatchRequest, dict]):
2324
+ The request object.
2325
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
2326
+ should be retried.
2327
+ timeout (float): The timeout for this request.
2328
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2329
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2330
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2331
+ be of type `bytes`.
2332
+
2333
+ Returns:
2334
+ google.cloud.sqladmin_v1beta4.types.Operation:
2335
+ An Operation resource.&nbsp;For
2336
+ successful operations that return an
2337
+ Operation resource, only the fields
2338
+ relevant to the operation are populated
2339
+ in the resource.
2340
+
2341
+ """
2342
+ # Create or coerce a protobuf request object.
2343
+ # - Use the request object if provided (there's no risk of modifying the input as
2344
+ # there are no flattened fields), or create one.
2345
+ if not isinstance(request, cloud_sql.SqlInstancesPatchRequest):
2346
+ request = cloud_sql.SqlInstancesPatchRequest(request)
2347
+
2348
+ # Wrap the RPC method; this adds retry and timeout information,
2349
+ # and friendly error handling.
2350
+ rpc = self._transport._wrapped_methods[self._transport.patch]
2351
+
2352
+ # Certain fields should be provided within the metadata header;
2353
+ # add these here.
2354
+ metadata = tuple(metadata) + (
2355
+ gapic_v1.routing_header.to_grpc_metadata(
2356
+ (
2357
+ ("project", request.project),
2358
+ ("instance", request.instance),
2359
+ )
2360
+ ),
2361
+ )
2362
+
2363
+ # Validate the universe domain.
2364
+ self._validate_universe_domain()
2365
+
2366
+ # Send the request.
2367
+ response = rpc(
2368
+ request,
2369
+ retry=retry,
2370
+ timeout=timeout,
2371
+ metadata=metadata,
2372
+ )
2373
+
2374
+ # Done; return the response.
2375
+ return response
2376
+
2377
+ def promote_replica(
2378
+ self,
2379
+ request: Optional[
2380
+ Union[cloud_sql.SqlInstancesPromoteReplicaRequest, dict]
2381
+ ] = None,
2382
+ *,
2383
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
2384
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2385
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
2386
+ ) -> cloud_sql_resources.Operation:
2387
+ r"""Promotes the read replica instance to be an
2388
+ independent Cloud SQL primary instance.
2389
+ Using this operation might cause your instance to
2390
+ restart.
2391
+
2392
+ .. code-block:: python
2393
+
2394
+ # This snippet has been automatically generated and should be regarded as a
2395
+ # code template only.
2396
+ # It will require modifications to work:
2397
+ # - It may require correct/in-range values for request initialization.
2398
+ # - It may require specifying regional endpoints when creating the service
2399
+ # client as shown in:
2400
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
2401
+ from google.cloud import sqladmin_v1beta4
2402
+
2403
+ def sample_promote_replica():
2404
+ # Create a client
2405
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
2406
+
2407
+ # Initialize request argument(s)
2408
+ request = sqladmin_v1beta4.SqlInstancesPromoteReplicaRequest(
2409
+ )
2410
+
2411
+ # Make the request
2412
+ response = client.promote_replica(request=request)
2413
+
2414
+ # Handle the response
2415
+ print(response)
2416
+
2417
+ Args:
2418
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesPromoteReplicaRequest, dict]):
2419
+ The request object.
2420
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
2421
+ should be retried.
2422
+ timeout (float): The timeout for this request.
2423
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2424
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2425
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2426
+ be of type `bytes`.
2427
+
2428
+ Returns:
2429
+ google.cloud.sqladmin_v1beta4.types.Operation:
2430
+ An Operation resource.&nbsp;For
2431
+ successful operations that return an
2432
+ Operation resource, only the fields
2433
+ relevant to the operation are populated
2434
+ in the resource.
2435
+
2436
+ """
2437
+ # Create or coerce a protobuf request object.
2438
+ # - Use the request object if provided (there's no risk of modifying the input as
2439
+ # there are no flattened fields), or create one.
2440
+ if not isinstance(request, cloud_sql.SqlInstancesPromoteReplicaRequest):
2441
+ request = cloud_sql.SqlInstancesPromoteReplicaRequest(request)
2442
+
2443
+ # Wrap the RPC method; this adds retry and timeout information,
2444
+ # and friendly error handling.
2445
+ rpc = self._transport._wrapped_methods[self._transport.promote_replica]
2446
+
2447
+ # Certain fields should be provided within the metadata header;
2448
+ # add these here.
2449
+ metadata = tuple(metadata) + (
2450
+ gapic_v1.routing_header.to_grpc_metadata(
2451
+ (
2452
+ ("project", request.project),
2453
+ ("instance", request.instance),
2454
+ )
2455
+ ),
2456
+ )
2457
+
2458
+ # Validate the universe domain.
2459
+ self._validate_universe_domain()
2460
+
2461
+ # Send the request.
2462
+ response = rpc(
2463
+ request,
2464
+ retry=retry,
2465
+ timeout=timeout,
2466
+ metadata=metadata,
2467
+ )
2468
+
2469
+ # Done; return the response.
2470
+ return response
2471
+
2472
+ def switchover(
2473
+ self,
2474
+ request: Optional[Union[cloud_sql.SqlInstancesSwitchoverRequest, dict]] = None,
2475
+ *,
2476
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
2477
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2478
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
2479
+ ) -> cloud_sql_resources.Operation:
2480
+ r"""Switches over from the primary instance to the DR
2481
+ replica instance.
2482
+
2483
+ .. code-block:: python
2484
+
2485
+ # This snippet has been automatically generated and should be regarded as a
2486
+ # code template only.
2487
+ # It will require modifications to work:
2488
+ # - It may require correct/in-range values for request initialization.
2489
+ # - It may require specifying regional endpoints when creating the service
2490
+ # client as shown in:
2491
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
2492
+ from google.cloud import sqladmin_v1beta4
2493
+
2494
+ def sample_switchover():
2495
+ # Create a client
2496
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
2497
+
2498
+ # Initialize request argument(s)
2499
+ request = sqladmin_v1beta4.SqlInstancesSwitchoverRequest(
2500
+ )
2501
+
2502
+ # Make the request
2503
+ response = client.switchover(request=request)
2504
+
2505
+ # Handle the response
2506
+ print(response)
2507
+
2508
+ Args:
2509
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesSwitchoverRequest, dict]):
2510
+ The request object. Instance switchover request.
2511
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
2512
+ should be retried.
2513
+ timeout (float): The timeout for this request.
2514
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2515
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2516
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2517
+ be of type `bytes`.
2518
+
2519
+ Returns:
2520
+ google.cloud.sqladmin_v1beta4.types.Operation:
2521
+ An Operation resource.&nbsp;For
2522
+ successful operations that return an
2523
+ Operation resource, only the fields
2524
+ relevant to the operation are populated
2525
+ in the resource.
2526
+
2527
+ """
2528
+ # Create or coerce a protobuf request object.
2529
+ # - Use the request object if provided (there's no risk of modifying the input as
2530
+ # there are no flattened fields), or create one.
2531
+ if not isinstance(request, cloud_sql.SqlInstancesSwitchoverRequest):
2532
+ request = cloud_sql.SqlInstancesSwitchoverRequest(request)
2533
+
2534
+ # Wrap the RPC method; this adds retry and timeout information,
2535
+ # and friendly error handling.
2536
+ rpc = self._transport._wrapped_methods[self._transport.switchover]
2537
+
2538
+ # Certain fields should be provided within the metadata header;
2539
+ # add these here.
2540
+ metadata = tuple(metadata) + (
2541
+ gapic_v1.routing_header.to_grpc_metadata(
2542
+ (
2543
+ ("project", request.project),
2544
+ ("instance", request.instance),
2545
+ )
2546
+ ),
2547
+ )
2548
+
2549
+ # Validate the universe domain.
2550
+ self._validate_universe_domain()
2551
+
2552
+ # Send the request.
2553
+ response = rpc(
2554
+ request,
2555
+ retry=retry,
2556
+ timeout=timeout,
2557
+ metadata=metadata,
2558
+ )
2559
+
2560
+ # Done; return the response.
2561
+ return response
2562
+
2563
+ def reset_ssl_config(
2564
+ self,
2565
+ request: Optional[
2566
+ Union[cloud_sql.SqlInstancesResetSslConfigRequest, dict]
2567
+ ] = None,
2568
+ *,
2569
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
2570
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2571
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
2572
+ ) -> cloud_sql_resources.Operation:
2573
+ r"""Deletes all client certificates and generates a new
2574
+ server SSL certificate for the instance.
2575
+
2576
+ .. code-block:: python
2577
+
2578
+ # This snippet has been automatically generated and should be regarded as a
2579
+ # code template only.
2580
+ # It will require modifications to work:
2581
+ # - It may require correct/in-range values for request initialization.
2582
+ # - It may require specifying regional endpoints when creating the service
2583
+ # client as shown in:
2584
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
2585
+ from google.cloud import sqladmin_v1beta4
2586
+
2587
+ def sample_reset_ssl_config():
2588
+ # Create a client
2589
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
2590
+
2591
+ # Initialize request argument(s)
2592
+ request = sqladmin_v1beta4.SqlInstancesResetSslConfigRequest(
2593
+ )
2594
+
2595
+ # Make the request
2596
+ response = client.reset_ssl_config(request=request)
2597
+
2598
+ # Handle the response
2599
+ print(response)
2600
+
2601
+ Args:
2602
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesResetSslConfigRequest, dict]):
2603
+ The request object.
2604
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
2605
+ should be retried.
2606
+ timeout (float): The timeout for this request.
2607
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2608
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2609
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2610
+ be of type `bytes`.
2611
+
2612
+ Returns:
2613
+ google.cloud.sqladmin_v1beta4.types.Operation:
2614
+ An Operation resource.&nbsp;For
2615
+ successful operations that return an
2616
+ Operation resource, only the fields
2617
+ relevant to the operation are populated
2618
+ in the resource.
2619
+
2620
+ """
2621
+ # Create or coerce a protobuf request object.
2622
+ # - Use the request object if provided (there's no risk of modifying the input as
2623
+ # there are no flattened fields), or create one.
2624
+ if not isinstance(request, cloud_sql.SqlInstancesResetSslConfigRequest):
2625
+ request = cloud_sql.SqlInstancesResetSslConfigRequest(request)
2626
+
2627
+ # Wrap the RPC method; this adds retry and timeout information,
2628
+ # and friendly error handling.
2629
+ rpc = self._transport._wrapped_methods[self._transport.reset_ssl_config]
2630
+
2631
+ # Certain fields should be provided within the metadata header;
2632
+ # add these here.
2633
+ metadata = tuple(metadata) + (
2634
+ gapic_v1.routing_header.to_grpc_metadata(
2635
+ (
2636
+ ("project", request.project),
2637
+ ("instance", request.instance),
2638
+ )
2639
+ ),
2640
+ )
2641
+
2642
+ # Validate the universe domain.
2643
+ self._validate_universe_domain()
2644
+
2645
+ # Send the request.
2646
+ response = rpc(
2647
+ request,
2648
+ retry=retry,
2649
+ timeout=timeout,
2650
+ metadata=metadata,
2651
+ )
2652
+
2653
+ # Done; return the response.
2654
+ return response
2655
+
2656
+ def restart(
2657
+ self,
2658
+ request: Optional[Union[cloud_sql.SqlInstancesRestartRequest, dict]] = None,
2659
+ *,
2660
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
2661
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2662
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
2663
+ ) -> cloud_sql_resources.Operation:
2664
+ r"""Restarts a Cloud SQL instance.
2665
+
2666
+ .. code-block:: python
2667
+
2668
+ # This snippet has been automatically generated and should be regarded as a
2669
+ # code template only.
2670
+ # It will require modifications to work:
2671
+ # - It may require correct/in-range values for request initialization.
2672
+ # - It may require specifying regional endpoints when creating the service
2673
+ # client as shown in:
2674
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
2675
+ from google.cloud import sqladmin_v1beta4
2676
+
2677
+ def sample_restart():
2678
+ # Create a client
2679
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
2680
+
2681
+ # Initialize request argument(s)
2682
+ request = sqladmin_v1beta4.SqlInstancesRestartRequest(
2683
+ )
2684
+
2685
+ # Make the request
2686
+ response = client.restart(request=request)
2687
+
2688
+ # Handle the response
2689
+ print(response)
2690
+
2691
+ Args:
2692
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesRestartRequest, dict]):
2693
+ The request object.
2694
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
2695
+ should be retried.
2696
+ timeout (float): The timeout for this request.
2697
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2698
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2699
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2700
+ be of type `bytes`.
2701
+
2702
+ Returns:
2703
+ google.cloud.sqladmin_v1beta4.types.Operation:
2704
+ An Operation resource.&nbsp;For
2705
+ successful operations that return an
2706
+ Operation resource, only the fields
2707
+ relevant to the operation are populated
2708
+ in the resource.
2709
+
2710
+ """
2711
+ # Create or coerce a protobuf request object.
2712
+ # - Use the request object if provided (there's no risk of modifying the input as
2713
+ # there are no flattened fields), or create one.
2714
+ if not isinstance(request, cloud_sql.SqlInstancesRestartRequest):
2715
+ request = cloud_sql.SqlInstancesRestartRequest(request)
2716
+
2717
+ # Wrap the RPC method; this adds retry and timeout information,
2718
+ # and friendly error handling.
2719
+ rpc = self._transport._wrapped_methods[self._transport.restart]
2720
+
2721
+ # Certain fields should be provided within the metadata header;
2722
+ # add these here.
2723
+ metadata = tuple(metadata) + (
2724
+ gapic_v1.routing_header.to_grpc_metadata(
2725
+ (
2726
+ ("project", request.project),
2727
+ ("instance", request.instance),
2728
+ )
2729
+ ),
2730
+ )
2731
+
2732
+ # Validate the universe domain.
2733
+ self._validate_universe_domain()
2734
+
2735
+ # Send the request.
2736
+ response = rpc(
2737
+ request,
2738
+ retry=retry,
2739
+ timeout=timeout,
2740
+ metadata=metadata,
2741
+ )
2742
+
2743
+ # Done; return the response.
2744
+ return response
2745
+
2746
+ def restore_backup(
2747
+ self,
2748
+ request: Optional[
2749
+ Union[cloud_sql.SqlInstancesRestoreBackupRequest, dict]
2750
+ ] = None,
2751
+ *,
2752
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
2753
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2754
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
2755
+ ) -> cloud_sql_resources.Operation:
2756
+ r"""Restores a backup of a Cloud SQL instance. Using this
2757
+ operation might cause your instance to restart.
2758
+
2759
+ .. code-block:: python
2760
+
2761
+ # This snippet has been automatically generated and should be regarded as a
2762
+ # code template only.
2763
+ # It will require modifications to work:
2764
+ # - It may require correct/in-range values for request initialization.
2765
+ # - It may require specifying regional endpoints when creating the service
2766
+ # client as shown in:
2767
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
2768
+ from google.cloud import sqladmin_v1beta4
2769
+
2770
+ def sample_restore_backup():
2771
+ # Create a client
2772
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
2773
+
2774
+ # Initialize request argument(s)
2775
+ request = sqladmin_v1beta4.SqlInstancesRestoreBackupRequest(
2776
+ )
2777
+
2778
+ # Make the request
2779
+ response = client.restore_backup(request=request)
2780
+
2781
+ # Handle the response
2782
+ print(response)
2783
+
2784
+ Args:
2785
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesRestoreBackupRequest, dict]):
2786
+ The request object.
2787
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
2788
+ should be retried.
2789
+ timeout (float): The timeout for this request.
2790
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2791
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2792
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2793
+ be of type `bytes`.
2794
+
2795
+ Returns:
2796
+ google.cloud.sqladmin_v1beta4.types.Operation:
2797
+ An Operation resource.&nbsp;For
2798
+ successful operations that return an
2799
+ Operation resource, only the fields
2800
+ relevant to the operation are populated
2801
+ in the resource.
2802
+
2803
+ """
2804
+ # Create or coerce a protobuf request object.
2805
+ # - Use the request object if provided (there's no risk of modifying the input as
2806
+ # there are no flattened fields), or create one.
2807
+ if not isinstance(request, cloud_sql.SqlInstancesRestoreBackupRequest):
2808
+ request = cloud_sql.SqlInstancesRestoreBackupRequest(request)
2809
+
2810
+ # Wrap the RPC method; this adds retry and timeout information,
2811
+ # and friendly error handling.
2812
+ rpc = self._transport._wrapped_methods[self._transport.restore_backup]
2813
+
2814
+ # Certain fields should be provided within the metadata header;
2815
+ # add these here.
2816
+ metadata = tuple(metadata) + (
2817
+ gapic_v1.routing_header.to_grpc_metadata(
2818
+ (
2819
+ ("project", request.project),
2820
+ ("instance", request.instance),
2821
+ )
2822
+ ),
2823
+ )
2824
+
2825
+ # Validate the universe domain.
2826
+ self._validate_universe_domain()
2827
+
2828
+ # Send the request.
2829
+ response = rpc(
2830
+ request,
2831
+ retry=retry,
2832
+ timeout=timeout,
2833
+ metadata=metadata,
2834
+ )
2835
+
2836
+ # Done; return the response.
2837
+ return response
2838
+
2839
+ def rotate_server_ca(
2840
+ self,
2841
+ request: Optional[
2842
+ Union[cloud_sql.SqlInstancesRotateServerCaRequest, dict]
2843
+ ] = None,
2844
+ *,
2845
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
2846
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2847
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
2848
+ ) -> cloud_sql_resources.Operation:
2849
+ r"""Rotates the server certificate to one signed by the
2850
+ Certificate Authority (CA) version previously added with
2851
+ the addServerCA method. For instances that have enabled
2852
+ Certificate Authority Service (CAS) based server CA, use
2853
+ RotateServerCertificate to rotate the server
2854
+ certificate.
2855
+
2856
+ .. code-block:: python
2857
+
2858
+ # This snippet has been automatically generated and should be regarded as a
2859
+ # code template only.
2860
+ # It will require modifications to work:
2861
+ # - It may require correct/in-range values for request initialization.
2862
+ # - It may require specifying regional endpoints when creating the service
2863
+ # client as shown in:
2864
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
2865
+ from google.cloud import sqladmin_v1beta4
2866
+
2867
+ def sample_rotate_server_ca():
2868
+ # Create a client
2869
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
2870
+
2871
+ # Initialize request argument(s)
2872
+ request = sqladmin_v1beta4.SqlInstancesRotateServerCaRequest(
2873
+ )
2874
+
2875
+ # Make the request
2876
+ response = client.rotate_server_ca(request=request)
2877
+
2878
+ # Handle the response
2879
+ print(response)
2880
+
2881
+ Args:
2882
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesRotateServerCaRequest, dict]):
2883
+ The request object.
2884
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
2885
+ should be retried.
2886
+ timeout (float): The timeout for this request.
2887
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2888
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2889
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2890
+ be of type `bytes`.
2891
+
2892
+ Returns:
2893
+ google.cloud.sqladmin_v1beta4.types.Operation:
2894
+ An Operation resource.&nbsp;For
2895
+ successful operations that return an
2896
+ Operation resource, only the fields
2897
+ relevant to the operation are populated
2898
+ in the resource.
2899
+
2900
+ """
2901
+ # Create or coerce a protobuf request object.
2902
+ # - Use the request object if provided (there's no risk of modifying the input as
2903
+ # there are no flattened fields), or create one.
2904
+ if not isinstance(request, cloud_sql.SqlInstancesRotateServerCaRequest):
2905
+ request = cloud_sql.SqlInstancesRotateServerCaRequest(request)
2906
+
2907
+ # Wrap the RPC method; this adds retry and timeout information,
2908
+ # and friendly error handling.
2909
+ rpc = self._transport._wrapped_methods[self._transport.rotate_server_ca]
2910
+
2911
+ # Certain fields should be provided within the metadata header;
2912
+ # add these here.
2913
+ metadata = tuple(metadata) + (
2914
+ gapic_v1.routing_header.to_grpc_metadata(
2915
+ (
2916
+ ("project", request.project),
2917
+ ("instance", request.instance),
2918
+ )
2919
+ ),
2920
+ )
2921
+
2922
+ # Validate the universe domain.
2923
+ self._validate_universe_domain()
2924
+
2925
+ # Send the request.
2926
+ response = rpc(
2927
+ request,
2928
+ retry=retry,
2929
+ timeout=timeout,
2930
+ metadata=metadata,
2931
+ )
2932
+
2933
+ # Done; return the response.
2934
+ return response
2935
+
2936
+ def rotate_server_certificate(
2937
+ self,
2938
+ request: Optional[
2939
+ Union[cloud_sql.SqlInstancesRotateServerCertificateRequest, dict]
2940
+ ] = None,
2941
+ *,
2942
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
2943
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
2944
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
2945
+ ) -> cloud_sql_resources.Operation:
2946
+ r"""Rotates the server certificate version to one
2947
+ previously added with the addServerCertificate method.
2948
+ For instances not using Certificate Authority Service
2949
+ (CAS) server CA, use RotateServerCa instead.
2950
+
2951
+ .. code-block:: python
2952
+
2953
+ # This snippet has been automatically generated and should be regarded as a
2954
+ # code template only.
2955
+ # It will require modifications to work:
2956
+ # - It may require correct/in-range values for request initialization.
2957
+ # - It may require specifying regional endpoints when creating the service
2958
+ # client as shown in:
2959
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
2960
+ from google.cloud import sqladmin_v1beta4
2961
+
2962
+ def sample_rotate_server_certificate():
2963
+ # Create a client
2964
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
2965
+
2966
+ # Initialize request argument(s)
2967
+ request = sqladmin_v1beta4.SqlInstancesRotateServerCertificateRequest(
2968
+ instance="instance_value",
2969
+ project="project_value",
2970
+ )
2971
+
2972
+ # Make the request
2973
+ response = client.rotate_server_certificate(request=request)
2974
+
2975
+ # Handle the response
2976
+ print(response)
2977
+
2978
+ Args:
2979
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesRotateServerCertificateRequest, dict]):
2980
+ The request object.
2981
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
2982
+ should be retried.
2983
+ timeout (float): The timeout for this request.
2984
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
2985
+ sent along with the request as metadata. Normally, each value must be of type `str`,
2986
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
2987
+ be of type `bytes`.
2988
+
2989
+ Returns:
2990
+ google.cloud.sqladmin_v1beta4.types.Operation:
2991
+ An Operation resource.&nbsp;For
2992
+ successful operations that return an
2993
+ Operation resource, only the fields
2994
+ relevant to the operation are populated
2995
+ in the resource.
2996
+
2997
+ """
2998
+ # Create or coerce a protobuf request object.
2999
+ # - Use the request object if provided (there's no risk of modifying the input as
3000
+ # there are no flattened fields), or create one.
3001
+ if not isinstance(
3002
+ request, cloud_sql.SqlInstancesRotateServerCertificateRequest
3003
+ ):
3004
+ request = cloud_sql.SqlInstancesRotateServerCertificateRequest(request)
3005
+
3006
+ # Wrap the RPC method; this adds retry and timeout information,
3007
+ # and friendly error handling.
3008
+ rpc = self._transport._wrapped_methods[
3009
+ self._transport.rotate_server_certificate
3010
+ ]
3011
+
3012
+ # Certain fields should be provided within the metadata header;
3013
+ # add these here.
3014
+ metadata = tuple(metadata) + (
3015
+ gapic_v1.routing_header.to_grpc_metadata(
3016
+ (
3017
+ ("project", request.project),
3018
+ ("instance", request.instance),
3019
+ )
3020
+ ),
3021
+ )
3022
+
3023
+ # Validate the universe domain.
3024
+ self._validate_universe_domain()
3025
+
3026
+ # Send the request.
3027
+ response = rpc(
3028
+ request,
3029
+ retry=retry,
3030
+ timeout=timeout,
3031
+ metadata=metadata,
3032
+ )
3033
+
3034
+ # Done; return the response.
3035
+ return response
3036
+
3037
+ def rotate_entra_id_certificate(
3038
+ self,
3039
+ request: Optional[
3040
+ Union[cloud_sql.SqlInstancesRotateEntraIdCertificateRequest, dict]
3041
+ ] = None,
3042
+ *,
3043
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
3044
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3045
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
3046
+ ) -> cloud_sql_resources.Operation:
3047
+ r"""Rotates the Entra Id certificate version to one
3048
+ previously added with the addEntraIdCertificate method.
3049
+
3050
+ .. code-block:: python
3051
+
3052
+ # This snippet has been automatically generated and should be regarded as a
3053
+ # code template only.
3054
+ # It will require modifications to work:
3055
+ # - It may require correct/in-range values for request initialization.
3056
+ # - It may require specifying regional endpoints when creating the service
3057
+ # client as shown in:
3058
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
3059
+ from google.cloud import sqladmin_v1beta4
3060
+
3061
+ def sample_rotate_entra_id_certificate():
3062
+ # Create a client
3063
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
3064
+
3065
+ # Initialize request argument(s)
3066
+ request = sqladmin_v1beta4.SqlInstancesRotateEntraIdCertificateRequest(
3067
+ instance="instance_value",
3068
+ project="project_value",
3069
+ )
3070
+
3071
+ # Make the request
3072
+ response = client.rotate_entra_id_certificate(request=request)
3073
+
3074
+ # Handle the response
3075
+ print(response)
3076
+
3077
+ Args:
3078
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesRotateEntraIdCertificateRequest, dict]):
3079
+ The request object. Request message for
3080
+ SqlInstancesService.RotateEntraIdCertificate.
3081
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
3082
+ should be retried.
3083
+ timeout (float): The timeout for this request.
3084
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
3085
+ sent along with the request as metadata. Normally, each value must be of type `str`,
3086
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
3087
+ be of type `bytes`.
3088
+
3089
+ Returns:
3090
+ google.cloud.sqladmin_v1beta4.types.Operation:
3091
+ An Operation resource.&nbsp;For
3092
+ successful operations that return an
3093
+ Operation resource, only the fields
3094
+ relevant to the operation are populated
3095
+ in the resource.
3096
+
3097
+ """
3098
+ # Create or coerce a protobuf request object.
3099
+ # - Use the request object if provided (there's no risk of modifying the input as
3100
+ # there are no flattened fields), or create one.
3101
+ if not isinstance(
3102
+ request, cloud_sql.SqlInstancesRotateEntraIdCertificateRequest
3103
+ ):
3104
+ request = cloud_sql.SqlInstancesRotateEntraIdCertificateRequest(request)
3105
+
3106
+ # Wrap the RPC method; this adds retry and timeout information,
3107
+ # and friendly error handling.
3108
+ rpc = self._transport._wrapped_methods[
3109
+ self._transport.rotate_entra_id_certificate
3110
+ ]
3111
+
3112
+ # Certain fields should be provided within the metadata header;
3113
+ # add these here.
3114
+ metadata = tuple(metadata) + (
3115
+ gapic_v1.routing_header.to_grpc_metadata(
3116
+ (
3117
+ ("project", request.project),
3118
+ ("instance", request.instance),
3119
+ )
3120
+ ),
3121
+ )
3122
+
3123
+ # Validate the universe domain.
3124
+ self._validate_universe_domain()
3125
+
3126
+ # Send the request.
3127
+ response = rpc(
3128
+ request,
3129
+ retry=retry,
3130
+ timeout=timeout,
3131
+ metadata=metadata,
3132
+ )
3133
+
3134
+ # Done; return the response.
3135
+ return response
3136
+
3137
+ def start_replica(
3138
+ self,
3139
+ request: Optional[
3140
+ Union[cloud_sql.SqlInstancesStartReplicaRequest, dict]
3141
+ ] = None,
3142
+ *,
3143
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
3144
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3145
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
3146
+ ) -> cloud_sql_resources.Operation:
3147
+ r"""Starts the replication in the read replica instance.
3148
+
3149
+ .. code-block:: python
3150
+
3151
+ # This snippet has been automatically generated and should be regarded as a
3152
+ # code template only.
3153
+ # It will require modifications to work:
3154
+ # - It may require correct/in-range values for request initialization.
3155
+ # - It may require specifying regional endpoints when creating the service
3156
+ # client as shown in:
3157
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
3158
+ from google.cloud import sqladmin_v1beta4
3159
+
3160
+ def sample_start_replica():
3161
+ # Create a client
3162
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
3163
+
3164
+ # Initialize request argument(s)
3165
+ request = sqladmin_v1beta4.SqlInstancesStartReplicaRequest(
3166
+ )
3167
+
3168
+ # Make the request
3169
+ response = client.start_replica(request=request)
3170
+
3171
+ # Handle the response
3172
+ print(response)
3173
+
3174
+ Args:
3175
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesStartReplicaRequest, dict]):
3176
+ The request object.
3177
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
3178
+ should be retried.
3179
+ timeout (float): The timeout for this request.
3180
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
3181
+ sent along with the request as metadata. Normally, each value must be of type `str`,
3182
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
3183
+ be of type `bytes`.
3184
+
3185
+ Returns:
3186
+ google.cloud.sqladmin_v1beta4.types.Operation:
3187
+ An Operation resource.&nbsp;For
3188
+ successful operations that return an
3189
+ Operation resource, only the fields
3190
+ relevant to the operation are populated
3191
+ in the resource.
3192
+
3193
+ """
3194
+ # Create or coerce a protobuf request object.
3195
+ # - Use the request object if provided (there's no risk of modifying the input as
3196
+ # there are no flattened fields), or create one.
3197
+ if not isinstance(request, cloud_sql.SqlInstancesStartReplicaRequest):
3198
+ request = cloud_sql.SqlInstancesStartReplicaRequest(request)
3199
+
3200
+ # Wrap the RPC method; this adds retry and timeout information,
3201
+ # and friendly error handling.
3202
+ rpc = self._transport._wrapped_methods[self._transport.start_replica]
3203
+
3204
+ # Certain fields should be provided within the metadata header;
3205
+ # add these here.
3206
+ metadata = tuple(metadata) + (
3207
+ gapic_v1.routing_header.to_grpc_metadata(
3208
+ (
3209
+ ("project", request.project),
3210
+ ("instance", request.instance),
3211
+ )
3212
+ ),
3213
+ )
3214
+
3215
+ # Validate the universe domain.
3216
+ self._validate_universe_domain()
3217
+
3218
+ # Send the request.
3219
+ response = rpc(
3220
+ request,
3221
+ retry=retry,
3222
+ timeout=timeout,
3223
+ metadata=metadata,
3224
+ )
3225
+
3226
+ # Done; return the response.
3227
+ return response
3228
+
3229
+ def stop_replica(
3230
+ self,
3231
+ request: Optional[Union[cloud_sql.SqlInstancesStopReplicaRequest, dict]] = None,
3232
+ *,
3233
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
3234
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3235
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
3236
+ ) -> cloud_sql_resources.Operation:
3237
+ r"""Stops the replication in the read replica instance.
3238
+
3239
+ .. code-block:: python
3240
+
3241
+ # This snippet has been automatically generated and should be regarded as a
3242
+ # code template only.
3243
+ # It will require modifications to work:
3244
+ # - It may require correct/in-range values for request initialization.
3245
+ # - It may require specifying regional endpoints when creating the service
3246
+ # client as shown in:
3247
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
3248
+ from google.cloud import sqladmin_v1beta4
3249
+
3250
+ def sample_stop_replica():
3251
+ # Create a client
3252
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
3253
+
3254
+ # Initialize request argument(s)
3255
+ request = sqladmin_v1beta4.SqlInstancesStopReplicaRequest(
3256
+ )
3257
+
3258
+ # Make the request
3259
+ response = client.stop_replica(request=request)
3260
+
3261
+ # Handle the response
3262
+ print(response)
3263
+
3264
+ Args:
3265
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesStopReplicaRequest, dict]):
3266
+ The request object.
3267
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
3268
+ should be retried.
3269
+ timeout (float): The timeout for this request.
3270
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
3271
+ sent along with the request as metadata. Normally, each value must be of type `str`,
3272
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
3273
+ be of type `bytes`.
3274
+
3275
+ Returns:
3276
+ google.cloud.sqladmin_v1beta4.types.Operation:
3277
+ An Operation resource.&nbsp;For
3278
+ successful operations that return an
3279
+ Operation resource, only the fields
3280
+ relevant to the operation are populated
3281
+ in the resource.
3282
+
3283
+ """
3284
+ # Create or coerce a protobuf request object.
3285
+ # - Use the request object if provided (there's no risk of modifying the input as
3286
+ # there are no flattened fields), or create one.
3287
+ if not isinstance(request, cloud_sql.SqlInstancesStopReplicaRequest):
3288
+ request = cloud_sql.SqlInstancesStopReplicaRequest(request)
3289
+
3290
+ # Wrap the RPC method; this adds retry and timeout information,
3291
+ # and friendly error handling.
3292
+ rpc = self._transport._wrapped_methods[self._transport.stop_replica]
3293
+
3294
+ # Certain fields should be provided within the metadata header;
3295
+ # add these here.
3296
+ metadata = tuple(metadata) + (
3297
+ gapic_v1.routing_header.to_grpc_metadata(
3298
+ (
3299
+ ("project", request.project),
3300
+ ("instance", request.instance),
3301
+ )
3302
+ ),
3303
+ )
3304
+
3305
+ # Validate the universe domain.
3306
+ self._validate_universe_domain()
3307
+
3308
+ # Send the request.
3309
+ response = rpc(
3310
+ request,
3311
+ retry=retry,
3312
+ timeout=timeout,
3313
+ metadata=metadata,
3314
+ )
3315
+
3316
+ # Done; return the response.
3317
+ return response
3318
+
3319
+ def truncate_log(
3320
+ self,
3321
+ request: Optional[Union[cloud_sql.SqlInstancesTruncateLogRequest, dict]] = None,
3322
+ *,
3323
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
3324
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3325
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
3326
+ ) -> cloud_sql_resources.Operation:
3327
+ r"""Truncate MySQL general and slow query log tables
3328
+ MySQL only.
3329
+
3330
+ .. code-block:: python
3331
+
3332
+ # This snippet has been automatically generated and should be regarded as a
3333
+ # code template only.
3334
+ # It will require modifications to work:
3335
+ # - It may require correct/in-range values for request initialization.
3336
+ # - It may require specifying regional endpoints when creating the service
3337
+ # client as shown in:
3338
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
3339
+ from google.cloud import sqladmin_v1beta4
3340
+
3341
+ def sample_truncate_log():
3342
+ # Create a client
3343
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
3344
+
3345
+ # Initialize request argument(s)
3346
+ request = sqladmin_v1beta4.SqlInstancesTruncateLogRequest(
3347
+ )
3348
+
3349
+ # Make the request
3350
+ response = client.truncate_log(request=request)
3351
+
3352
+ # Handle the response
3353
+ print(response)
3354
+
3355
+ Args:
3356
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesTruncateLogRequest, dict]):
3357
+ The request object.
3358
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
3359
+ should be retried.
3360
+ timeout (float): The timeout for this request.
3361
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
3362
+ sent along with the request as metadata. Normally, each value must be of type `str`,
3363
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
3364
+ be of type `bytes`.
3365
+
3366
+ Returns:
3367
+ google.cloud.sqladmin_v1beta4.types.Operation:
3368
+ An Operation resource.&nbsp;For
3369
+ successful operations that return an
3370
+ Operation resource, only the fields
3371
+ relevant to the operation are populated
3372
+ in the resource.
3373
+
3374
+ """
3375
+ # Create or coerce a protobuf request object.
3376
+ # - Use the request object if provided (there's no risk of modifying the input as
3377
+ # there are no flattened fields), or create one.
3378
+ if not isinstance(request, cloud_sql.SqlInstancesTruncateLogRequest):
3379
+ request = cloud_sql.SqlInstancesTruncateLogRequest(request)
3380
+
3381
+ # Wrap the RPC method; this adds retry and timeout information,
3382
+ # and friendly error handling.
3383
+ rpc = self._transport._wrapped_methods[self._transport.truncate_log]
3384
+
3385
+ # Certain fields should be provided within the metadata header;
3386
+ # add these here.
3387
+ metadata = tuple(metadata) + (
3388
+ gapic_v1.routing_header.to_grpc_metadata(
3389
+ (
3390
+ ("project", request.project),
3391
+ ("instance", request.instance),
3392
+ )
3393
+ ),
3394
+ )
3395
+
3396
+ # Validate the universe domain.
3397
+ self._validate_universe_domain()
3398
+
3399
+ # Send the request.
3400
+ response = rpc(
3401
+ request,
3402
+ retry=retry,
3403
+ timeout=timeout,
3404
+ metadata=metadata,
3405
+ )
3406
+
3407
+ # Done; return the response.
3408
+ return response
3409
+
3410
+ def update(
3411
+ self,
3412
+ request: Optional[Union[cloud_sql.SqlInstancesUpdateRequest, dict]] = None,
3413
+ *,
3414
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
3415
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3416
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
3417
+ ) -> cloud_sql_resources.Operation:
3418
+ r"""Updates settings of a Cloud SQL instance. Using this
3419
+ operation might cause your instance to restart.
3420
+
3421
+ .. code-block:: python
3422
+
3423
+ # This snippet has been automatically generated and should be regarded as a
3424
+ # code template only.
3425
+ # It will require modifications to work:
3426
+ # - It may require correct/in-range values for request initialization.
3427
+ # - It may require specifying regional endpoints when creating the service
3428
+ # client as shown in:
3429
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
3430
+ from google.cloud import sqladmin_v1beta4
3431
+
3432
+ def sample_update():
3433
+ # Create a client
3434
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
3435
+
3436
+ # Initialize request argument(s)
3437
+ request = sqladmin_v1beta4.SqlInstancesUpdateRequest(
3438
+ )
3439
+
3440
+ # Make the request
3441
+ response = client.update(request=request)
3442
+
3443
+ # Handle the response
3444
+ print(response)
3445
+
3446
+ Args:
3447
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesUpdateRequest, dict]):
3448
+ The request object.
3449
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
3450
+ should be retried.
3451
+ timeout (float): The timeout for this request.
3452
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
3453
+ sent along with the request as metadata. Normally, each value must be of type `str`,
3454
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
3455
+ be of type `bytes`.
3456
+
3457
+ Returns:
3458
+ google.cloud.sqladmin_v1beta4.types.Operation:
3459
+ An Operation resource.&nbsp;For
3460
+ successful operations that return an
3461
+ Operation resource, only the fields
3462
+ relevant to the operation are populated
3463
+ in the resource.
3464
+
3465
+ """
3466
+ # Create or coerce a protobuf request object.
3467
+ # - Use the request object if provided (there's no risk of modifying the input as
3468
+ # there are no flattened fields), or create one.
3469
+ if not isinstance(request, cloud_sql.SqlInstancesUpdateRequest):
3470
+ request = cloud_sql.SqlInstancesUpdateRequest(request)
3471
+
3472
+ # Wrap the RPC method; this adds retry and timeout information,
3473
+ # and friendly error handling.
3474
+ rpc = self._transport._wrapped_methods[self._transport.update]
3475
+
3476
+ # Certain fields should be provided within the metadata header;
3477
+ # add these here.
3478
+ metadata = tuple(metadata) + (
3479
+ gapic_v1.routing_header.to_grpc_metadata(
3480
+ (
3481
+ ("project", request.project),
3482
+ ("instance", request.instance),
3483
+ )
3484
+ ),
3485
+ )
3486
+
3487
+ # Validate the universe domain.
3488
+ self._validate_universe_domain()
3489
+
3490
+ # Send the request.
3491
+ response = rpc(
3492
+ request,
3493
+ retry=retry,
3494
+ timeout=timeout,
3495
+ metadata=metadata,
3496
+ )
3497
+
3498
+ # Done; return the response.
3499
+ return response
3500
+
3501
+ def create_ephemeral(
3502
+ self,
3503
+ request: Optional[
3504
+ Union[cloud_sql.SqlInstancesCreateEphemeralCertRequest, dict]
3505
+ ] = None,
3506
+ *,
3507
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
3508
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3509
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
3510
+ ) -> cloud_sql_resources.SslCert:
3511
+ r"""Generates a short-lived X509 certificate containing
3512
+ the provided public key and signed by a private key
3513
+ specific to the target instance. Users may use the
3514
+ certificate to authenticate as themselves when
3515
+ connecting to the database.
3516
+
3517
+ .. code-block:: python
3518
+
3519
+ # This snippet has been automatically generated and should be regarded as a
3520
+ # code template only.
3521
+ # It will require modifications to work:
3522
+ # - It may require correct/in-range values for request initialization.
3523
+ # - It may require specifying regional endpoints when creating the service
3524
+ # client as shown in:
3525
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
3526
+ from google.cloud import sqladmin_v1beta4
3527
+
3528
+ def sample_create_ephemeral():
3529
+ # Create a client
3530
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
3531
+
3532
+ # Initialize request argument(s)
3533
+ request = sqladmin_v1beta4.SqlInstancesCreateEphemeralCertRequest(
3534
+ )
3535
+
3536
+ # Make the request
3537
+ response = client.create_ephemeral(request=request)
3538
+
3539
+ # Handle the response
3540
+ print(response)
3541
+
3542
+ Args:
3543
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesCreateEphemeralCertRequest, dict]):
3544
+ The request object.
3545
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
3546
+ should be retried.
3547
+ timeout (float): The timeout for this request.
3548
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
3549
+ sent along with the request as metadata. Normally, each value must be of type `str`,
3550
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
3551
+ be of type `bytes`.
3552
+
3553
+ Returns:
3554
+ google.cloud.sqladmin_v1beta4.types.SslCert:
3555
+ SslCerts Resource
3556
+ """
3557
+ # Create or coerce a protobuf request object.
3558
+ # - Use the request object if provided (there's no risk of modifying the input as
3559
+ # there are no flattened fields), or create one.
3560
+ if not isinstance(request, cloud_sql.SqlInstancesCreateEphemeralCertRequest):
3561
+ request = cloud_sql.SqlInstancesCreateEphemeralCertRequest(request)
3562
+
3563
+ # Wrap the RPC method; this adds retry and timeout information,
3564
+ # and friendly error handling.
3565
+ rpc = self._transport._wrapped_methods[self._transport.create_ephemeral]
3566
+
3567
+ # Certain fields should be provided within the metadata header;
3568
+ # add these here.
3569
+ metadata = tuple(metadata) + (
3570
+ gapic_v1.routing_header.to_grpc_metadata(
3571
+ (
3572
+ ("project", request.project),
3573
+ ("instance", request.instance),
3574
+ )
3575
+ ),
3576
+ )
3577
+
3578
+ # Validate the universe domain.
3579
+ self._validate_universe_domain()
3580
+
3581
+ # Send the request.
3582
+ response = rpc(
3583
+ request,
3584
+ retry=retry,
3585
+ timeout=timeout,
3586
+ metadata=metadata,
3587
+ )
3588
+
3589
+ # Done; return the response.
3590
+ return response
3591
+
3592
+ def reschedule_maintenance(
3593
+ self,
3594
+ request: Optional[
3595
+ Union[cloud_sql.SqlInstancesRescheduleMaintenanceRequest, dict]
3596
+ ] = None,
3597
+ *,
3598
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
3599
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3600
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
3601
+ ) -> cloud_sql_resources.Operation:
3602
+ r"""Reschedules the maintenance on the given instance.
3603
+
3604
+ .. code-block:: python
3605
+
3606
+ # This snippet has been automatically generated and should be regarded as a
3607
+ # code template only.
3608
+ # It will require modifications to work:
3609
+ # - It may require correct/in-range values for request initialization.
3610
+ # - It may require specifying regional endpoints when creating the service
3611
+ # client as shown in:
3612
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
3613
+ from google.cloud import sqladmin_v1beta4
3614
+
3615
+ def sample_reschedule_maintenance():
3616
+ # Create a client
3617
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
3618
+
3619
+ # Initialize request argument(s)
3620
+ request = sqladmin_v1beta4.SqlInstancesRescheduleMaintenanceRequest(
3621
+ )
3622
+
3623
+ # Make the request
3624
+ response = client.reschedule_maintenance(request=request)
3625
+
3626
+ # Handle the response
3627
+ print(response)
3628
+
3629
+ Args:
3630
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesRescheduleMaintenanceRequest, dict]):
3631
+ The request object.
3632
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
3633
+ should be retried.
3634
+ timeout (float): The timeout for this request.
3635
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
3636
+ sent along with the request as metadata. Normally, each value must be of type `str`,
3637
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
3638
+ be of type `bytes`.
3639
+
3640
+ Returns:
3641
+ google.cloud.sqladmin_v1beta4.types.Operation:
3642
+ An Operation resource.&nbsp;For
3643
+ successful operations that return an
3644
+ Operation resource, only the fields
3645
+ relevant to the operation are populated
3646
+ in the resource.
3647
+
3648
+ """
3649
+ # Create or coerce a protobuf request object.
3650
+ # - Use the request object if provided (there's no risk of modifying the input as
3651
+ # there are no flattened fields), or create one.
3652
+ if not isinstance(request, cloud_sql.SqlInstancesRescheduleMaintenanceRequest):
3653
+ request = cloud_sql.SqlInstancesRescheduleMaintenanceRequest(request)
3654
+
3655
+ # Wrap the RPC method; this adds retry and timeout information,
3656
+ # and friendly error handling.
3657
+ rpc = self._transport._wrapped_methods[self._transport.reschedule_maintenance]
3658
+
3659
+ # Certain fields should be provided within the metadata header;
3660
+ # add these here.
3661
+ metadata = tuple(metadata) + (
3662
+ gapic_v1.routing_header.to_grpc_metadata(
3663
+ (
3664
+ ("project", request.project),
3665
+ ("instance", request.instance),
3666
+ )
3667
+ ),
3668
+ )
3669
+
3670
+ # Validate the universe domain.
3671
+ self._validate_universe_domain()
3672
+
3673
+ # Send the request.
3674
+ response = rpc(
3675
+ request,
3676
+ retry=retry,
3677
+ timeout=timeout,
3678
+ metadata=metadata,
3679
+ )
3680
+
3681
+ # Done; return the response.
3682
+ return response
3683
+
3684
+ def verify_external_sync_settings(
3685
+ self,
3686
+ request: Optional[
3687
+ Union[cloud_sql.SqlInstancesVerifyExternalSyncSettingsRequest, dict]
3688
+ ] = None,
3689
+ *,
3690
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
3691
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3692
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
3693
+ ) -> cloud_sql_resources.SqlInstancesVerifyExternalSyncSettingsResponse:
3694
+ r"""Verify External primary instance external sync
3695
+ settings.
3696
+
3697
+ .. code-block:: python
3698
+
3699
+ # This snippet has been automatically generated and should be regarded as a
3700
+ # code template only.
3701
+ # It will require modifications to work:
3702
+ # - It may require correct/in-range values for request initialization.
3703
+ # - It may require specifying regional endpoints when creating the service
3704
+ # client as shown in:
3705
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
3706
+ from google.cloud import sqladmin_v1beta4
3707
+
3708
+ def sample_verify_external_sync_settings():
3709
+ # Create a client
3710
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
3711
+
3712
+ # Initialize request argument(s)
3713
+ request = sqladmin_v1beta4.SqlInstancesVerifyExternalSyncSettingsRequest(
3714
+ )
3715
+
3716
+ # Make the request
3717
+ response = client.verify_external_sync_settings(request=request)
3718
+
3719
+ # Handle the response
3720
+ print(response)
3721
+
3722
+ Args:
3723
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesVerifyExternalSyncSettingsRequest, dict]):
3724
+ The request object.
3725
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
3726
+ should be retried.
3727
+ timeout (float): The timeout for this request.
3728
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
3729
+ sent along with the request as metadata. Normally, each value must be of type `str`,
3730
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
3731
+ be of type `bytes`.
3732
+
3733
+ Returns:
3734
+ google.cloud.sqladmin_v1beta4.types.SqlInstancesVerifyExternalSyncSettingsResponse:
3735
+ Instance verify external sync
3736
+ settings response.
3737
+
3738
+ """
3739
+ # Create or coerce a protobuf request object.
3740
+ # - Use the request object if provided (there's no risk of modifying the input as
3741
+ # there are no flattened fields), or create one.
3742
+ if not isinstance(
3743
+ request, cloud_sql.SqlInstancesVerifyExternalSyncSettingsRequest
3744
+ ):
3745
+ request = cloud_sql.SqlInstancesVerifyExternalSyncSettingsRequest(request)
3746
+
3747
+ # Wrap the RPC method; this adds retry and timeout information,
3748
+ # and friendly error handling.
3749
+ rpc = self._transport._wrapped_methods[
3750
+ self._transport.verify_external_sync_settings
3751
+ ]
3752
+
3753
+ # Certain fields should be provided within the metadata header;
3754
+ # add these here.
3755
+ metadata = tuple(metadata) + (
3756
+ gapic_v1.routing_header.to_grpc_metadata(
3757
+ (
3758
+ ("project", request.project),
3759
+ ("instance", request.instance),
3760
+ )
3761
+ ),
3762
+ )
3763
+
3764
+ # Validate the universe domain.
3765
+ self._validate_universe_domain()
3766
+
3767
+ # Send the request.
3768
+ response = rpc(
3769
+ request,
3770
+ retry=retry,
3771
+ timeout=timeout,
3772
+ metadata=metadata,
3773
+ )
3774
+
3775
+ # Done; return the response.
3776
+ return response
3777
+
3778
+ def start_external_sync(
3779
+ self,
3780
+ request: Optional[
3781
+ Union[cloud_sql.SqlInstancesStartExternalSyncRequest, dict]
3782
+ ] = None,
3783
+ *,
3784
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
3785
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3786
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
3787
+ ) -> cloud_sql_resources.Operation:
3788
+ r"""Start External primary instance migration.
3789
+
3790
+ .. code-block:: python
3791
+
3792
+ # This snippet has been automatically generated and should be regarded as a
3793
+ # code template only.
3794
+ # It will require modifications to work:
3795
+ # - It may require correct/in-range values for request initialization.
3796
+ # - It may require specifying regional endpoints when creating the service
3797
+ # client as shown in:
3798
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
3799
+ from google.cloud import sqladmin_v1beta4
3800
+
3801
+ def sample_start_external_sync():
3802
+ # Create a client
3803
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
3804
+
3805
+ # Initialize request argument(s)
3806
+ request = sqladmin_v1beta4.SqlInstancesStartExternalSyncRequest(
3807
+ )
3808
+
3809
+ # Make the request
3810
+ response = client.start_external_sync(request=request)
3811
+
3812
+ # Handle the response
3813
+ print(response)
3814
+
3815
+ Args:
3816
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesStartExternalSyncRequest, dict]):
3817
+ The request object.
3818
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
3819
+ should be retried.
3820
+ timeout (float): The timeout for this request.
3821
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
3822
+ sent along with the request as metadata. Normally, each value must be of type `str`,
3823
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
3824
+ be of type `bytes`.
3825
+
3826
+ Returns:
3827
+ google.cloud.sqladmin_v1beta4.types.Operation:
3828
+ An Operation resource.&nbsp;For
3829
+ successful operations that return an
3830
+ Operation resource, only the fields
3831
+ relevant to the operation are populated
3832
+ in the resource.
3833
+
3834
+ """
3835
+ # Create or coerce a protobuf request object.
3836
+ # - Use the request object if provided (there's no risk of modifying the input as
3837
+ # there are no flattened fields), or create one.
3838
+ if not isinstance(request, cloud_sql.SqlInstancesStartExternalSyncRequest):
3839
+ request = cloud_sql.SqlInstancesStartExternalSyncRequest(request)
3840
+
3841
+ # Wrap the RPC method; this adds retry and timeout information,
3842
+ # and friendly error handling.
3843
+ rpc = self._transport._wrapped_methods[self._transport.start_external_sync]
3844
+
3845
+ # Certain fields should be provided within the metadata header;
3846
+ # add these here.
3847
+ metadata = tuple(metadata) + (
3848
+ gapic_v1.routing_header.to_grpc_metadata(
3849
+ (
3850
+ ("project", request.project),
3851
+ ("instance", request.instance),
3852
+ )
3853
+ ),
3854
+ )
3855
+
3856
+ # Validate the universe domain.
3857
+ self._validate_universe_domain()
3858
+
3859
+ # Send the request.
3860
+ response = rpc(
3861
+ request,
3862
+ retry=retry,
3863
+ timeout=timeout,
3864
+ metadata=metadata,
3865
+ )
3866
+
3867
+ # Done; return the response.
3868
+ return response
3869
+
3870
+ def perform_disk_shrink(
3871
+ self,
3872
+ request: Optional[
3873
+ Union[cloud_sql.SqlInstancesPerformDiskShrinkRequest, dict]
3874
+ ] = None,
3875
+ *,
3876
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
3877
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3878
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
3879
+ ) -> cloud_sql_resources.Operation:
3880
+ r"""Perform Disk Shrink on primary instance.
3881
+
3882
+ .. code-block:: python
3883
+
3884
+ # This snippet has been automatically generated and should be regarded as a
3885
+ # code template only.
3886
+ # It will require modifications to work:
3887
+ # - It may require correct/in-range values for request initialization.
3888
+ # - It may require specifying regional endpoints when creating the service
3889
+ # client as shown in:
3890
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
3891
+ from google.cloud import sqladmin_v1beta4
3892
+
3893
+ def sample_perform_disk_shrink():
3894
+ # Create a client
3895
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
3896
+
3897
+ # Initialize request argument(s)
3898
+ request = sqladmin_v1beta4.SqlInstancesPerformDiskShrinkRequest(
3899
+ )
3900
+
3901
+ # Make the request
3902
+ response = client.perform_disk_shrink(request=request)
3903
+
3904
+ # Handle the response
3905
+ print(response)
3906
+
3907
+ Args:
3908
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesPerformDiskShrinkRequest, dict]):
3909
+ The request object. Instance perform disk shrink request.
3910
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
3911
+ should be retried.
3912
+ timeout (float): The timeout for this request.
3913
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
3914
+ sent along with the request as metadata. Normally, each value must be of type `str`,
3915
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
3916
+ be of type `bytes`.
3917
+
3918
+ Returns:
3919
+ google.cloud.sqladmin_v1beta4.types.Operation:
3920
+ An Operation resource.&nbsp;For
3921
+ successful operations that return an
3922
+ Operation resource, only the fields
3923
+ relevant to the operation are populated
3924
+ in the resource.
3925
+
3926
+ """
3927
+ # Create or coerce a protobuf request object.
3928
+ # - Use the request object if provided (there's no risk of modifying the input as
3929
+ # there are no flattened fields), or create one.
3930
+ if not isinstance(request, cloud_sql.SqlInstancesPerformDiskShrinkRequest):
3931
+ request = cloud_sql.SqlInstancesPerformDiskShrinkRequest(request)
3932
+
3933
+ # Wrap the RPC method; this adds retry and timeout information,
3934
+ # and friendly error handling.
3935
+ rpc = self._transport._wrapped_methods[self._transport.perform_disk_shrink]
3936
+
3937
+ # Certain fields should be provided within the metadata header;
3938
+ # add these here.
3939
+ metadata = tuple(metadata) + (
3940
+ gapic_v1.routing_header.to_grpc_metadata(
3941
+ (
3942
+ ("project", request.project),
3943
+ ("instance", request.instance),
3944
+ )
3945
+ ),
3946
+ )
3947
+
3948
+ # Validate the universe domain.
3949
+ self._validate_universe_domain()
3950
+
3951
+ # Send the request.
3952
+ response = rpc(
3953
+ request,
3954
+ retry=retry,
3955
+ timeout=timeout,
3956
+ metadata=metadata,
3957
+ )
3958
+
3959
+ # Done; return the response.
3960
+ return response
3961
+
3962
+ def get_disk_shrink_config(
3963
+ self,
3964
+ request: Optional[
3965
+ Union[cloud_sql.SqlInstancesGetDiskShrinkConfigRequest, dict]
3966
+ ] = None,
3967
+ *,
3968
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
3969
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
3970
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
3971
+ ) -> cloud_sql_resources.SqlInstancesGetDiskShrinkConfigResponse:
3972
+ r"""Get Disk Shrink Config for a given instance.
3973
+
3974
+ .. code-block:: python
3975
+
3976
+ # This snippet has been automatically generated and should be regarded as a
3977
+ # code template only.
3978
+ # It will require modifications to work:
3979
+ # - It may require correct/in-range values for request initialization.
3980
+ # - It may require specifying regional endpoints when creating the service
3981
+ # client as shown in:
3982
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
3983
+ from google.cloud import sqladmin_v1beta4
3984
+
3985
+ def sample_get_disk_shrink_config():
3986
+ # Create a client
3987
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
3988
+
3989
+ # Initialize request argument(s)
3990
+ request = sqladmin_v1beta4.SqlInstancesGetDiskShrinkConfigRequest(
3991
+ )
3992
+
3993
+ # Make the request
3994
+ response = client.get_disk_shrink_config(request=request)
3995
+
3996
+ # Handle the response
3997
+ print(response)
3998
+
3999
+ Args:
4000
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesGetDiskShrinkConfigRequest, dict]):
4001
+ The request object. Instance get disk shrink config
4002
+ request.
4003
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
4004
+ should be retried.
4005
+ timeout (float): The timeout for this request.
4006
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
4007
+ sent along with the request as metadata. Normally, each value must be of type `str`,
4008
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
4009
+ be of type `bytes`.
4010
+
4011
+ Returns:
4012
+ google.cloud.sqladmin_v1beta4.types.SqlInstancesGetDiskShrinkConfigResponse:
4013
+ Instance get disk shrink config
4014
+ response.
4015
+
4016
+ """
4017
+ # Create or coerce a protobuf request object.
4018
+ # - Use the request object if provided (there's no risk of modifying the input as
4019
+ # there are no flattened fields), or create one.
4020
+ if not isinstance(request, cloud_sql.SqlInstancesGetDiskShrinkConfigRequest):
4021
+ request = cloud_sql.SqlInstancesGetDiskShrinkConfigRequest(request)
4022
+
4023
+ # Wrap the RPC method; this adds retry and timeout information,
4024
+ # and friendly error handling.
4025
+ rpc = self._transport._wrapped_methods[self._transport.get_disk_shrink_config]
4026
+
4027
+ # Certain fields should be provided within the metadata header;
4028
+ # add these here.
4029
+ metadata = tuple(metadata) + (
4030
+ gapic_v1.routing_header.to_grpc_metadata(
4031
+ (
4032
+ ("project", request.project),
4033
+ ("instance", request.instance),
4034
+ )
4035
+ ),
4036
+ )
4037
+
4038
+ # Validate the universe domain.
4039
+ self._validate_universe_domain()
4040
+
4041
+ # Send the request.
4042
+ response = rpc(
4043
+ request,
4044
+ retry=retry,
4045
+ timeout=timeout,
4046
+ metadata=metadata,
4047
+ )
4048
+
4049
+ # Done; return the response.
4050
+ return response
4051
+
4052
+ def reset_replica_size(
4053
+ self,
4054
+ request: Optional[
4055
+ Union[cloud_sql.SqlInstancesResetReplicaSizeRequest, dict]
4056
+ ] = None,
4057
+ *,
4058
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
4059
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
4060
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
4061
+ ) -> cloud_sql_resources.Operation:
4062
+ r"""Reset Replica Size to primary instance disk size.
4063
+
4064
+ .. code-block:: python
4065
+
4066
+ # This snippet has been automatically generated and should be regarded as a
4067
+ # code template only.
4068
+ # It will require modifications to work:
4069
+ # - It may require correct/in-range values for request initialization.
4070
+ # - It may require specifying regional endpoints when creating the service
4071
+ # client as shown in:
4072
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
4073
+ from google.cloud import sqladmin_v1beta4
4074
+
4075
+ def sample_reset_replica_size():
4076
+ # Create a client
4077
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
4078
+
4079
+ # Initialize request argument(s)
4080
+ request = sqladmin_v1beta4.SqlInstancesResetReplicaSizeRequest(
4081
+ )
4082
+
4083
+ # Make the request
4084
+ response = client.reset_replica_size(request=request)
4085
+
4086
+ # Handle the response
4087
+ print(response)
4088
+
4089
+ Args:
4090
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesResetReplicaSizeRequest, dict]):
4091
+ The request object. Instance reset replica size request.
4092
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
4093
+ should be retried.
4094
+ timeout (float): The timeout for this request.
4095
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
4096
+ sent along with the request as metadata. Normally, each value must be of type `str`,
4097
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
4098
+ be of type `bytes`.
4099
+
4100
+ Returns:
4101
+ google.cloud.sqladmin_v1beta4.types.Operation:
4102
+ An Operation resource.&nbsp;For
4103
+ successful operations that return an
4104
+ Operation resource, only the fields
4105
+ relevant to the operation are populated
4106
+ in the resource.
4107
+
4108
+ """
4109
+ # Create or coerce a protobuf request object.
4110
+ # - Use the request object if provided (there's no risk of modifying the input as
4111
+ # there are no flattened fields), or create one.
4112
+ if not isinstance(request, cloud_sql.SqlInstancesResetReplicaSizeRequest):
4113
+ request = cloud_sql.SqlInstancesResetReplicaSizeRequest(request)
4114
+
4115
+ # Wrap the RPC method; this adds retry and timeout information,
4116
+ # and friendly error handling.
4117
+ rpc = self._transport._wrapped_methods[self._transport.reset_replica_size]
4118
+
4119
+ # Certain fields should be provided within the metadata header;
4120
+ # add these here.
4121
+ metadata = tuple(metadata) + (
4122
+ gapic_v1.routing_header.to_grpc_metadata(
4123
+ (
4124
+ ("project", request.project),
4125
+ ("instance", request.instance),
4126
+ )
4127
+ ),
4128
+ )
4129
+
4130
+ # Validate the universe domain.
4131
+ self._validate_universe_domain()
4132
+
4133
+ # Send the request.
4134
+ response = rpc(
4135
+ request,
4136
+ retry=retry,
4137
+ timeout=timeout,
4138
+ metadata=metadata,
4139
+ )
4140
+
4141
+ # Done; return the response.
4142
+ return response
4143
+
4144
+ def get_latest_recovery_time(
4145
+ self,
4146
+ request: Optional[
4147
+ Union[cloud_sql.SqlInstancesGetLatestRecoveryTimeRequest, dict]
4148
+ ] = None,
4149
+ *,
4150
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
4151
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
4152
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
4153
+ ) -> cloud_sql.SqlInstancesGetLatestRecoveryTimeResponse:
4154
+ r"""Get Latest Recovery Time for a given instance.
4155
+
4156
+ .. code-block:: python
4157
+
4158
+ # This snippet has been automatically generated and should be regarded as a
4159
+ # code template only.
4160
+ # It will require modifications to work:
4161
+ # - It may require correct/in-range values for request initialization.
4162
+ # - It may require specifying regional endpoints when creating the service
4163
+ # client as shown in:
4164
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
4165
+ from google.cloud import sqladmin_v1beta4
4166
+
4167
+ def sample_get_latest_recovery_time():
4168
+ # Create a client
4169
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
4170
+
4171
+ # Initialize request argument(s)
4172
+ request = sqladmin_v1beta4.SqlInstancesGetLatestRecoveryTimeRequest(
4173
+ )
4174
+
4175
+ # Make the request
4176
+ response = client.get_latest_recovery_time(request=request)
4177
+
4178
+ # Handle the response
4179
+ print(response)
4180
+
4181
+ Args:
4182
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesGetLatestRecoveryTimeRequest, dict]):
4183
+ The request object. Instance get latest recovery time
4184
+ request.
4185
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
4186
+ should be retried.
4187
+ timeout (float): The timeout for this request.
4188
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
4189
+ sent along with the request as metadata. Normally, each value must be of type `str`,
4190
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
4191
+ be of type `bytes`.
4192
+
4193
+ Returns:
4194
+ google.cloud.sqladmin_v1beta4.types.SqlInstancesGetLatestRecoveryTimeResponse:
4195
+ Instance get latest recovery time
4196
+ response.
4197
+
4198
+ """
4199
+ # Create or coerce a protobuf request object.
4200
+ # - Use the request object if provided (there's no risk of modifying the input as
4201
+ # there are no flattened fields), or create one.
4202
+ if not isinstance(request, cloud_sql.SqlInstancesGetLatestRecoveryTimeRequest):
4203
+ request = cloud_sql.SqlInstancesGetLatestRecoveryTimeRequest(request)
4204
+
4205
+ # Wrap the RPC method; this adds retry and timeout information,
4206
+ # and friendly error handling.
4207
+ rpc = self._transport._wrapped_methods[self._transport.get_latest_recovery_time]
4208
+
4209
+ # Certain fields should be provided within the metadata header;
4210
+ # add these here.
4211
+ metadata = tuple(metadata) + (
4212
+ gapic_v1.routing_header.to_grpc_metadata(
4213
+ (
4214
+ ("project", request.project),
4215
+ ("instance", request.instance),
4216
+ )
4217
+ ),
4218
+ )
4219
+
4220
+ # Validate the universe domain.
4221
+ self._validate_universe_domain()
4222
+
4223
+ # Send the request.
4224
+ response = rpc(
4225
+ request,
4226
+ retry=retry,
4227
+ timeout=timeout,
4228
+ metadata=metadata,
4229
+ )
4230
+
4231
+ # Done; return the response.
4232
+ return response
4233
+
4234
+ def execute_sql(
4235
+ self,
4236
+ request: Optional[Union[cloud_sql.SqlInstancesExecuteSqlRequest, dict]] = None,
4237
+ *,
4238
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
4239
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
4240
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
4241
+ ) -> cloud_sql.SqlInstancesExecuteSqlResponse:
4242
+ r"""Execute SQL statements.
4243
+
4244
+ .. code-block:: python
4245
+
4246
+ # This snippet has been automatically generated and should be regarded as a
4247
+ # code template only.
4248
+ # It will require modifications to work:
4249
+ # - It may require correct/in-range values for request initialization.
4250
+ # - It may require specifying regional endpoints when creating the service
4251
+ # client as shown in:
4252
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
4253
+ from google.cloud import sqladmin_v1beta4
4254
+
4255
+ def sample_execute_sql():
4256
+ # Create a client
4257
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
4258
+
4259
+ # Initialize request argument(s)
4260
+ request = sqladmin_v1beta4.SqlInstancesExecuteSqlRequest(
4261
+ instance="instance_value",
4262
+ project="project_value",
4263
+ )
4264
+
4265
+ # Make the request
4266
+ response = client.execute_sql(request=request)
4267
+
4268
+ # Handle the response
4269
+ print(response)
4270
+
4271
+ Args:
4272
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesExecuteSqlRequest, dict]):
4273
+ The request object. Execute SQL statements request.
4274
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
4275
+ should be retried.
4276
+ timeout (float): The timeout for this request.
4277
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
4278
+ sent along with the request as metadata. Normally, each value must be of type `str`,
4279
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
4280
+ be of type `bytes`.
4281
+
4282
+ Returns:
4283
+ google.cloud.sqladmin_v1beta4.types.SqlInstancesExecuteSqlResponse:
4284
+ Execute SQL statements response.
4285
+ """
4286
+ # Create or coerce a protobuf request object.
4287
+ # - Use the request object if provided (there's no risk of modifying the input as
4288
+ # there are no flattened fields), or create one.
4289
+ if not isinstance(request, cloud_sql.SqlInstancesExecuteSqlRequest):
4290
+ request = cloud_sql.SqlInstancesExecuteSqlRequest(request)
4291
+
4292
+ # Wrap the RPC method; this adds retry and timeout information,
4293
+ # and friendly error handling.
4294
+ rpc = self._transport._wrapped_methods[self._transport.execute_sql]
4295
+
4296
+ # Certain fields should be provided within the metadata header;
4297
+ # add these here.
4298
+ metadata = tuple(metadata) + (
4299
+ gapic_v1.routing_header.to_grpc_metadata(
4300
+ (
4301
+ ("project", request.project),
4302
+ ("instance", request.instance),
4303
+ )
4304
+ ),
4305
+ )
4306
+
4307
+ # Validate the universe domain.
4308
+ self._validate_universe_domain()
4309
+
4310
+ # Send the request.
4311
+ response = rpc(
4312
+ request,
4313
+ retry=retry,
4314
+ timeout=timeout,
4315
+ metadata=metadata,
4316
+ )
4317
+
4318
+ # Done; return the response.
4319
+ return response
4320
+
4321
+ def acquire_ssrs_lease(
4322
+ self,
4323
+ request: Optional[
4324
+ Union[cloud_sql.SqlInstancesAcquireSsrsLeaseRequest, dict]
4325
+ ] = None,
4326
+ *,
4327
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
4328
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
4329
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
4330
+ ) -> cloud_sql.SqlInstancesAcquireSsrsLeaseResponse:
4331
+ r"""Acquire a lease for the setup of SQL Server Reporting
4332
+ Services (SSRS).
4333
+
4334
+ .. code-block:: python
4335
+
4336
+ # This snippet has been automatically generated and should be regarded as a
4337
+ # code template only.
4338
+ # It will require modifications to work:
4339
+ # - It may require correct/in-range values for request initialization.
4340
+ # - It may require specifying regional endpoints when creating the service
4341
+ # client as shown in:
4342
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
4343
+ from google.cloud import sqladmin_v1beta4
4344
+
4345
+ def sample_acquire_ssrs_lease():
4346
+ # Create a client
4347
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
4348
+
4349
+ # Initialize request argument(s)
4350
+ request = sqladmin_v1beta4.SqlInstancesAcquireSsrsLeaseRequest(
4351
+ instance="instance_value",
4352
+ project="project_value",
4353
+ )
4354
+
4355
+ # Make the request
4356
+ response = client.acquire_ssrs_lease(request=request)
4357
+
4358
+ # Handle the response
4359
+ print(response)
4360
+
4361
+ Args:
4362
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesAcquireSsrsLeaseRequest, dict]):
4363
+ The request object. Request to acquire a lease for SSRS.
4364
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
4365
+ should be retried.
4366
+ timeout (float): The timeout for this request.
4367
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
4368
+ sent along with the request as metadata. Normally, each value must be of type `str`,
4369
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
4370
+ be of type `bytes`.
4371
+
4372
+ Returns:
4373
+ google.cloud.sqladmin_v1beta4.types.SqlInstancesAcquireSsrsLeaseResponse:
4374
+ Acquire SSRS lease response.
4375
+ """
4376
+ # Create or coerce a protobuf request object.
4377
+ # - Use the request object if provided (there's no risk of modifying the input as
4378
+ # there are no flattened fields), or create one.
4379
+ if not isinstance(request, cloud_sql.SqlInstancesAcquireSsrsLeaseRequest):
4380
+ request = cloud_sql.SqlInstancesAcquireSsrsLeaseRequest(request)
4381
+
4382
+ # Wrap the RPC method; this adds retry and timeout information,
4383
+ # and friendly error handling.
4384
+ rpc = self._transport._wrapped_methods[self._transport.acquire_ssrs_lease]
4385
+
4386
+ # Certain fields should be provided within the metadata header;
4387
+ # add these here.
4388
+ metadata = tuple(metadata) + (
4389
+ gapic_v1.routing_header.to_grpc_metadata(
4390
+ (
4391
+ ("project", request.project),
4392
+ ("instance", request.instance),
4393
+ )
4394
+ ),
4395
+ )
4396
+
4397
+ # Validate the universe domain.
4398
+ self._validate_universe_domain()
4399
+
4400
+ # Send the request.
4401
+ response = rpc(
4402
+ request,
4403
+ retry=retry,
4404
+ timeout=timeout,
4405
+ metadata=metadata,
4406
+ )
4407
+
4408
+ # Done; return the response.
4409
+ return response
4410
+
4411
+ def release_ssrs_lease(
4412
+ self,
4413
+ request: Optional[
4414
+ Union[cloud_sql.SqlInstancesReleaseSsrsLeaseRequest, dict]
4415
+ ] = None,
4416
+ *,
4417
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
4418
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
4419
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
4420
+ ) -> cloud_sql.SqlInstancesReleaseSsrsLeaseResponse:
4421
+ r"""Release a lease for the setup of SQL Server Reporting
4422
+ Services (SSRS).
4423
+
4424
+ .. code-block:: python
4425
+
4426
+ # This snippet has been automatically generated and should be regarded as a
4427
+ # code template only.
4428
+ # It will require modifications to work:
4429
+ # - It may require correct/in-range values for request initialization.
4430
+ # - It may require specifying regional endpoints when creating the service
4431
+ # client as shown in:
4432
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
4433
+ from google.cloud import sqladmin_v1beta4
4434
+
4435
+ def sample_release_ssrs_lease():
4436
+ # Create a client
4437
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
4438
+
4439
+ # Initialize request argument(s)
4440
+ request = sqladmin_v1beta4.SqlInstancesReleaseSsrsLeaseRequest(
4441
+ instance="instance_value",
4442
+ project="project_value",
4443
+ )
4444
+
4445
+ # Make the request
4446
+ response = client.release_ssrs_lease(request=request)
4447
+
4448
+ # Handle the response
4449
+ print(response)
4450
+
4451
+ Args:
4452
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesReleaseSsrsLeaseRequest, dict]):
4453
+ The request object. Request to release a lease for SSRS.
4454
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
4455
+ should be retried.
4456
+ timeout (float): The timeout for this request.
4457
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
4458
+ sent along with the request as metadata. Normally, each value must be of type `str`,
4459
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
4460
+ be of type `bytes`.
4461
+
4462
+ Returns:
4463
+ google.cloud.sqladmin_v1beta4.types.SqlInstancesReleaseSsrsLeaseResponse:
4464
+ The response for the release of the
4465
+ SSRS lease.
4466
+
4467
+ """
4468
+ # Create or coerce a protobuf request object.
4469
+ # - Use the request object if provided (there's no risk of modifying the input as
4470
+ # there are no flattened fields), or create one.
4471
+ if not isinstance(request, cloud_sql.SqlInstancesReleaseSsrsLeaseRequest):
4472
+ request = cloud_sql.SqlInstancesReleaseSsrsLeaseRequest(request)
4473
+
4474
+ # Wrap the RPC method; this adds retry and timeout information,
4475
+ # and friendly error handling.
4476
+ rpc = self._transport._wrapped_methods[self._transport.release_ssrs_lease]
4477
+
4478
+ # Certain fields should be provided within the metadata header;
4479
+ # add these here.
4480
+ metadata = tuple(metadata) + (
4481
+ gapic_v1.routing_header.to_grpc_metadata(
4482
+ (
4483
+ ("project", request.project),
4484
+ ("instance", request.instance),
4485
+ )
4486
+ ),
4487
+ )
4488
+
4489
+ # Validate the universe domain.
4490
+ self._validate_universe_domain()
4491
+
4492
+ # Send the request.
4493
+ response = rpc(
4494
+ request,
4495
+ retry=retry,
4496
+ timeout=timeout,
4497
+ metadata=metadata,
4498
+ )
4499
+
4500
+ # Done; return the response.
4501
+ return response
4502
+
4503
+ def pre_check_major_version_upgrade(
4504
+ self,
4505
+ request: Optional[
4506
+ Union[cloud_sql.SqlInstancesPreCheckMajorVersionUpgradeRequest, dict]
4507
+ ] = None,
4508
+ *,
4509
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
4510
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
4511
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
4512
+ ) -> cloud_sql_resources.Operation:
4513
+ r"""Execute MVU Pre-checks
4514
+
4515
+ .. code-block:: python
4516
+
4517
+ # This snippet has been automatically generated and should be regarded as a
4518
+ # code template only.
4519
+ # It will require modifications to work:
4520
+ # - It may require correct/in-range values for request initialization.
4521
+ # - It may require specifying regional endpoints when creating the service
4522
+ # client as shown in:
4523
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
4524
+ from google.cloud import sqladmin_v1beta4
4525
+
4526
+ def sample_pre_check_major_version_upgrade():
4527
+ # Create a client
4528
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
4529
+
4530
+ # Initialize request argument(s)
4531
+ body = sqladmin_v1beta4.InstancesPreCheckMajorVersionUpgradeRequest()
4532
+ body.pre_check_major_version_upgrade_context.target_database_version = "SQLSERVER_2025_EXPRESS"
4533
+
4534
+ request = sqladmin_v1beta4.SqlInstancesPreCheckMajorVersionUpgradeRequest(
4535
+ instance="instance_value",
4536
+ project="project_value",
4537
+ body=body,
4538
+ )
4539
+
4540
+ # Make the request
4541
+ response = client.pre_check_major_version_upgrade(request=request)
4542
+
4543
+ # Handle the response
4544
+ print(response)
4545
+
4546
+ Args:
4547
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesPreCheckMajorVersionUpgradeRequest, dict]):
4548
+ The request object. Request for Pre-checks for MVU
4549
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
4550
+ should be retried.
4551
+ timeout (float): The timeout for this request.
4552
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
4553
+ sent along with the request as metadata. Normally, each value must be of type `str`,
4554
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
4555
+ be of type `bytes`.
4556
+
4557
+ Returns:
4558
+ google.cloud.sqladmin_v1beta4.types.Operation:
4559
+ An Operation resource.&nbsp;For
4560
+ successful operations that return an
4561
+ Operation resource, only the fields
4562
+ relevant to the operation are populated
4563
+ in the resource.
4564
+
4565
+ """
4566
+ # Create or coerce a protobuf request object.
4567
+ # - Use the request object if provided (there's no risk of modifying the input as
4568
+ # there are no flattened fields), or create one.
4569
+ if not isinstance(
4570
+ request, cloud_sql.SqlInstancesPreCheckMajorVersionUpgradeRequest
4571
+ ):
4572
+ request = cloud_sql.SqlInstancesPreCheckMajorVersionUpgradeRequest(request)
4573
+
4574
+ # Wrap the RPC method; this adds retry and timeout information,
4575
+ # and friendly error handling.
4576
+ rpc = self._transport._wrapped_methods[
4577
+ self._transport.pre_check_major_version_upgrade
4578
+ ]
4579
+
4580
+ # Certain fields should be provided within the metadata header;
4581
+ # add these here.
4582
+ metadata = tuple(metadata) + (
4583
+ gapic_v1.routing_header.to_grpc_metadata(
4584
+ (
4585
+ ("project", request.project),
4586
+ ("instance", request.instance),
4587
+ )
4588
+ ),
4589
+ )
4590
+
4591
+ # Validate the universe domain.
4592
+ self._validate_universe_domain()
4593
+
4594
+ # Send the request.
4595
+ response = rpc(
4596
+ request,
4597
+ retry=retry,
4598
+ timeout=timeout,
4599
+ metadata=metadata,
4600
+ )
4601
+
4602
+ # Done; return the response.
4603
+ return response
4604
+
4605
+ def point_in_time_restore(
4606
+ self,
4607
+ request: Optional[
4608
+ Union[cloud_sql.SqlInstancesPointInTimeRestoreRequest, dict]
4609
+ ] = None,
4610
+ *,
4611
+ retry: OptionalRetry = gapic_v1.method.DEFAULT,
4612
+ timeout: Union[float, object] = gapic_v1.method.DEFAULT,
4613
+ metadata: Sequence[Tuple[str, Union[str, bytes]]] = (),
4614
+ ) -> cloud_sql_resources.Operation:
4615
+ r"""Point in time restore for an instance managed by
4616
+ Google Cloud Backup and Disaster Recovery.
4617
+
4618
+ .. code-block:: python
4619
+
4620
+ # This snippet has been automatically generated and should be regarded as a
4621
+ # code template only.
4622
+ # It will require modifications to work:
4623
+ # - It may require correct/in-range values for request initialization.
4624
+ # - It may require specifying regional endpoints when creating the service
4625
+ # client as shown in:
4626
+ # https://googleapis.dev/python/google-api-core/latest/client_options.html
4627
+ from google.cloud import sqladmin_v1beta4
4628
+
4629
+ def sample_point_in_time_restore():
4630
+ # Create a client
4631
+ client = sqladmin_v1beta4.SqlInstancesServiceClient()
4632
+
4633
+ # Initialize request argument(s)
4634
+ request = sqladmin_v1beta4.SqlInstancesPointInTimeRestoreRequest(
4635
+ parent="parent_value",
4636
+ )
4637
+
4638
+ # Make the request
4639
+ response = client.point_in_time_restore(request=request)
4640
+
4641
+ # Handle the response
4642
+ print(response)
4643
+
4644
+ Args:
4645
+ request (Union[google.cloud.sqladmin_v1beta4.types.SqlInstancesPointInTimeRestoreRequest, dict]):
4646
+ The request object. Request to perform a point in time
4647
+ restore on a Google Cloud Backup and
4648
+ Disaster Recovery managed instance.
4649
+ retry (google.api_core.retry.Retry): Designation of what errors, if any,
4650
+ should be retried.
4651
+ timeout (float): The timeout for this request.
4652
+ metadata (Sequence[Tuple[str, Union[str, bytes]]]): Key/value pairs which should be
4653
+ sent along with the request as metadata. Normally, each value must be of type `str`,
4654
+ but for metadata keys ending with the suffix `-bin`, the corresponding values must
4655
+ be of type `bytes`.
4656
+
4657
+ Returns:
4658
+ google.cloud.sqladmin_v1beta4.types.Operation:
4659
+ An Operation resource.&nbsp;For
4660
+ successful operations that return an
4661
+ Operation resource, only the fields
4662
+ relevant to the operation are populated
4663
+ in the resource.
4664
+
4665
+ """
4666
+ # Create or coerce a protobuf request object.
4667
+ # - Use the request object if provided (there's no risk of modifying the input as
4668
+ # there are no flattened fields), or create one.
4669
+ if not isinstance(request, cloud_sql.SqlInstancesPointInTimeRestoreRequest):
4670
+ request = cloud_sql.SqlInstancesPointInTimeRestoreRequest(request)
4671
+
4672
+ # Wrap the RPC method; this adds retry and timeout information,
4673
+ # and friendly error handling.
4674
+ rpc = self._transport._wrapped_methods[self._transport.point_in_time_restore]
4675
+
4676
+ # Certain fields should be provided within the metadata header;
4677
+ # add these here.
4678
+ metadata = tuple(metadata) + (
4679
+ gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
4680
+ )
4681
+
4682
+ # Validate the universe domain.
4683
+ self._validate_universe_domain()
4684
+
4685
+ # Send the request.
4686
+ response = rpc(
4687
+ request,
4688
+ retry=retry,
4689
+ timeout=timeout,
4690
+ metadata=metadata,
4691
+ )
4692
+
4693
+ # Done; return the response.
4694
+ return response
4695
+
4696
+ def __enter__(self) -> "SqlInstancesServiceClient":
4697
+ return self
4698
+
4699
+ def __exit__(self, type, value, traceback):
4700
+ """Releases underlying transport's resources.
4701
+
4702
+ .. warning::
4703
+ ONLY use as a context manager if the transport is NOT shared
4704
+ with other clients! Exiting the with block will CLOSE the transport
4705
+ and may cause errors in other clients!
4706
+ """
4707
+ self.transport.close()
4708
+
4709
+
4710
+ DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo(
4711
+ gapic_version=package_version.__version__
4712
+ )
4713
+ DEFAULT_CLIENT_INFO.protobuf_runtime_version = google.protobuf.__version__
4714
+
4715
+ __all__ = ("SqlInstancesServiceClient",)