google-cloud-sql-v1 0.a → 0.1.0

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 (129) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +146 -8
  5. data/lib/google/cloud/sql/v1/cloud_sql_available_database_versions_pb.rb +25 -0
  6. data/lib/google/cloud/sql/v1/cloud_sql_available_database_versions_services_pb.rb +29 -0
  7. data/lib/google/cloud/sql/v1/cloud_sql_backup_runs_pb.rb +35 -0
  8. data/lib/google/cloud/sql/v1/cloud_sql_backup_runs_services_pb.rb +53 -0
  9. data/lib/google/cloud/sql/v1/cloud_sql_backups_pb.rb +41 -0
  10. data/lib/google/cloud/sql/v1/cloud_sql_backups_services_pb.rb +54 -0
  11. data/lib/google/cloud/sql/v1/cloud_sql_connect_pb.rb +34 -0
  12. data/lib/google/cloud/sql/v1/cloud_sql_connect_services_pb.rb +50 -0
  13. data/lib/google/cloud/sql/v1/cloud_sql_databases_pb.rb +30 -0
  14. data/lib/google/cloud/sql/v1/cloud_sql_databases_services_pb.rb +61 -0
  15. data/lib/google/cloud/sql/v1/cloud_sql_events_pb.rb +25 -0
  16. data/lib/google/cloud/sql/v1/cloud_sql_events_services_pb.rb +29 -0
  17. data/lib/google/cloud/sql/v1/cloud_sql_feature_eligibility_pb.rb +24 -0
  18. data/lib/google/cloud/sql/v1/cloud_sql_feature_eligibility_services_pb.rb +29 -0
  19. data/lib/google/cloud/sql/v1/cloud_sql_flags_pb.rb +31 -0
  20. data/lib/google/cloud/sql/v1/cloud_sql_flags_services_pb.rb +45 -0
  21. data/lib/google/cloud/sql/v1/cloud_sql_iam_policies_pb.rb +23 -0
  22. data/lib/google/cloud/sql/v1/cloud_sql_iam_policies_services_pb.rb +29 -0
  23. data/lib/google/cloud/sql/v1/cloud_sql_instance_names_pb.rb +24 -0
  24. data/lib/google/cloud/sql/v1/cloud_sql_instance_names_services_pb.rb +29 -0
  25. data/lib/google/cloud/sql/v1/cloud_sql_instances_pb.rb +146 -0
  26. data/lib/google/cloud/sql/v1/cloud_sql_instances_services_pb.rb +184 -0
  27. data/lib/google/cloud/sql/v1/cloud_sql_operations_pb.rb +30 -0
  28. data/lib/google/cloud/sql/v1/cloud_sql_operations_services_pb.rb +50 -0
  29. data/lib/google/cloud/sql/v1/cloud_sql_regions_pb.rb +25 -0
  30. data/lib/google/cloud/sql/v1/cloud_sql_regions_services_pb.rb +29 -0
  31. data/lib/google/cloud/sql/v1/cloud_sql_resources_pb.rb +119 -0
  32. data/lib/google/cloud/sql/v1/cloud_sql_ssl_certs_pb.rb +31 -0
  33. data/lib/google/cloud/sql/v1/cloud_sql_ssl_certs_services_pb.rb +56 -0
  34. data/lib/google/cloud/sql/v1/cloud_sql_tiers_pb.rb +26 -0
  35. data/lib/google/cloud/sql/v1/cloud_sql_tiers_services_pb.rb +47 -0
  36. data/lib/google/cloud/sql/v1/cloud_sql_users_pb.rb +41 -0
  37. data/lib/google/cloud/sql/v1/cloud_sql_users_services_pb.rb +53 -0
  38. data/lib/google/cloud/sql/v1/rest.rb +46 -0
  39. data/lib/google/cloud/sql/v1/sql_backup_runs_service/client.rb +809 -0
  40. data/lib/google/cloud/sql/v1/sql_backup_runs_service/credentials.rb +48 -0
  41. data/lib/google/cloud/sql/v1/sql_backup_runs_service/rest/client.rb +720 -0
  42. data/lib/google/cloud/sql/v1/sql_backup_runs_service/rest/service_stub.rb +332 -0
  43. data/lib/google/cloud/sql/v1/sql_backup_runs_service/rest.rb +51 -0
  44. data/lib/google/cloud/sql/v1/sql_backup_runs_service.rb +54 -0
  45. data/lib/google/cloud/sql/v1/sql_backups_service/client.rb +896 -0
  46. data/lib/google/cloud/sql/v1/sql_backups_service/credentials.rb +48 -0
  47. data/lib/google/cloud/sql/v1/sql_backups_service/paths.rb +64 -0
  48. data/lib/google/cloud/sql/v1/sql_backups_service/rest/client.rb +818 -0
  49. data/lib/google/cloud/sql/v1/sql_backups_service/rest/service_stub.rb +388 -0
  50. data/lib/google/cloud/sql/v1/sql_backups_service/rest.rb +50 -0
  51. data/lib/google/cloud/sql/v1/sql_backups_service.rb +53 -0
  52. data/lib/google/cloud/sql/v1/sql_connect_service/client.rb +607 -0
  53. data/lib/google/cloud/sql/v1/sql_connect_service/credentials.rb +48 -0
  54. data/lib/google/cloud/sql/v1/sql_connect_service/rest/client.rb +544 -0
  55. data/lib/google/cloud/sql/v1/sql_connect_service/rest/service_stub.rb +206 -0
  56. data/lib/google/cloud/sql/v1/sql_connect_service/rest.rb +51 -0
  57. data/lib/google/cloud/sql/v1/sql_connect_service.rb +54 -0
  58. data/lib/google/cloud/sql/v1/sql_databases_service/client.rb +1011 -0
  59. data/lib/google/cloud/sql/v1/sql_databases_service/credentials.rb +48 -0
  60. data/lib/google/cloud/sql/v1/sql_databases_service/rest/client.rb +896 -0
  61. data/lib/google/cloud/sql/v1/sql_databases_service/rest/service_stub.rb +460 -0
  62. data/lib/google/cloud/sql/v1/sql_databases_service/rest.rb +51 -0
  63. data/lib/google/cloud/sql/v1/sql_databases_service.rb +54 -0
  64. data/lib/google/cloud/sql/v1/sql_flags_service/client.rb +488 -0
  65. data/lib/google/cloud/sql/v1/sql_flags_service/credentials.rb +48 -0
  66. data/lib/google/cloud/sql/v1/sql_flags_service/rest/client.rb +446 -0
  67. data/lib/google/cloud/sql/v1/sql_flags_service/rest/service_stub.rb +140 -0
  68. data/lib/google/cloud/sql/v1/sql_flags_service/rest.rb +51 -0
  69. data/lib/google/cloud/sql/v1/sql_flags_service.rb +54 -0
  70. data/lib/google/cloud/sql/v1/sql_instances_service/client.rb +4738 -0
  71. data/lib/google/cloud/sql/v1/sql_instances_service/credentials.rb +48 -0
  72. data/lib/google/cloud/sql/v1/sql_instances_service/paths.rb +95 -0
  73. data/lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb +4274 -0
  74. data/lib/google/cloud/sql/v1/sql_instances_service/rest/service_stub.rb +2769 -0
  75. data/lib/google/cloud/sql/v1/sql_instances_service/rest.rb +50 -0
  76. data/lib/google/cloud/sql/v1/sql_instances_service.rb +53 -0
  77. data/lib/google/cloud/sql/v1/sql_operations_service/client.rb +694 -0
  78. data/lib/google/cloud/sql/v1/sql_operations_service/credentials.rb +48 -0
  79. data/lib/google/cloud/sql/v1/sql_operations_service/rest/client.rb +624 -0
  80. data/lib/google/cloud/sql/v1/sql_operations_service/rest/service_stub.rb +266 -0
  81. data/lib/google/cloud/sql/v1/sql_operations_service/rest.rb +51 -0
  82. data/lib/google/cloud/sql/v1/sql_operations_service.rb +54 -0
  83. data/lib/google/cloud/sql/v1/sql_ssl_certs_service/client.rb +804 -0
  84. data/lib/google/cloud/sql/v1/sql_ssl_certs_service/credentials.rb +48 -0
  85. data/lib/google/cloud/sql/v1/sql_ssl_certs_service/rest/client.rb +715 -0
  86. data/lib/google/cloud/sql/v1/sql_ssl_certs_service/rest/service_stub.rb +332 -0
  87. data/lib/google/cloud/sql/v1/sql_ssl_certs_service/rest.rb +51 -0
  88. data/lib/google/cloud/sql/v1/sql_ssl_certs_service.rb +54 -0
  89. data/lib/google/cloud/sql/v1/sql_tiers_service/client.rb +494 -0
  90. data/lib/google/cloud/sql/v1/sql_tiers_service/credentials.rb +48 -0
  91. data/lib/google/cloud/sql/v1/sql_tiers_service/rest/client.rb +444 -0
  92. data/lib/google/cloud/sql/v1/sql_tiers_service/rest/service_stub.rb +142 -0
  93. data/lib/google/cloud/sql/v1/sql_tiers_service/rest.rb +51 -0
  94. data/lib/google/cloud/sql/v1/sql_tiers_service.rb +54 -0
  95. data/lib/google/cloud/sql/v1/sql_users_service/client.rb +909 -0
  96. data/lib/google/cloud/sql/v1/sql_users_service/credentials.rb +48 -0
  97. data/lib/google/cloud/sql/v1/sql_users_service/rest/client.rb +813 -0
  98. data/lib/google/cloud/sql/v1/sql_users_service/rest/service_stub.rb +394 -0
  99. data/lib/google/cloud/sql/v1/sql_users_service/rest.rb +51 -0
  100. data/lib/google/cloud/sql/v1/sql_users_service.rb +54 -0
  101. data/lib/google/cloud/sql/v1/version.rb +8 -3
  102. data/lib/google/cloud/sql/v1.rb +60 -0
  103. data/lib/google-cloud-sql-v1.rb +21 -0
  104. data/proto_docs/README.md +4 -0
  105. data/proto_docs/google/api/client.rb +593 -0
  106. data/proto_docs/google/api/field_behavior.rb +85 -0
  107. data/proto_docs/google/api/field_info.rb +88 -0
  108. data/proto_docs/google/api/launch_stage.rb +71 -0
  109. data/proto_docs/google/api/resource.rb +227 -0
  110. data/proto_docs/google/cloud/sql/v1/cloud_sql_backup_runs.rb +245 -0
  111. data/proto_docs/google/cloud/sql/v1/cloud_sql_backups.rb +259 -0
  112. data/proto_docs/google/cloud/sql/v1/cloud_sql_connect.rb +190 -0
  113. data/proto_docs/google/cloud/sql/v1/cloud_sql_databases.rb +111 -0
  114. data/proto_docs/google/cloud/sql/v1/cloud_sql_flags.rb +154 -0
  115. data/proto_docs/google/cloud/sql/v1/cloud_sql_instances.rb +2357 -0
  116. data/proto_docs/google/cloud/sql/v1/cloud_sql_operations.rb +85 -0
  117. data/proto_docs/google/cloud/sql/v1/cloud_sql_resources.rb +2522 -0
  118. data/proto_docs/google/cloud/sql/v1/cloud_sql_ssl_certs.rb +120 -0
  119. data/proto_docs/google/cloud/sql/v1/cloud_sql_tiers.rb +69 -0
  120. data/proto_docs/google/cloud/sql/v1/cloud_sql_users.rb +291 -0
  121. data/proto_docs/google/protobuf/any.rb +145 -0
  122. data/proto_docs/google/protobuf/duration.rb +98 -0
  123. data/proto_docs/google/protobuf/empty.rb +34 -0
  124. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  125. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  126. data/proto_docs/google/protobuf/wrappers.rb +148 -0
  127. data/proto_docs/google/rpc/status.rb +48 -0
  128. data/proto_docs/google/type/interval.rb +45 -0
  129. metadata +176 -14
@@ -0,0 +1,4274 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/sql/v1/cloud_sql_instances_pb"
21
+ require "google/cloud/sql/v1/sql_instances_service/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Sql
27
+ module V1
28
+ module SqlInstancesService
29
+ module Rest
30
+ ##
31
+ # REST client for the SqlInstancesService service.
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "sqladmin.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :sql_instances_service_stub
44
+
45
+ ##
46
+ # Configure the SqlInstancesService Client class.
47
+ #
48
+ # See {::Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all SqlInstancesService clients
54
+ # ::Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.configure do |config|
55
+ # config.timeout = 10.0
56
+ # end
57
+ #
58
+ # @yield [config] Configure the Client client.
59
+ # @yieldparam config [Client::Configuration]
60
+ #
61
+ # @return [Client::Configuration]
62
+ #
63
+ def self.configure
64
+ @configure ||= begin
65
+ namespace = ["Google", "Cloud", "Sql", "V1"]
66
+ parent_config = while namespace.any?
67
+ parent_name = namespace.join "::"
68
+ parent_const = const_get parent_name
69
+ break parent_const.configure if parent_const.respond_to? :configure
70
+ namespace.pop
71
+ end
72
+ default_config = Client::Configuration.new parent_config
73
+
74
+ default_config.timeout = 60.0
75
+
76
+ default_config
77
+ end
78
+ yield @configure if block_given?
79
+ @configure
80
+ end
81
+
82
+ ##
83
+ # Configure the SqlInstancesService Client instance.
84
+ #
85
+ # The configuration is set to the derived mode, meaning that values can be changed,
86
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
87
+ # should be made on {Client.configure}.
88
+ #
89
+ # See {::Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client::Configuration}
90
+ # for a description of the configuration fields.
91
+ #
92
+ # @yield [config] Configure the Client client.
93
+ # @yieldparam config [Client::Configuration]
94
+ #
95
+ # @return [Client::Configuration]
96
+ #
97
+ def configure
98
+ yield @config if block_given?
99
+ @config
100
+ end
101
+
102
+ ##
103
+ # The effective universe domain
104
+ #
105
+ # @return [String]
106
+ #
107
+ def universe_domain
108
+ @sql_instances_service_stub.universe_domain
109
+ end
110
+
111
+ ##
112
+ # Create a new SqlInstancesService REST client object.
113
+ #
114
+ # @example
115
+ #
116
+ # # Create a client using the default configuration
117
+ # client = ::Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
118
+ #
119
+ # # Create a client using a custom configuration
120
+ # client = ::Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new do |config|
121
+ # config.timeout = 10.0
122
+ # end
123
+ #
124
+ # @yield [config] Configure the SqlInstancesService client.
125
+ # @yieldparam config [Client::Configuration]
126
+ #
127
+ def initialize
128
+ # Create the configuration object
129
+ @config = Configuration.new Client.configure
130
+
131
+ # Yield the configuration if needed
132
+ yield @config if block_given?
133
+
134
+ # Create credentials
135
+ credentials = @config.credentials
136
+ # Use self-signed JWT if the endpoint is unchanged from default,
137
+ # but only if the default endpoint does not have a region prefix.
138
+ enable_self_signed_jwt = @config.endpoint.nil? ||
139
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
140
+ !@config.endpoint.split(".").first.include?("-"))
141
+ credentials ||= Credentials.default scope: @config.scope,
142
+ enable_self_signed_jwt: enable_self_signed_jwt
143
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
144
+ credentials = Credentials.new credentials, scope: @config.scope
145
+ end
146
+
147
+ @quota_project_id = @config.quota_project
148
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
149
+
150
+ @sql_instances_service_stub = ::Google::Cloud::Sql::V1::SqlInstancesService::Rest::ServiceStub.new(
151
+ endpoint: @config.endpoint,
152
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
153
+ universe_domain: @config.universe_domain,
154
+ credentials: credentials,
155
+ logger: @config.logger
156
+ )
157
+
158
+ @sql_instances_service_stub.logger(stub: true)&.info do |entry|
159
+ entry.set_system_name
160
+ entry.set_service
161
+ entry.message = "Created client for #{entry.service}"
162
+ entry.set_credentials_fields credentials
163
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
164
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
165
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
166
+ end
167
+
168
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
169
+ config.credentials = credentials
170
+ config.quota_project = @quota_project_id
171
+ config.endpoint = @sql_instances_service_stub.endpoint
172
+ config.universe_domain = @sql_instances_service_stub.universe_domain
173
+ config.logger = @sql_instances_service_stub.logger if config.respond_to? :logger=
174
+ end
175
+ end
176
+
177
+ ##
178
+ # Get the associated client for mix-in of the Locations.
179
+ #
180
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
181
+ #
182
+ attr_reader :location_client
183
+
184
+ ##
185
+ # The logger used for request/response debug logging.
186
+ #
187
+ # @return [Logger]
188
+ #
189
+ def logger
190
+ @sql_instances_service_stub.logger
191
+ end
192
+
193
+ # Service calls
194
+
195
+ ##
196
+ # Adds a new trusted Certificate Authority (CA) version for the specified
197
+ # instance. Required to prepare for a certificate rotation. If a CA version
198
+ # was previously added but never used in a certificate rotation, this
199
+ # operation replaces that version. There cannot be more than one CA version
200
+ # waiting to be rotated in. For instances that have enabled Certificate
201
+ # Authority Service (CAS) based server CA, use AddServerCertificate to add a
202
+ # new server certificate.
203
+ #
204
+ # @overload add_server_ca(request, options = nil)
205
+ # Pass arguments to `add_server_ca` via a request object, either of type
206
+ # {::Google::Cloud::Sql::V1::SqlInstancesAddServerCaRequest} or an equivalent Hash.
207
+ #
208
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesAddServerCaRequest, ::Hash]
209
+ # A request object representing the call parameters. Required. To specify no
210
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
211
+ # @param options [::Gapic::CallOptions, ::Hash]
212
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
213
+ #
214
+ # @overload add_server_ca(instance: nil, project: nil)
215
+ # Pass arguments to `add_server_ca` via keyword arguments. Note that at
216
+ # least one keyword argument is required. To specify no parameters, or to keep all
217
+ # the default parameter values, pass an empty Hash as a request object (see above).
218
+ #
219
+ # @param instance [::String]
220
+ # Cloud SQL instance ID. This does not include the project ID.
221
+ # @param project [::String]
222
+ # Project ID of the project that contains the instance.
223
+ # @yield [result, operation] Access the result along with the TransportOperation object
224
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
225
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
226
+ #
227
+ # @return [::Google::Cloud::Sql::V1::Operation]
228
+ #
229
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
230
+ #
231
+ # @example Basic example
232
+ # require "google/cloud/sql/v1"
233
+ #
234
+ # # Create a client object. The client can be reused for multiple calls.
235
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
236
+ #
237
+ # # Create a request. To set request fields, pass in keyword arguments.
238
+ # request = Google::Cloud::Sql::V1::SqlInstancesAddServerCaRequest.new
239
+ #
240
+ # # Call the add_server_ca method.
241
+ # result = client.add_server_ca request
242
+ #
243
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
244
+ # p result
245
+ #
246
+ def add_server_ca request, options = nil
247
+ raise ::ArgumentError, "request must be provided" if request.nil?
248
+
249
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesAddServerCaRequest
250
+
251
+ # Converts hash and nil to an options object
252
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
253
+
254
+ # Customize the options with defaults
255
+ call_metadata = @config.rpcs.add_server_ca.metadata.to_h
256
+
257
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
258
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
259
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
260
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
261
+ transports_version_send: [:rest]
262
+
263
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
264
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
265
+
266
+ options.apply_defaults timeout: @config.rpcs.add_server_ca.timeout,
267
+ metadata: call_metadata,
268
+ retry_policy: @config.rpcs.add_server_ca.retry_policy
269
+
270
+ options.apply_defaults timeout: @config.timeout,
271
+ metadata: @config.metadata,
272
+ retry_policy: @config.retry_policy
273
+
274
+ @sql_instances_service_stub.add_server_ca request, options do |result, operation|
275
+ yield result, operation if block_given?
276
+ end
277
+ rescue ::Gapic::Rest::Error => e
278
+ raise ::Google::Cloud::Error.from_error(e)
279
+ end
280
+
281
+ ##
282
+ # Add a new trusted server certificate version for the specified instance
283
+ # using Certificate Authority Service (CAS) server CA. Required to prepare
284
+ # for a certificate rotation. If a server certificate version was previously
285
+ # added but never used in a certificate rotation, this operation replaces
286
+ # that version. There cannot be more than one certificate version waiting to
287
+ # be rotated in. For instances not using CAS server CA, use AddServerCa
288
+ # instead.
289
+ #
290
+ # @overload add_server_certificate(request, options = nil)
291
+ # Pass arguments to `add_server_certificate` via a request object, either of type
292
+ # {::Google::Cloud::Sql::V1::SqlInstancesAddServerCertificateRequest} or an equivalent Hash.
293
+ #
294
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesAddServerCertificateRequest, ::Hash]
295
+ # A request object representing the call parameters. Required. To specify no
296
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
297
+ # @param options [::Gapic::CallOptions, ::Hash]
298
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
299
+ #
300
+ # @overload add_server_certificate(instance: nil, project: nil)
301
+ # Pass arguments to `add_server_certificate` via keyword arguments. Note that at
302
+ # least one keyword argument is required. To specify no parameters, or to keep all
303
+ # the default parameter values, pass an empty Hash as a request object (see above).
304
+ #
305
+ # @param instance [::String]
306
+ # Cloud SQL instance ID. This does not include the project ID.
307
+ # @param project [::String]
308
+ # Project ID of the project that contains the instance.
309
+ # @yield [result, operation] Access the result along with the TransportOperation object
310
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
311
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
312
+ #
313
+ # @return [::Google::Cloud::Sql::V1::Operation]
314
+ #
315
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
316
+ #
317
+ # @example Basic example
318
+ # require "google/cloud/sql/v1"
319
+ #
320
+ # # Create a client object. The client can be reused for multiple calls.
321
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
322
+ #
323
+ # # Create a request. To set request fields, pass in keyword arguments.
324
+ # request = Google::Cloud::Sql::V1::SqlInstancesAddServerCertificateRequest.new
325
+ #
326
+ # # Call the add_server_certificate method.
327
+ # result = client.add_server_certificate request
328
+ #
329
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
330
+ # p result
331
+ #
332
+ def add_server_certificate request, options = nil
333
+ raise ::ArgumentError, "request must be provided" if request.nil?
334
+
335
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesAddServerCertificateRequest
336
+
337
+ # Converts hash and nil to an options object
338
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
339
+
340
+ # Customize the options with defaults
341
+ call_metadata = @config.rpcs.add_server_certificate.metadata.to_h
342
+
343
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
344
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
345
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
346
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
347
+ transports_version_send: [:rest]
348
+
349
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
350
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
351
+
352
+ options.apply_defaults timeout: @config.rpcs.add_server_certificate.timeout,
353
+ metadata: call_metadata,
354
+ retry_policy: @config.rpcs.add_server_certificate.retry_policy
355
+
356
+ options.apply_defaults timeout: @config.timeout,
357
+ metadata: @config.metadata,
358
+ retry_policy: @config.retry_policy
359
+
360
+ @sql_instances_service_stub.add_server_certificate request, options do |result, operation|
361
+ yield result, operation if block_given?
362
+ end
363
+ rescue ::Gapic::Rest::Error => e
364
+ raise ::Google::Cloud::Error.from_error(e)
365
+ end
366
+
367
+ ##
368
+ # Adds a new Entra ID certificate for the specified instance. If an Entra ID
369
+ # certificate was previously added but never used in a certificate rotation,
370
+ # this operation replaces that version.
371
+ #
372
+ # @overload add_entra_id_certificate(request, options = nil)
373
+ # Pass arguments to `add_entra_id_certificate` via a request object, either of type
374
+ # {::Google::Cloud::Sql::V1::SqlInstancesAddEntraIdCertificateRequest} or an equivalent Hash.
375
+ #
376
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesAddEntraIdCertificateRequest, ::Hash]
377
+ # A request object representing the call parameters. Required. To specify no
378
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
379
+ # @param options [::Gapic::CallOptions, ::Hash]
380
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
381
+ #
382
+ # @overload add_entra_id_certificate(instance: nil, project: nil)
383
+ # Pass arguments to `add_entra_id_certificate` via keyword arguments. Note that at
384
+ # least one keyword argument is required. To specify no parameters, or to keep all
385
+ # the default parameter values, pass an empty Hash as a request object (see above).
386
+ #
387
+ # @param instance [::String]
388
+ # Required. Cloud SQL instance ID. This does not include the project ID.
389
+ # @param project [::String]
390
+ # Required. Project ID of the project that contains the instance.
391
+ # @yield [result, operation] Access the result along with the TransportOperation object
392
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
393
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
394
+ #
395
+ # @return [::Google::Cloud::Sql::V1::Operation]
396
+ #
397
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
398
+ #
399
+ # @example Basic example
400
+ # require "google/cloud/sql/v1"
401
+ #
402
+ # # Create a client object. The client can be reused for multiple calls.
403
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
404
+ #
405
+ # # Create a request. To set request fields, pass in keyword arguments.
406
+ # request = Google::Cloud::Sql::V1::SqlInstancesAddEntraIdCertificateRequest.new
407
+ #
408
+ # # Call the add_entra_id_certificate method.
409
+ # result = client.add_entra_id_certificate request
410
+ #
411
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
412
+ # p result
413
+ #
414
+ def add_entra_id_certificate request, options = nil
415
+ raise ::ArgumentError, "request must be provided" if request.nil?
416
+
417
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesAddEntraIdCertificateRequest
418
+
419
+ # Converts hash and nil to an options object
420
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
421
+
422
+ # Customize the options with defaults
423
+ call_metadata = @config.rpcs.add_entra_id_certificate.metadata.to_h
424
+
425
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
426
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
427
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
428
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
429
+ transports_version_send: [:rest]
430
+
431
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
432
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
433
+
434
+ options.apply_defaults timeout: @config.rpcs.add_entra_id_certificate.timeout,
435
+ metadata: call_metadata,
436
+ retry_policy: @config.rpcs.add_entra_id_certificate.retry_policy
437
+
438
+ options.apply_defaults timeout: @config.timeout,
439
+ metadata: @config.metadata,
440
+ retry_policy: @config.retry_policy
441
+
442
+ @sql_instances_service_stub.add_entra_id_certificate request, options do |result, operation|
443
+ yield result, operation if block_given?
444
+ end
445
+ rescue ::Gapic::Rest::Error => e
446
+ raise ::Google::Cloud::Error.from_error(e)
447
+ end
448
+
449
+ ##
450
+ # Creates a Cloud SQL instance as a clone of the source instance. Using this
451
+ # operation might cause your instance to restart.
452
+ #
453
+ # @overload call_clone(request, options = nil)
454
+ # Pass arguments to `call_clone` via a request object, either of type
455
+ # {::Google::Cloud::Sql::V1::SqlInstancesCloneRequest} or an equivalent Hash.
456
+ #
457
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesCloneRequest, ::Hash]
458
+ # A request object representing the call parameters. Required. To specify no
459
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
460
+ # @param options [::Gapic::CallOptions, ::Hash]
461
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
462
+ #
463
+ # @overload call_clone(instance: nil, project: nil, body: nil)
464
+ # Pass arguments to `call_clone` via keyword arguments. Note that at
465
+ # least one keyword argument is required. To specify no parameters, or to keep all
466
+ # the default parameter values, pass an empty Hash as a request object (see above).
467
+ #
468
+ # @param instance [::String]
469
+ # Required. The ID of the Cloud SQL instance to be cloned (source). This does
470
+ # not include the project ID.
471
+ # @param project [::String]
472
+ # Required. Project ID of the source Cloud SQL instance.
473
+ # @param body [::Google::Cloud::Sql::V1::InstancesCloneRequest, ::Hash]
474
+ # @yield [result, operation] Access the result along with the TransportOperation object
475
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
476
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
477
+ #
478
+ # @return [::Google::Cloud::Sql::V1::Operation]
479
+ #
480
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
481
+ #
482
+ # @example Basic example
483
+ # require "google/cloud/sql/v1"
484
+ #
485
+ # # Create a client object. The client can be reused for multiple calls.
486
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
487
+ #
488
+ # # Create a request. To set request fields, pass in keyword arguments.
489
+ # request = Google::Cloud::Sql::V1::SqlInstancesCloneRequest.new
490
+ #
491
+ # # Call the call_clone method.
492
+ # result = client.call_clone request
493
+ #
494
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
495
+ # p result
496
+ #
497
+ def call_clone request, options = nil
498
+ raise ::ArgumentError, "request must be provided" if request.nil?
499
+
500
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesCloneRequest
501
+
502
+ # Converts hash and nil to an options object
503
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
504
+
505
+ # Customize the options with defaults
506
+ call_metadata = @config.rpcs.call_clone.metadata.to_h
507
+
508
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
509
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
510
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
511
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
512
+ transports_version_send: [:rest]
513
+
514
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
515
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
516
+
517
+ options.apply_defaults timeout: @config.rpcs.call_clone.timeout,
518
+ metadata: call_metadata,
519
+ retry_policy: @config.rpcs.call_clone.retry_policy
520
+
521
+ options.apply_defaults timeout: @config.timeout,
522
+ metadata: @config.metadata,
523
+ retry_policy: @config.retry_policy
524
+
525
+ @sql_instances_service_stub.call_clone request, options do |result, operation|
526
+ yield result, operation if block_given?
527
+ end
528
+ rescue ::Gapic::Rest::Error => e
529
+ raise ::Google::Cloud::Error.from_error(e)
530
+ end
531
+
532
+ ##
533
+ # Deletes a Cloud SQL instance.
534
+ #
535
+ # @overload delete(request, options = nil)
536
+ # Pass arguments to `delete` via a request object, either of type
537
+ # {::Google::Cloud::Sql::V1::SqlInstancesDeleteRequest} or an equivalent Hash.
538
+ #
539
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesDeleteRequest, ::Hash]
540
+ # A request object representing the call parameters. Required. To specify no
541
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
542
+ # @param options [::Gapic::CallOptions, ::Hash]
543
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
544
+ #
545
+ # @overload delete(instance: nil, project: nil, enable_final_backup: nil, final_backup_ttl_days: nil, final_backup_expiry_time: nil, final_backup_description: nil)
546
+ # Pass arguments to `delete` via keyword arguments. Note that at
547
+ # least one keyword argument is required. To specify no parameters, or to keep all
548
+ # the default parameter values, pass an empty Hash as a request object (see above).
549
+ #
550
+ # @param instance [::String]
551
+ # Cloud SQL instance ID. This does not include the project ID.
552
+ # @param project [::String]
553
+ # Project ID of the project that contains the instance to be deleted.
554
+ # @param enable_final_backup [::Boolean]
555
+ # Flag to opt-in for final backup. By default, it is turned off.
556
+ # @param final_backup_ttl_days [::Integer]
557
+ # Optional. Retention period of the final backup.
558
+ #
559
+ # Note: The following parameters are mutually exclusive: `final_backup_ttl_days`, `final_backup_expiry_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
560
+ # @param final_backup_expiry_time [::Google::Protobuf::Timestamp, ::Hash]
561
+ # Optional. Final Backup expiration time.
562
+ # Timestamp in UTC of when this resource is considered expired.
563
+ #
564
+ # Note: The following parameters are mutually exclusive: `final_backup_expiry_time`, `final_backup_ttl_days`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
565
+ # @param final_backup_description [::String]
566
+ # Optional. The description of the final backup.
567
+ # @yield [result, operation] Access the result along with the TransportOperation object
568
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
569
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
570
+ #
571
+ # @return [::Google::Cloud::Sql::V1::Operation]
572
+ #
573
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
574
+ #
575
+ # @example Basic example
576
+ # require "google/cloud/sql/v1"
577
+ #
578
+ # # Create a client object. The client can be reused for multiple calls.
579
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
580
+ #
581
+ # # Create a request. To set request fields, pass in keyword arguments.
582
+ # request = Google::Cloud::Sql::V1::SqlInstancesDeleteRequest.new
583
+ #
584
+ # # Call the delete method.
585
+ # result = client.delete request
586
+ #
587
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
588
+ # p result
589
+ #
590
+ def delete request, options = nil
591
+ raise ::ArgumentError, "request must be provided" if request.nil?
592
+
593
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesDeleteRequest
594
+
595
+ # Converts hash and nil to an options object
596
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
597
+
598
+ # Customize the options with defaults
599
+ call_metadata = @config.rpcs.delete.metadata.to_h
600
+
601
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
602
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
603
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
604
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
605
+ transports_version_send: [:rest]
606
+
607
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
608
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
609
+
610
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
611
+ metadata: call_metadata,
612
+ retry_policy: @config.rpcs.delete.retry_policy
613
+
614
+ options.apply_defaults timeout: @config.timeout,
615
+ metadata: @config.metadata,
616
+ retry_policy: @config.retry_policy
617
+
618
+ @sql_instances_service_stub.delete request, options do |result, operation|
619
+ yield result, operation if block_given?
620
+ end
621
+ rescue ::Gapic::Rest::Error => e
622
+ raise ::Google::Cloud::Error.from_error(e)
623
+ end
624
+
625
+ ##
626
+ # Demotes the stand-alone instance to be a Cloud SQL read replica for an
627
+ # external database server.
628
+ #
629
+ # @overload demote_master(request, options = nil)
630
+ # Pass arguments to `demote_master` via a request object, either of type
631
+ # {::Google::Cloud::Sql::V1::SqlInstancesDemoteMasterRequest} or an equivalent Hash.
632
+ #
633
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesDemoteMasterRequest, ::Hash]
634
+ # A request object representing the call parameters. Required. To specify no
635
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
636
+ # @param options [::Gapic::CallOptions, ::Hash]
637
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
638
+ #
639
+ # @overload demote_master(instance: nil, project: nil, body: nil)
640
+ # Pass arguments to `demote_master` via keyword arguments. Note that at
641
+ # least one keyword argument is required. To specify no parameters, or to keep all
642
+ # the default parameter values, pass an empty Hash as a request object (see above).
643
+ #
644
+ # @param instance [::String]
645
+ # Cloud SQL instance name.
646
+ # @param project [::String]
647
+ # ID of the project that contains the instance.
648
+ # @param body [::Google::Cloud::Sql::V1::InstancesDemoteMasterRequest, ::Hash]
649
+ # @yield [result, operation] Access the result along with the TransportOperation object
650
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
651
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
652
+ #
653
+ # @return [::Google::Cloud::Sql::V1::Operation]
654
+ #
655
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
656
+ #
657
+ # @example Basic example
658
+ # require "google/cloud/sql/v1"
659
+ #
660
+ # # Create a client object. The client can be reused for multiple calls.
661
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
662
+ #
663
+ # # Create a request. To set request fields, pass in keyword arguments.
664
+ # request = Google::Cloud::Sql::V1::SqlInstancesDemoteMasterRequest.new
665
+ #
666
+ # # Call the demote_master method.
667
+ # result = client.demote_master request
668
+ #
669
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
670
+ # p result
671
+ #
672
+ def demote_master request, options = nil
673
+ raise ::ArgumentError, "request must be provided" if request.nil?
674
+
675
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesDemoteMasterRequest
676
+
677
+ # Converts hash and nil to an options object
678
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
679
+
680
+ # Customize the options with defaults
681
+ call_metadata = @config.rpcs.demote_master.metadata.to_h
682
+
683
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
684
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
685
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
686
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
687
+ transports_version_send: [:rest]
688
+
689
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
690
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
691
+
692
+ options.apply_defaults timeout: @config.rpcs.demote_master.timeout,
693
+ metadata: call_metadata,
694
+ retry_policy: @config.rpcs.demote_master.retry_policy
695
+
696
+ options.apply_defaults timeout: @config.timeout,
697
+ metadata: @config.metadata,
698
+ retry_policy: @config.retry_policy
699
+
700
+ @sql_instances_service_stub.demote_master request, options do |result, operation|
701
+ yield result, operation if block_given?
702
+ end
703
+ rescue ::Gapic::Rest::Error => e
704
+ raise ::Google::Cloud::Error.from_error(e)
705
+ end
706
+
707
+ ##
708
+ # Demotes an existing standalone instance to be a Cloud SQL read replica
709
+ # for an external database server.
710
+ #
711
+ # @overload demote(request, options = nil)
712
+ # Pass arguments to `demote` via a request object, either of type
713
+ # {::Google::Cloud::Sql::V1::SqlInstancesDemoteRequest} or an equivalent Hash.
714
+ #
715
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesDemoteRequest, ::Hash]
716
+ # A request object representing the call parameters. Required. To specify no
717
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
718
+ # @param options [::Gapic::CallOptions, ::Hash]
719
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
720
+ #
721
+ # @overload demote(instance: nil, project: nil, body: nil)
722
+ # Pass arguments to `demote` via keyword arguments. Note that at
723
+ # least one keyword argument is required. To specify no parameters, or to keep all
724
+ # the default parameter values, pass an empty Hash as a request object (see above).
725
+ #
726
+ # @param instance [::String]
727
+ # Required. Cloud SQL instance name.
728
+ # @param project [::String]
729
+ # Required. ID of the project that contains the instance.
730
+ # @param body [::Google::Cloud::Sql::V1::InstancesDemoteRequest, ::Hash]
731
+ # Required. The request body.
732
+ # @yield [result, operation] Access the result along with the TransportOperation object
733
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
734
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
735
+ #
736
+ # @return [::Google::Cloud::Sql::V1::Operation]
737
+ #
738
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
739
+ #
740
+ # @example Basic example
741
+ # require "google/cloud/sql/v1"
742
+ #
743
+ # # Create a client object. The client can be reused for multiple calls.
744
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
745
+ #
746
+ # # Create a request. To set request fields, pass in keyword arguments.
747
+ # request = Google::Cloud::Sql::V1::SqlInstancesDemoteRequest.new
748
+ #
749
+ # # Call the demote method.
750
+ # result = client.demote request
751
+ #
752
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
753
+ # p result
754
+ #
755
+ def demote request, options = nil
756
+ raise ::ArgumentError, "request must be provided" if request.nil?
757
+
758
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesDemoteRequest
759
+
760
+ # Converts hash and nil to an options object
761
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
762
+
763
+ # Customize the options with defaults
764
+ call_metadata = @config.rpcs.demote.metadata.to_h
765
+
766
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
767
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
768
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
769
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
770
+ transports_version_send: [:rest]
771
+
772
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
773
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
774
+
775
+ options.apply_defaults timeout: @config.rpcs.demote.timeout,
776
+ metadata: call_metadata,
777
+ retry_policy: @config.rpcs.demote.retry_policy
778
+
779
+ options.apply_defaults timeout: @config.timeout,
780
+ metadata: @config.metadata,
781
+ retry_policy: @config.retry_policy
782
+
783
+ @sql_instances_service_stub.demote request, options do |result, operation|
784
+ yield result, operation if block_given?
785
+ end
786
+ rescue ::Gapic::Rest::Error => e
787
+ raise ::Google::Cloud::Error.from_error(e)
788
+ end
789
+
790
+ ##
791
+ # Exports data from a Cloud SQL instance to a Cloud Storage bucket as a SQL
792
+ # dump or CSV file.
793
+ #
794
+ # @overload export(request, options = nil)
795
+ # Pass arguments to `export` via a request object, either of type
796
+ # {::Google::Cloud::Sql::V1::SqlInstancesExportRequest} or an equivalent Hash.
797
+ #
798
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesExportRequest, ::Hash]
799
+ # A request object representing the call parameters. Required. To specify no
800
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
801
+ # @param options [::Gapic::CallOptions, ::Hash]
802
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
803
+ #
804
+ # @overload export(instance: nil, project: nil, body: nil)
805
+ # Pass arguments to `export` via keyword arguments. Note that at
806
+ # least one keyword argument is required. To specify no parameters, or to keep all
807
+ # the default parameter values, pass an empty Hash as a request object (see above).
808
+ #
809
+ # @param instance [::String]
810
+ # Cloud SQL instance ID. This does not include the project ID.
811
+ # @param project [::String]
812
+ # Project ID of the project that contains the instance to be exported.
813
+ # @param body [::Google::Cloud::Sql::V1::InstancesExportRequest, ::Hash]
814
+ # @yield [result, operation] Access the result along with the TransportOperation object
815
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
816
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
817
+ #
818
+ # @return [::Google::Cloud::Sql::V1::Operation]
819
+ #
820
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
821
+ #
822
+ # @example Basic example
823
+ # require "google/cloud/sql/v1"
824
+ #
825
+ # # Create a client object. The client can be reused for multiple calls.
826
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
827
+ #
828
+ # # Create a request. To set request fields, pass in keyword arguments.
829
+ # request = Google::Cloud::Sql::V1::SqlInstancesExportRequest.new
830
+ #
831
+ # # Call the export method.
832
+ # result = client.export request
833
+ #
834
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
835
+ # p result
836
+ #
837
+ def export request, options = nil
838
+ raise ::ArgumentError, "request must be provided" if request.nil?
839
+
840
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesExportRequest
841
+
842
+ # Converts hash and nil to an options object
843
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
844
+
845
+ # Customize the options with defaults
846
+ call_metadata = @config.rpcs.export.metadata.to_h
847
+
848
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
849
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
850
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
851
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
852
+ transports_version_send: [:rest]
853
+
854
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
855
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
856
+
857
+ options.apply_defaults timeout: @config.rpcs.export.timeout,
858
+ metadata: call_metadata,
859
+ retry_policy: @config.rpcs.export.retry_policy
860
+
861
+ options.apply_defaults timeout: @config.timeout,
862
+ metadata: @config.metadata,
863
+ retry_policy: @config.retry_policy
864
+
865
+ @sql_instances_service_stub.export request, options do |result, operation|
866
+ yield result, operation if block_given?
867
+ end
868
+ rescue ::Gapic::Rest::Error => e
869
+ raise ::Google::Cloud::Error.from_error(e)
870
+ end
871
+
872
+ ##
873
+ # Initiates a manual failover of a high availability (HA) primary instance
874
+ # to a standby instance, which becomes the primary instance. Users are
875
+ # then rerouted to the new primary. For more information, see the
876
+ # [Overview of high
877
+ # availability](https://cloud.google.com/sql/docs/mysql/high-availability)
878
+ # page in the Cloud SQL documentation.
879
+ # If using Legacy HA (MySQL only), this causes the instance to failover to
880
+ # its failover replica instance.
881
+ #
882
+ # @overload failover(request, options = nil)
883
+ # Pass arguments to `failover` via a request object, either of type
884
+ # {::Google::Cloud::Sql::V1::SqlInstancesFailoverRequest} or an equivalent Hash.
885
+ #
886
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesFailoverRequest, ::Hash]
887
+ # A request object representing the call parameters. Required. To specify no
888
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
889
+ # @param options [::Gapic::CallOptions, ::Hash]
890
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
891
+ #
892
+ # @overload failover(instance: nil, project: nil, body: nil)
893
+ # Pass arguments to `failover` via keyword arguments. Note that at
894
+ # least one keyword argument is required. To specify no parameters, or to keep all
895
+ # the default parameter values, pass an empty Hash as a request object (see above).
896
+ #
897
+ # @param instance [::String]
898
+ # Cloud SQL instance ID. This does not include the project ID.
899
+ # @param project [::String]
900
+ # ID of the project that contains the read replica.
901
+ # @param body [::Google::Cloud::Sql::V1::InstancesFailoverRequest, ::Hash]
902
+ # @yield [result, operation] Access the result along with the TransportOperation object
903
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
904
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
905
+ #
906
+ # @return [::Google::Cloud::Sql::V1::Operation]
907
+ #
908
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
909
+ #
910
+ # @example Basic example
911
+ # require "google/cloud/sql/v1"
912
+ #
913
+ # # Create a client object. The client can be reused for multiple calls.
914
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
915
+ #
916
+ # # Create a request. To set request fields, pass in keyword arguments.
917
+ # request = Google::Cloud::Sql::V1::SqlInstancesFailoverRequest.new
918
+ #
919
+ # # Call the failover method.
920
+ # result = client.failover request
921
+ #
922
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
923
+ # p result
924
+ #
925
+ def failover request, options = nil
926
+ raise ::ArgumentError, "request must be provided" if request.nil?
927
+
928
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesFailoverRequest
929
+
930
+ # Converts hash and nil to an options object
931
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
932
+
933
+ # Customize the options with defaults
934
+ call_metadata = @config.rpcs.failover.metadata.to_h
935
+
936
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
937
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
938
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
939
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
940
+ transports_version_send: [:rest]
941
+
942
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
943
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
944
+
945
+ options.apply_defaults timeout: @config.rpcs.failover.timeout,
946
+ metadata: call_metadata,
947
+ retry_policy: @config.rpcs.failover.retry_policy
948
+
949
+ options.apply_defaults timeout: @config.timeout,
950
+ metadata: @config.metadata,
951
+ retry_policy: @config.retry_policy
952
+
953
+ @sql_instances_service_stub.failover request, options do |result, operation|
954
+ yield result, operation if block_given?
955
+ end
956
+ rescue ::Gapic::Rest::Error => e
957
+ raise ::Google::Cloud::Error.from_error(e)
958
+ end
959
+
960
+ ##
961
+ # Reencrypt CMEK instance with latest key version.
962
+ #
963
+ # @overload reencrypt(request, options = nil)
964
+ # Pass arguments to `reencrypt` via a request object, either of type
965
+ # {::Google::Cloud::Sql::V1::SqlInstancesReencryptRequest} or an equivalent Hash.
966
+ #
967
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesReencryptRequest, ::Hash]
968
+ # A request object representing the call parameters. Required. To specify no
969
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
970
+ # @param options [::Gapic::CallOptions, ::Hash]
971
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
972
+ #
973
+ # @overload reencrypt(instance: nil, project: nil, body: nil)
974
+ # Pass arguments to `reencrypt` via keyword arguments. Note that at
975
+ # least one keyword argument is required. To specify no parameters, or to keep all
976
+ # the default parameter values, pass an empty Hash as a request object (see above).
977
+ #
978
+ # @param instance [::String]
979
+ # Cloud SQL instance ID. This does not include the project ID.
980
+ # @param project [::String]
981
+ # ID of the project that contains the instance.
982
+ # @param body [::Google::Cloud::Sql::V1::InstancesReencryptRequest, ::Hash]
983
+ # Reencrypt body that users request
984
+ # @yield [result, operation] Access the result along with the TransportOperation object
985
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
986
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
987
+ #
988
+ # @return [::Google::Cloud::Sql::V1::Operation]
989
+ #
990
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
991
+ #
992
+ # @example Basic example
993
+ # require "google/cloud/sql/v1"
994
+ #
995
+ # # Create a client object. The client can be reused for multiple calls.
996
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
997
+ #
998
+ # # Create a request. To set request fields, pass in keyword arguments.
999
+ # request = Google::Cloud::Sql::V1::SqlInstancesReencryptRequest.new
1000
+ #
1001
+ # # Call the reencrypt method.
1002
+ # result = client.reencrypt request
1003
+ #
1004
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
1005
+ # p result
1006
+ #
1007
+ def reencrypt request, options = nil
1008
+ raise ::ArgumentError, "request must be provided" if request.nil?
1009
+
1010
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesReencryptRequest
1011
+
1012
+ # Converts hash and nil to an options object
1013
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1014
+
1015
+ # Customize the options with defaults
1016
+ call_metadata = @config.rpcs.reencrypt.metadata.to_h
1017
+
1018
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1019
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1020
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1021
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
1022
+ transports_version_send: [:rest]
1023
+
1024
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1025
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1026
+
1027
+ options.apply_defaults timeout: @config.rpcs.reencrypt.timeout,
1028
+ metadata: call_metadata,
1029
+ retry_policy: @config.rpcs.reencrypt.retry_policy
1030
+
1031
+ options.apply_defaults timeout: @config.timeout,
1032
+ metadata: @config.metadata,
1033
+ retry_policy: @config.retry_policy
1034
+
1035
+ @sql_instances_service_stub.reencrypt request, options do |result, operation|
1036
+ yield result, operation if block_given?
1037
+ end
1038
+ rescue ::Gapic::Rest::Error => e
1039
+ raise ::Google::Cloud::Error.from_error(e)
1040
+ end
1041
+
1042
+ ##
1043
+ # Retrieves a resource containing information about a Cloud SQL instance.
1044
+ #
1045
+ # @overload get(request, options = nil)
1046
+ # Pass arguments to `get` via a request object, either of type
1047
+ # {::Google::Cloud::Sql::V1::SqlInstancesGetRequest} or an equivalent Hash.
1048
+ #
1049
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesGetRequest, ::Hash]
1050
+ # A request object representing the call parameters. Required. To specify no
1051
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1052
+ # @param options [::Gapic::CallOptions, ::Hash]
1053
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1054
+ #
1055
+ # @overload get(instance: nil, project: nil)
1056
+ # Pass arguments to `get` via keyword arguments. Note that at
1057
+ # least one keyword argument is required. To specify no parameters, or to keep all
1058
+ # the default parameter values, pass an empty Hash as a request object (see above).
1059
+ #
1060
+ # @param instance [::String]
1061
+ # Required. Database instance ID. This does not include the project ID.
1062
+ # @param project [::String]
1063
+ # Required. Project ID of the project that contains the instance.
1064
+ # @yield [result, operation] Access the result along with the TransportOperation object
1065
+ # @yieldparam result [::Google::Cloud::Sql::V1::DatabaseInstance]
1066
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1067
+ #
1068
+ # @return [::Google::Cloud::Sql::V1::DatabaseInstance]
1069
+ #
1070
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1071
+ #
1072
+ # @example Basic example
1073
+ # require "google/cloud/sql/v1"
1074
+ #
1075
+ # # Create a client object. The client can be reused for multiple calls.
1076
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
1077
+ #
1078
+ # # Create a request. To set request fields, pass in keyword arguments.
1079
+ # request = Google::Cloud::Sql::V1::SqlInstancesGetRequest.new
1080
+ #
1081
+ # # Call the get method.
1082
+ # result = client.get request
1083
+ #
1084
+ # # The returned object is of type Google::Cloud::Sql::V1::DatabaseInstance.
1085
+ # p result
1086
+ #
1087
+ def get request, options = nil
1088
+ raise ::ArgumentError, "request must be provided" if request.nil?
1089
+
1090
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesGetRequest
1091
+
1092
+ # Converts hash and nil to an options object
1093
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1094
+
1095
+ # Customize the options with defaults
1096
+ call_metadata = @config.rpcs.get.metadata.to_h
1097
+
1098
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1099
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1100
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1101
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
1102
+ transports_version_send: [:rest]
1103
+
1104
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1105
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1106
+
1107
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
1108
+ metadata: call_metadata,
1109
+ retry_policy: @config.rpcs.get.retry_policy
1110
+
1111
+ options.apply_defaults timeout: @config.timeout,
1112
+ metadata: @config.metadata,
1113
+ retry_policy: @config.retry_policy
1114
+
1115
+ @sql_instances_service_stub.get request, options do |result, operation|
1116
+ yield result, operation if block_given?
1117
+ end
1118
+ rescue ::Gapic::Rest::Error => e
1119
+ raise ::Google::Cloud::Error.from_error(e)
1120
+ end
1121
+
1122
+ ##
1123
+ # Imports data into a Cloud SQL instance from a SQL dump or CSV file in
1124
+ # Cloud Storage.
1125
+ #
1126
+ # @overload import(request, options = nil)
1127
+ # Pass arguments to `import` via a request object, either of type
1128
+ # {::Google::Cloud::Sql::V1::SqlInstancesImportRequest} or an equivalent Hash.
1129
+ #
1130
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesImportRequest, ::Hash]
1131
+ # A request object representing the call parameters. Required. To specify no
1132
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1133
+ # @param options [::Gapic::CallOptions, ::Hash]
1134
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1135
+ #
1136
+ # @overload import(instance: nil, project: nil, body: nil)
1137
+ # Pass arguments to `import` via keyword arguments. Note that at
1138
+ # least one keyword argument is required. To specify no parameters, or to keep all
1139
+ # the default parameter values, pass an empty Hash as a request object (see above).
1140
+ #
1141
+ # @param instance [::String]
1142
+ # Cloud SQL instance ID. This does not include the project ID.
1143
+ # @param project [::String]
1144
+ # Project ID of the project that contains the instance.
1145
+ # @param body [::Google::Cloud::Sql::V1::InstancesImportRequest, ::Hash]
1146
+ # @yield [result, operation] Access the result along with the TransportOperation object
1147
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
1148
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1149
+ #
1150
+ # @return [::Google::Cloud::Sql::V1::Operation]
1151
+ #
1152
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1153
+ #
1154
+ # @example Basic example
1155
+ # require "google/cloud/sql/v1"
1156
+ #
1157
+ # # Create a client object. The client can be reused for multiple calls.
1158
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
1159
+ #
1160
+ # # Create a request. To set request fields, pass in keyword arguments.
1161
+ # request = Google::Cloud::Sql::V1::SqlInstancesImportRequest.new
1162
+ #
1163
+ # # Call the import method.
1164
+ # result = client.import request
1165
+ #
1166
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
1167
+ # p result
1168
+ #
1169
+ def import request, options = nil
1170
+ raise ::ArgumentError, "request must be provided" if request.nil?
1171
+
1172
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesImportRequest
1173
+
1174
+ # Converts hash and nil to an options object
1175
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1176
+
1177
+ # Customize the options with defaults
1178
+ call_metadata = @config.rpcs.import.metadata.to_h
1179
+
1180
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1181
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1182
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1183
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
1184
+ transports_version_send: [:rest]
1185
+
1186
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1187
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1188
+
1189
+ options.apply_defaults timeout: @config.rpcs.import.timeout,
1190
+ metadata: call_metadata,
1191
+ retry_policy: @config.rpcs.import.retry_policy
1192
+
1193
+ options.apply_defaults timeout: @config.timeout,
1194
+ metadata: @config.metadata,
1195
+ retry_policy: @config.retry_policy
1196
+
1197
+ @sql_instances_service_stub.import request, options do |result, operation|
1198
+ yield result, operation if block_given?
1199
+ end
1200
+ rescue ::Gapic::Rest::Error => e
1201
+ raise ::Google::Cloud::Error.from_error(e)
1202
+ end
1203
+
1204
+ ##
1205
+ # Creates a new Cloud SQL instance.
1206
+ #
1207
+ # @overload insert(request, options = nil)
1208
+ # Pass arguments to `insert` via a request object, either of type
1209
+ # {::Google::Cloud::Sql::V1::SqlInstancesInsertRequest} or an equivalent Hash.
1210
+ #
1211
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesInsertRequest, ::Hash]
1212
+ # A request object representing the call parameters. Required. To specify no
1213
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1214
+ # @param options [::Gapic::CallOptions, ::Hash]
1215
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1216
+ #
1217
+ # @overload insert(project: nil, body: nil)
1218
+ # Pass arguments to `insert` via keyword arguments. Note that at
1219
+ # least one keyword argument is required. To specify no parameters, or to keep all
1220
+ # the default parameter values, pass an empty Hash as a request object (see above).
1221
+ #
1222
+ # @param project [::String]
1223
+ # Project ID of the project to which the newly created Cloud SQL instances
1224
+ # should belong.
1225
+ # @param body [::Google::Cloud::Sql::V1::DatabaseInstance, ::Hash]
1226
+ # @yield [result, operation] Access the result along with the TransportOperation object
1227
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
1228
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1229
+ #
1230
+ # @return [::Google::Cloud::Sql::V1::Operation]
1231
+ #
1232
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1233
+ #
1234
+ # @example Basic example
1235
+ # require "google/cloud/sql/v1"
1236
+ #
1237
+ # # Create a client object. The client can be reused for multiple calls.
1238
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
1239
+ #
1240
+ # # Create a request. To set request fields, pass in keyword arguments.
1241
+ # request = Google::Cloud::Sql::V1::SqlInstancesInsertRequest.new
1242
+ #
1243
+ # # Call the insert method.
1244
+ # result = client.insert request
1245
+ #
1246
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
1247
+ # p result
1248
+ #
1249
+ def insert request, options = nil
1250
+ raise ::ArgumentError, "request must be provided" if request.nil?
1251
+
1252
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesInsertRequest
1253
+
1254
+ # Converts hash and nil to an options object
1255
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1256
+
1257
+ # Customize the options with defaults
1258
+ call_metadata = @config.rpcs.insert.metadata.to_h
1259
+
1260
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1261
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1262
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1263
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
1264
+ transports_version_send: [:rest]
1265
+
1266
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1267
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1268
+
1269
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
1270
+ metadata: call_metadata,
1271
+ retry_policy: @config.rpcs.insert.retry_policy
1272
+
1273
+ options.apply_defaults timeout: @config.timeout,
1274
+ metadata: @config.metadata,
1275
+ retry_policy: @config.retry_policy
1276
+
1277
+ @sql_instances_service_stub.insert request, options do |result, operation|
1278
+ yield result, operation if block_given?
1279
+ end
1280
+ rescue ::Gapic::Rest::Error => e
1281
+ raise ::Google::Cloud::Error.from_error(e)
1282
+ end
1283
+
1284
+ ##
1285
+ # Lists instances under a given project.
1286
+ #
1287
+ # @overload list(request, options = nil)
1288
+ # Pass arguments to `list` via a request object, either of type
1289
+ # {::Google::Cloud::Sql::V1::SqlInstancesListRequest} or an equivalent Hash.
1290
+ #
1291
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesListRequest, ::Hash]
1292
+ # A request object representing the call parameters. Required. To specify no
1293
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1294
+ # @param options [::Gapic::CallOptions, ::Hash]
1295
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1296
+ #
1297
+ # @overload list(filter: nil, max_results: nil, page_token: nil, project: nil)
1298
+ # Pass arguments to `list` via keyword arguments. Note that at
1299
+ # least one keyword argument is required. To specify no parameters, or to keep all
1300
+ # the default parameter values, pass an empty Hash as a request object (see above).
1301
+ #
1302
+ # @param filter [::String]
1303
+ # A filter expression that filters resources listed in the response.
1304
+ # The expression is in the form of field:value. For example,
1305
+ # 'instanceType:CLOUD_SQL_INSTANCE'. Fields can be nested as needed as per
1306
+ # their JSON representation, such as 'settings.userLabels.auto_start:true'.
1307
+ #
1308
+ # Multiple filter queries are space-separated. For example.
1309
+ # 'state:RUNNABLE instanceType:CLOUD_SQL_INSTANCE'. By default, each
1310
+ # expression is an AND expression. However, you can include AND and OR
1311
+ # expressions explicitly.
1312
+ # @param max_results [::Integer]
1313
+ # The maximum number of instances to return. The service may return fewer
1314
+ # than this value.
1315
+ # If unspecified, at most 500 instances are returned.
1316
+ # The maximum value is 1000; values above 1000 are coerced to 1000.
1317
+ # @param page_token [::String]
1318
+ # A previously-returned page token representing part of the larger set of
1319
+ # results to view.
1320
+ # @param project [::String]
1321
+ # Project ID of the project for which to list Cloud SQL instances.
1322
+ # @yield [result, operation] Access the result along with the TransportOperation object
1323
+ # @yieldparam result [::Google::Cloud::Sql::V1::InstancesListResponse]
1324
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1325
+ #
1326
+ # @return [::Google::Cloud::Sql::V1::InstancesListResponse]
1327
+ #
1328
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1329
+ #
1330
+ # @example Basic example
1331
+ # require "google/cloud/sql/v1"
1332
+ #
1333
+ # # Create a client object. The client can be reused for multiple calls.
1334
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
1335
+ #
1336
+ # # Create a request. To set request fields, pass in keyword arguments.
1337
+ # request = Google::Cloud::Sql::V1::SqlInstancesListRequest.new
1338
+ #
1339
+ # # Call the list method.
1340
+ # result = client.list request
1341
+ #
1342
+ # # The returned object is of type Google::Cloud::Sql::V1::InstancesListResponse.
1343
+ # p result
1344
+ #
1345
+ def list request, options = nil
1346
+ raise ::ArgumentError, "request must be provided" if request.nil?
1347
+
1348
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesListRequest
1349
+
1350
+ # Converts hash and nil to an options object
1351
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1352
+
1353
+ # Customize the options with defaults
1354
+ call_metadata = @config.rpcs.list.metadata.to_h
1355
+
1356
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1357
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1358
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1359
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
1360
+ transports_version_send: [:rest]
1361
+
1362
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1363
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1364
+
1365
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
1366
+ metadata: call_metadata,
1367
+ retry_policy: @config.rpcs.list.retry_policy
1368
+
1369
+ options.apply_defaults timeout: @config.timeout,
1370
+ metadata: @config.metadata,
1371
+ retry_policy: @config.retry_policy
1372
+
1373
+ @sql_instances_service_stub.list request, options do |result, operation|
1374
+ yield result, operation if block_given?
1375
+ end
1376
+ rescue ::Gapic::Rest::Error => e
1377
+ raise ::Google::Cloud::Error.from_error(e)
1378
+ end
1379
+
1380
+ ##
1381
+ # Lists all of the trusted Certificate Authorities (CAs) for the specified
1382
+ # instance. There can be up to three CAs listed: the CA that was used to sign
1383
+ # the certificate that is currently in use, a CA that has been added but not
1384
+ # yet used to sign a certificate, and a CA used to sign a certificate that
1385
+ # has previously rotated out.
1386
+ #
1387
+ # @overload list_server_cas(request, options = nil)
1388
+ # Pass arguments to `list_server_cas` via a request object, either of type
1389
+ # {::Google::Cloud::Sql::V1::SqlInstancesListServerCasRequest} or an equivalent Hash.
1390
+ #
1391
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesListServerCasRequest, ::Hash]
1392
+ # A request object representing the call parameters. Required. To specify no
1393
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1394
+ # @param options [::Gapic::CallOptions, ::Hash]
1395
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1396
+ #
1397
+ # @overload list_server_cas(instance: nil, project: nil)
1398
+ # Pass arguments to `list_server_cas` via keyword arguments. Note that at
1399
+ # least one keyword argument is required. To specify no parameters, or to keep all
1400
+ # the default parameter values, pass an empty Hash as a request object (see above).
1401
+ #
1402
+ # @param instance [::String]
1403
+ # Cloud SQL instance ID. This does not include the project ID.
1404
+ # @param project [::String]
1405
+ # Project ID of the project that contains the instance.
1406
+ # @yield [result, operation] Access the result along with the TransportOperation object
1407
+ # @yieldparam result [::Google::Cloud::Sql::V1::InstancesListServerCasResponse]
1408
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1409
+ #
1410
+ # @return [::Google::Cloud::Sql::V1::InstancesListServerCasResponse]
1411
+ #
1412
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1413
+ #
1414
+ # @example Basic example
1415
+ # require "google/cloud/sql/v1"
1416
+ #
1417
+ # # Create a client object. The client can be reused for multiple calls.
1418
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
1419
+ #
1420
+ # # Create a request. To set request fields, pass in keyword arguments.
1421
+ # request = Google::Cloud::Sql::V1::SqlInstancesListServerCasRequest.new
1422
+ #
1423
+ # # Call the list_server_cas method.
1424
+ # result = client.list_server_cas request
1425
+ #
1426
+ # # The returned object is of type Google::Cloud::Sql::V1::InstancesListServerCasResponse.
1427
+ # p result
1428
+ #
1429
+ def list_server_cas request, options = nil
1430
+ raise ::ArgumentError, "request must be provided" if request.nil?
1431
+
1432
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesListServerCasRequest
1433
+
1434
+ # Converts hash and nil to an options object
1435
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1436
+
1437
+ # Customize the options with defaults
1438
+ call_metadata = @config.rpcs.list_server_cas.metadata.to_h
1439
+
1440
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1441
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1442
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1443
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
1444
+ transports_version_send: [:rest]
1445
+
1446
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1447
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1448
+
1449
+ options.apply_defaults timeout: @config.rpcs.list_server_cas.timeout,
1450
+ metadata: call_metadata,
1451
+ retry_policy: @config.rpcs.list_server_cas.retry_policy
1452
+
1453
+ options.apply_defaults timeout: @config.timeout,
1454
+ metadata: @config.metadata,
1455
+ retry_policy: @config.retry_policy
1456
+
1457
+ @sql_instances_service_stub.list_server_cas request, options do |result, operation|
1458
+ yield result, operation if block_given?
1459
+ end
1460
+ rescue ::Gapic::Rest::Error => e
1461
+ raise ::Google::Cloud::Error.from_error(e)
1462
+ end
1463
+
1464
+ ##
1465
+ # Lists all versions of server certificates and certificate authorities (CAs)
1466
+ # for the specified instance. There can be up to three sets of certs listed:
1467
+ # the certificate that is currently in use, a future that has been added but
1468
+ # not yet used to sign a certificate, and a certificate that has been rotated
1469
+ # out. For instances not using Certificate Authority Service (CAS) server CA,
1470
+ # use ListServerCas instead.
1471
+ #
1472
+ # @overload list_server_certificates(request, options = nil)
1473
+ # Pass arguments to `list_server_certificates` via a request object, either of type
1474
+ # {::Google::Cloud::Sql::V1::SqlInstancesListServerCertificatesRequest} or an equivalent Hash.
1475
+ #
1476
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesListServerCertificatesRequest, ::Hash]
1477
+ # A request object representing the call parameters. Required. To specify no
1478
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1479
+ # @param options [::Gapic::CallOptions, ::Hash]
1480
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1481
+ #
1482
+ # @overload list_server_certificates(instance: nil, project: nil)
1483
+ # Pass arguments to `list_server_certificates` via keyword arguments. Note that at
1484
+ # least one keyword argument is required. To specify no parameters, or to keep all
1485
+ # the default parameter values, pass an empty Hash as a request object (see above).
1486
+ #
1487
+ # @param instance [::String]
1488
+ # Required. Cloud SQL instance ID. This does not include the project ID.
1489
+ # @param project [::String]
1490
+ # Required. Project ID of the project that contains the instance.
1491
+ # @yield [result, operation] Access the result along with the TransportOperation object
1492
+ # @yieldparam result [::Google::Cloud::Sql::V1::InstancesListServerCertificatesResponse]
1493
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1494
+ #
1495
+ # @return [::Google::Cloud::Sql::V1::InstancesListServerCertificatesResponse]
1496
+ #
1497
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1498
+ #
1499
+ # @example Basic example
1500
+ # require "google/cloud/sql/v1"
1501
+ #
1502
+ # # Create a client object. The client can be reused for multiple calls.
1503
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
1504
+ #
1505
+ # # Create a request. To set request fields, pass in keyword arguments.
1506
+ # request = Google::Cloud::Sql::V1::SqlInstancesListServerCertificatesRequest.new
1507
+ #
1508
+ # # Call the list_server_certificates method.
1509
+ # result = client.list_server_certificates request
1510
+ #
1511
+ # # The returned object is of type Google::Cloud::Sql::V1::InstancesListServerCertificatesResponse.
1512
+ # p result
1513
+ #
1514
+ def list_server_certificates request, options = nil
1515
+ raise ::ArgumentError, "request must be provided" if request.nil?
1516
+
1517
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesListServerCertificatesRequest
1518
+
1519
+ # Converts hash and nil to an options object
1520
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1521
+
1522
+ # Customize the options with defaults
1523
+ call_metadata = @config.rpcs.list_server_certificates.metadata.to_h
1524
+
1525
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1526
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1527
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1528
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
1529
+ transports_version_send: [:rest]
1530
+
1531
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1532
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1533
+
1534
+ options.apply_defaults timeout: @config.rpcs.list_server_certificates.timeout,
1535
+ metadata: call_metadata,
1536
+ retry_policy: @config.rpcs.list_server_certificates.retry_policy
1537
+
1538
+ options.apply_defaults timeout: @config.timeout,
1539
+ metadata: @config.metadata,
1540
+ retry_policy: @config.retry_policy
1541
+
1542
+ @sql_instances_service_stub.list_server_certificates request, options do |result, operation|
1543
+ yield result, operation if block_given?
1544
+ end
1545
+ rescue ::Gapic::Rest::Error => e
1546
+ raise ::Google::Cloud::Error.from_error(e)
1547
+ end
1548
+
1549
+ ##
1550
+ # Lists all versions of EntraID certificates for the specified instance.
1551
+ # There can be up to three sets of certificates listed: the certificate that
1552
+ # is currently in use, a future that has been added but not yet used to sign
1553
+ # a certificate, and a certificate that has been rotated out.
1554
+ #
1555
+ # @overload list_entra_id_certificates(request, options = nil)
1556
+ # Pass arguments to `list_entra_id_certificates` via a request object, either of type
1557
+ # {::Google::Cloud::Sql::V1::SqlInstancesListEntraIdCertificatesRequest} or an equivalent Hash.
1558
+ #
1559
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesListEntraIdCertificatesRequest, ::Hash]
1560
+ # A request object representing the call parameters. Required. To specify no
1561
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1562
+ # @param options [::Gapic::CallOptions, ::Hash]
1563
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1564
+ #
1565
+ # @overload list_entra_id_certificates(instance: nil, project: nil)
1566
+ # Pass arguments to `list_entra_id_certificates` via keyword arguments. Note that at
1567
+ # least one keyword argument is required. To specify no parameters, or to keep all
1568
+ # the default parameter values, pass an empty Hash as a request object (see above).
1569
+ #
1570
+ # @param instance [::String]
1571
+ # Required. Cloud SQL instance ID. This does not include the project ID.
1572
+ # @param project [::String]
1573
+ # Required. Project ID of the project that contains the instance.
1574
+ # @yield [result, operation] Access the result along with the TransportOperation object
1575
+ # @yieldparam result [::Google::Cloud::Sql::V1::InstancesListEntraIdCertificatesResponse]
1576
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1577
+ #
1578
+ # @return [::Google::Cloud::Sql::V1::InstancesListEntraIdCertificatesResponse]
1579
+ #
1580
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1581
+ #
1582
+ # @example Basic example
1583
+ # require "google/cloud/sql/v1"
1584
+ #
1585
+ # # Create a client object. The client can be reused for multiple calls.
1586
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
1587
+ #
1588
+ # # Create a request. To set request fields, pass in keyword arguments.
1589
+ # request = Google::Cloud::Sql::V1::SqlInstancesListEntraIdCertificatesRequest.new
1590
+ #
1591
+ # # Call the list_entra_id_certificates method.
1592
+ # result = client.list_entra_id_certificates request
1593
+ #
1594
+ # # The returned object is of type Google::Cloud::Sql::V1::InstancesListEntraIdCertificatesResponse.
1595
+ # p result
1596
+ #
1597
+ def list_entra_id_certificates request, options = nil
1598
+ raise ::ArgumentError, "request must be provided" if request.nil?
1599
+
1600
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesListEntraIdCertificatesRequest
1601
+
1602
+ # Converts hash and nil to an options object
1603
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1604
+
1605
+ # Customize the options with defaults
1606
+ call_metadata = @config.rpcs.list_entra_id_certificates.metadata.to_h
1607
+
1608
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1609
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1610
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1611
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
1612
+ transports_version_send: [:rest]
1613
+
1614
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1615
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1616
+
1617
+ options.apply_defaults timeout: @config.rpcs.list_entra_id_certificates.timeout,
1618
+ metadata: call_metadata,
1619
+ retry_policy: @config.rpcs.list_entra_id_certificates.retry_policy
1620
+
1621
+ options.apply_defaults timeout: @config.timeout,
1622
+ metadata: @config.metadata,
1623
+ retry_policy: @config.retry_policy
1624
+
1625
+ @sql_instances_service_stub.list_entra_id_certificates request, options do |result, operation|
1626
+ yield result, operation if block_given?
1627
+ end
1628
+ rescue ::Gapic::Rest::Error => e
1629
+ raise ::Google::Cloud::Error.from_error(e)
1630
+ end
1631
+
1632
+ ##
1633
+ # Partially updates settings of a Cloud SQL instance by merging the request
1634
+ # with the current configuration. This method supports patch semantics.
1635
+ #
1636
+ # @overload patch(request, options = nil)
1637
+ # Pass arguments to `patch` via a request object, either of type
1638
+ # {::Google::Cloud::Sql::V1::SqlInstancesPatchRequest} or an equivalent Hash.
1639
+ #
1640
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesPatchRequest, ::Hash]
1641
+ # A request object representing the call parameters. Required. To specify no
1642
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1643
+ # @param options [::Gapic::CallOptions, ::Hash]
1644
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1645
+ #
1646
+ # @overload patch(instance: nil, project: nil, body: nil)
1647
+ # Pass arguments to `patch` via keyword arguments. Note that at
1648
+ # least one keyword argument is required. To specify no parameters, or to keep all
1649
+ # the default parameter values, pass an empty Hash as a request object (see above).
1650
+ #
1651
+ # @param instance [::String]
1652
+ # Cloud SQL instance ID. This does not include the project ID.
1653
+ # @param project [::String]
1654
+ # Project ID of the project that contains the instance.
1655
+ # @param body [::Google::Cloud::Sql::V1::DatabaseInstance, ::Hash]
1656
+ # @yield [result, operation] Access the result along with the TransportOperation object
1657
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
1658
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1659
+ #
1660
+ # @return [::Google::Cloud::Sql::V1::Operation]
1661
+ #
1662
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1663
+ #
1664
+ # @example Basic example
1665
+ # require "google/cloud/sql/v1"
1666
+ #
1667
+ # # Create a client object. The client can be reused for multiple calls.
1668
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
1669
+ #
1670
+ # # Create a request. To set request fields, pass in keyword arguments.
1671
+ # request = Google::Cloud::Sql::V1::SqlInstancesPatchRequest.new
1672
+ #
1673
+ # # Call the patch method.
1674
+ # result = client.patch request
1675
+ #
1676
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
1677
+ # p result
1678
+ #
1679
+ def patch request, options = nil
1680
+ raise ::ArgumentError, "request must be provided" if request.nil?
1681
+
1682
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesPatchRequest
1683
+
1684
+ # Converts hash and nil to an options object
1685
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1686
+
1687
+ # Customize the options with defaults
1688
+ call_metadata = @config.rpcs.patch.metadata.to_h
1689
+
1690
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1691
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1692
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1693
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
1694
+ transports_version_send: [:rest]
1695
+
1696
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1697
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1698
+
1699
+ options.apply_defaults timeout: @config.rpcs.patch.timeout,
1700
+ metadata: call_metadata,
1701
+ retry_policy: @config.rpcs.patch.retry_policy
1702
+
1703
+ options.apply_defaults timeout: @config.timeout,
1704
+ metadata: @config.metadata,
1705
+ retry_policy: @config.retry_policy
1706
+
1707
+ @sql_instances_service_stub.patch request, options do |result, operation|
1708
+ yield result, operation if block_given?
1709
+ end
1710
+ rescue ::Gapic::Rest::Error => e
1711
+ raise ::Google::Cloud::Error.from_error(e)
1712
+ end
1713
+
1714
+ ##
1715
+ # Promotes the read replica instance to be an independent Cloud SQL
1716
+ # primary instance.
1717
+ # Using this operation might cause your instance to restart.
1718
+ #
1719
+ # @overload promote_replica(request, options = nil)
1720
+ # Pass arguments to `promote_replica` via a request object, either of type
1721
+ # {::Google::Cloud::Sql::V1::SqlInstancesPromoteReplicaRequest} or an equivalent Hash.
1722
+ #
1723
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesPromoteReplicaRequest, ::Hash]
1724
+ # A request object representing the call parameters. Required. To specify no
1725
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1726
+ # @param options [::Gapic::CallOptions, ::Hash]
1727
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1728
+ #
1729
+ # @overload promote_replica(instance: nil, project: nil, failover: nil)
1730
+ # Pass arguments to `promote_replica` via keyword arguments. Note that at
1731
+ # least one keyword argument is required. To specify no parameters, or to keep all
1732
+ # the default parameter values, pass an empty Hash as a request object (see above).
1733
+ #
1734
+ # @param instance [::String]
1735
+ # Cloud SQL read replica instance name.
1736
+ # @param project [::String]
1737
+ # ID of the project that contains the read replica.
1738
+ # @param failover [::Boolean]
1739
+ # Set to true to invoke a replica failover to the DR
1740
+ # replica. As part of replica failover, the promote operation attempts
1741
+ # to add the original primary instance as a replica of the promoted
1742
+ # DR replica when the original primary instance comes back online.
1743
+ # If set to false or not specified, then the original primary
1744
+ # instance becomes an independent Cloud SQL primary instance.
1745
+ # @yield [result, operation] Access the result along with the TransportOperation object
1746
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
1747
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1748
+ #
1749
+ # @return [::Google::Cloud::Sql::V1::Operation]
1750
+ #
1751
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1752
+ #
1753
+ # @example Basic example
1754
+ # require "google/cloud/sql/v1"
1755
+ #
1756
+ # # Create a client object. The client can be reused for multiple calls.
1757
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
1758
+ #
1759
+ # # Create a request. To set request fields, pass in keyword arguments.
1760
+ # request = Google::Cloud::Sql::V1::SqlInstancesPromoteReplicaRequest.new
1761
+ #
1762
+ # # Call the promote_replica method.
1763
+ # result = client.promote_replica request
1764
+ #
1765
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
1766
+ # p result
1767
+ #
1768
+ def promote_replica request, options = nil
1769
+ raise ::ArgumentError, "request must be provided" if request.nil?
1770
+
1771
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesPromoteReplicaRequest
1772
+
1773
+ # Converts hash and nil to an options object
1774
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1775
+
1776
+ # Customize the options with defaults
1777
+ call_metadata = @config.rpcs.promote_replica.metadata.to_h
1778
+
1779
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1780
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1781
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1782
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
1783
+ transports_version_send: [:rest]
1784
+
1785
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1786
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1787
+
1788
+ options.apply_defaults timeout: @config.rpcs.promote_replica.timeout,
1789
+ metadata: call_metadata,
1790
+ retry_policy: @config.rpcs.promote_replica.retry_policy
1791
+
1792
+ options.apply_defaults timeout: @config.timeout,
1793
+ metadata: @config.metadata,
1794
+ retry_policy: @config.retry_policy
1795
+
1796
+ @sql_instances_service_stub.promote_replica request, options do |result, operation|
1797
+ yield result, operation if block_given?
1798
+ end
1799
+ rescue ::Gapic::Rest::Error => e
1800
+ raise ::Google::Cloud::Error.from_error(e)
1801
+ end
1802
+
1803
+ ##
1804
+ # Switches over from the primary instance to the DR replica
1805
+ # instance.
1806
+ #
1807
+ # @overload switchover(request, options = nil)
1808
+ # Pass arguments to `switchover` via a request object, either of type
1809
+ # {::Google::Cloud::Sql::V1::SqlInstancesSwitchoverRequest} or an equivalent Hash.
1810
+ #
1811
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesSwitchoverRequest, ::Hash]
1812
+ # A request object representing the call parameters. Required. To specify no
1813
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1814
+ # @param options [::Gapic::CallOptions, ::Hash]
1815
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1816
+ #
1817
+ # @overload switchover(instance: nil, project: nil, db_timeout: nil)
1818
+ # Pass arguments to `switchover` via keyword arguments. Note that at
1819
+ # least one keyword argument is required. To specify no parameters, or to keep all
1820
+ # the default parameter values, pass an empty Hash as a request object (see above).
1821
+ #
1822
+ # @param instance [::String]
1823
+ # Cloud SQL read replica instance name.
1824
+ # @param project [::String]
1825
+ # ID of the project that contains the replica.
1826
+ # @param db_timeout [::Google::Protobuf::Duration, ::Hash]
1827
+ # Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
1828
+ # timeout, which is a sum of all database operations. Default value is 10
1829
+ # minutes and can be modified to a maximum value of 24 hours.
1830
+ # @yield [result, operation] Access the result along with the TransportOperation object
1831
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
1832
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1833
+ #
1834
+ # @return [::Google::Cloud::Sql::V1::Operation]
1835
+ #
1836
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1837
+ #
1838
+ # @example Basic example
1839
+ # require "google/cloud/sql/v1"
1840
+ #
1841
+ # # Create a client object. The client can be reused for multiple calls.
1842
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
1843
+ #
1844
+ # # Create a request. To set request fields, pass in keyword arguments.
1845
+ # request = Google::Cloud::Sql::V1::SqlInstancesSwitchoverRequest.new
1846
+ #
1847
+ # # Call the switchover method.
1848
+ # result = client.switchover request
1849
+ #
1850
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
1851
+ # p result
1852
+ #
1853
+ def switchover request, options = nil
1854
+ raise ::ArgumentError, "request must be provided" if request.nil?
1855
+
1856
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesSwitchoverRequest
1857
+
1858
+ # Converts hash and nil to an options object
1859
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1860
+
1861
+ # Customize the options with defaults
1862
+ call_metadata = @config.rpcs.switchover.metadata.to_h
1863
+
1864
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1865
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1866
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1867
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
1868
+ transports_version_send: [:rest]
1869
+
1870
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1871
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1872
+
1873
+ options.apply_defaults timeout: @config.rpcs.switchover.timeout,
1874
+ metadata: call_metadata,
1875
+ retry_policy: @config.rpcs.switchover.retry_policy
1876
+
1877
+ options.apply_defaults timeout: @config.timeout,
1878
+ metadata: @config.metadata,
1879
+ retry_policy: @config.retry_policy
1880
+
1881
+ @sql_instances_service_stub.switchover request, options do |result, operation|
1882
+ yield result, operation if block_given?
1883
+ end
1884
+ rescue ::Gapic::Rest::Error => e
1885
+ raise ::Google::Cloud::Error.from_error(e)
1886
+ end
1887
+
1888
+ ##
1889
+ # Deletes all client certificates and generates a new server SSL certificate
1890
+ # for the instance.
1891
+ #
1892
+ # @overload reset_ssl_config(request, options = nil)
1893
+ # Pass arguments to `reset_ssl_config` via a request object, either of type
1894
+ # {::Google::Cloud::Sql::V1::SqlInstancesResetSslConfigRequest} or an equivalent Hash.
1895
+ #
1896
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesResetSslConfigRequest, ::Hash]
1897
+ # A request object representing the call parameters. Required. To specify no
1898
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1899
+ # @param options [::Gapic::CallOptions, ::Hash]
1900
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1901
+ #
1902
+ # @overload reset_ssl_config(instance: nil, project: nil, mode: nil)
1903
+ # Pass arguments to `reset_ssl_config` via keyword arguments. Note that at
1904
+ # least one keyword argument is required. To specify no parameters, or to keep all
1905
+ # the default parameter values, pass an empty Hash as a request object (see above).
1906
+ #
1907
+ # @param instance [::String]
1908
+ # Cloud SQL instance ID. This does not include the project ID.
1909
+ # @param project [::String]
1910
+ # Project ID of the project that contains the instance.
1911
+ # @param mode [::Google::Cloud::Sql::V1::SqlInstancesResetSslConfigRequest::ResetSslMode]
1912
+ # Optional. Reset SSL mode to use.
1913
+ # @yield [result, operation] Access the result along with the TransportOperation object
1914
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
1915
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1916
+ #
1917
+ # @return [::Google::Cloud::Sql::V1::Operation]
1918
+ #
1919
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1920
+ #
1921
+ # @example Basic example
1922
+ # require "google/cloud/sql/v1"
1923
+ #
1924
+ # # Create a client object. The client can be reused for multiple calls.
1925
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
1926
+ #
1927
+ # # Create a request. To set request fields, pass in keyword arguments.
1928
+ # request = Google::Cloud::Sql::V1::SqlInstancesResetSslConfigRequest.new
1929
+ #
1930
+ # # Call the reset_ssl_config method.
1931
+ # result = client.reset_ssl_config request
1932
+ #
1933
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
1934
+ # p result
1935
+ #
1936
+ def reset_ssl_config request, options = nil
1937
+ raise ::ArgumentError, "request must be provided" if request.nil?
1938
+
1939
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesResetSslConfigRequest
1940
+
1941
+ # Converts hash and nil to an options object
1942
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1943
+
1944
+ # Customize the options with defaults
1945
+ call_metadata = @config.rpcs.reset_ssl_config.metadata.to_h
1946
+
1947
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1948
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1949
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1950
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
1951
+ transports_version_send: [:rest]
1952
+
1953
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1954
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1955
+
1956
+ options.apply_defaults timeout: @config.rpcs.reset_ssl_config.timeout,
1957
+ metadata: call_metadata,
1958
+ retry_policy: @config.rpcs.reset_ssl_config.retry_policy
1959
+
1960
+ options.apply_defaults timeout: @config.timeout,
1961
+ metadata: @config.metadata,
1962
+ retry_policy: @config.retry_policy
1963
+
1964
+ @sql_instances_service_stub.reset_ssl_config request, options do |result, operation|
1965
+ yield result, operation if block_given?
1966
+ end
1967
+ rescue ::Gapic::Rest::Error => e
1968
+ raise ::Google::Cloud::Error.from_error(e)
1969
+ end
1970
+
1971
+ ##
1972
+ # Restarts a Cloud SQL instance.
1973
+ #
1974
+ # @overload restart(request, options = nil)
1975
+ # Pass arguments to `restart` via a request object, either of type
1976
+ # {::Google::Cloud::Sql::V1::SqlInstancesRestartRequest} or an equivalent Hash.
1977
+ #
1978
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesRestartRequest, ::Hash]
1979
+ # A request object representing the call parameters. Required. To specify no
1980
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1981
+ # @param options [::Gapic::CallOptions, ::Hash]
1982
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1983
+ #
1984
+ # @overload restart(instance: nil, project: nil)
1985
+ # Pass arguments to `restart` via keyword arguments. Note that at
1986
+ # least one keyword argument is required. To specify no parameters, or to keep all
1987
+ # the default parameter values, pass an empty Hash as a request object (see above).
1988
+ #
1989
+ # @param instance [::String]
1990
+ # Cloud SQL instance ID. This does not include the project ID.
1991
+ # @param project [::String]
1992
+ # Project ID of the project that contains the instance to be restarted.
1993
+ # @yield [result, operation] Access the result along with the TransportOperation object
1994
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
1995
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1996
+ #
1997
+ # @return [::Google::Cloud::Sql::V1::Operation]
1998
+ #
1999
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2000
+ #
2001
+ # @example Basic example
2002
+ # require "google/cloud/sql/v1"
2003
+ #
2004
+ # # Create a client object. The client can be reused for multiple calls.
2005
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
2006
+ #
2007
+ # # Create a request. To set request fields, pass in keyword arguments.
2008
+ # request = Google::Cloud::Sql::V1::SqlInstancesRestartRequest.new
2009
+ #
2010
+ # # Call the restart method.
2011
+ # result = client.restart request
2012
+ #
2013
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2014
+ # p result
2015
+ #
2016
+ def restart request, options = nil
2017
+ raise ::ArgumentError, "request must be provided" if request.nil?
2018
+
2019
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesRestartRequest
2020
+
2021
+ # Converts hash and nil to an options object
2022
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2023
+
2024
+ # Customize the options with defaults
2025
+ call_metadata = @config.rpcs.restart.metadata.to_h
2026
+
2027
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2028
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2029
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2030
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
2031
+ transports_version_send: [:rest]
2032
+
2033
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2034
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2035
+
2036
+ options.apply_defaults timeout: @config.rpcs.restart.timeout,
2037
+ metadata: call_metadata,
2038
+ retry_policy: @config.rpcs.restart.retry_policy
2039
+
2040
+ options.apply_defaults timeout: @config.timeout,
2041
+ metadata: @config.metadata,
2042
+ retry_policy: @config.retry_policy
2043
+
2044
+ @sql_instances_service_stub.restart request, options do |result, operation|
2045
+ yield result, operation if block_given?
2046
+ end
2047
+ rescue ::Gapic::Rest::Error => e
2048
+ raise ::Google::Cloud::Error.from_error(e)
2049
+ end
2050
+
2051
+ ##
2052
+ # Restores a backup of a Cloud SQL instance. Using this operation might cause
2053
+ # your instance to restart.
2054
+ #
2055
+ # @overload restore_backup(request, options = nil)
2056
+ # Pass arguments to `restore_backup` via a request object, either of type
2057
+ # {::Google::Cloud::Sql::V1::SqlInstancesRestoreBackupRequest} or an equivalent Hash.
2058
+ #
2059
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesRestoreBackupRequest, ::Hash]
2060
+ # A request object representing the call parameters. Required. To specify no
2061
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2062
+ # @param options [::Gapic::CallOptions, ::Hash]
2063
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2064
+ #
2065
+ # @overload restore_backup(instance: nil, project: nil, body: nil)
2066
+ # Pass arguments to `restore_backup` via keyword arguments. Note that at
2067
+ # least one keyword argument is required. To specify no parameters, or to keep all
2068
+ # the default parameter values, pass an empty Hash as a request object (see above).
2069
+ #
2070
+ # @param instance [::String]
2071
+ # Cloud SQL instance ID. This does not include the project ID.
2072
+ # @param project [::String]
2073
+ # Project ID of the project that contains the instance.
2074
+ # @param body [::Google::Cloud::Sql::V1::InstancesRestoreBackupRequest, ::Hash]
2075
+ # @yield [result, operation] Access the result along with the TransportOperation object
2076
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
2077
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2078
+ #
2079
+ # @return [::Google::Cloud::Sql::V1::Operation]
2080
+ #
2081
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2082
+ #
2083
+ # @example Basic example
2084
+ # require "google/cloud/sql/v1"
2085
+ #
2086
+ # # Create a client object. The client can be reused for multiple calls.
2087
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
2088
+ #
2089
+ # # Create a request. To set request fields, pass in keyword arguments.
2090
+ # request = Google::Cloud::Sql::V1::SqlInstancesRestoreBackupRequest.new
2091
+ #
2092
+ # # Call the restore_backup method.
2093
+ # result = client.restore_backup request
2094
+ #
2095
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2096
+ # p result
2097
+ #
2098
+ def restore_backup request, options = nil
2099
+ raise ::ArgumentError, "request must be provided" if request.nil?
2100
+
2101
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesRestoreBackupRequest
2102
+
2103
+ # Converts hash and nil to an options object
2104
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2105
+
2106
+ # Customize the options with defaults
2107
+ call_metadata = @config.rpcs.restore_backup.metadata.to_h
2108
+
2109
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2110
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2111
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2112
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
2113
+ transports_version_send: [:rest]
2114
+
2115
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2116
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2117
+
2118
+ options.apply_defaults timeout: @config.rpcs.restore_backup.timeout,
2119
+ metadata: call_metadata,
2120
+ retry_policy: @config.rpcs.restore_backup.retry_policy
2121
+
2122
+ options.apply_defaults timeout: @config.timeout,
2123
+ metadata: @config.metadata,
2124
+ retry_policy: @config.retry_policy
2125
+
2126
+ @sql_instances_service_stub.restore_backup request, options do |result, operation|
2127
+ yield result, operation if block_given?
2128
+ end
2129
+ rescue ::Gapic::Rest::Error => e
2130
+ raise ::Google::Cloud::Error.from_error(e)
2131
+ end
2132
+
2133
+ ##
2134
+ # Rotates the server certificate to one signed by the Certificate Authority
2135
+ # (CA) version previously added with the addServerCA method. For instances
2136
+ # that have enabled Certificate Authority Service (CAS) based server CA,
2137
+ # use RotateServerCertificate to rotate the server certificate.
2138
+ #
2139
+ # @overload rotate_server_ca(request, options = nil)
2140
+ # Pass arguments to `rotate_server_ca` via a request object, either of type
2141
+ # {::Google::Cloud::Sql::V1::SqlInstancesRotateServerCaRequest} or an equivalent Hash.
2142
+ #
2143
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesRotateServerCaRequest, ::Hash]
2144
+ # A request object representing the call parameters. Required. To specify no
2145
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2146
+ # @param options [::Gapic::CallOptions, ::Hash]
2147
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2148
+ #
2149
+ # @overload rotate_server_ca(instance: nil, project: nil, body: nil)
2150
+ # Pass arguments to `rotate_server_ca` via keyword arguments. Note that at
2151
+ # least one keyword argument is required. To specify no parameters, or to keep all
2152
+ # the default parameter values, pass an empty Hash as a request object (see above).
2153
+ #
2154
+ # @param instance [::String]
2155
+ # Cloud SQL instance ID. This does not include the project ID.
2156
+ # @param project [::String]
2157
+ # Project ID of the project that contains the instance.
2158
+ # @param body [::Google::Cloud::Sql::V1::InstancesRotateServerCaRequest, ::Hash]
2159
+ # @yield [result, operation] Access the result along with the TransportOperation object
2160
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
2161
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2162
+ #
2163
+ # @return [::Google::Cloud::Sql::V1::Operation]
2164
+ #
2165
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2166
+ #
2167
+ # @example Basic example
2168
+ # require "google/cloud/sql/v1"
2169
+ #
2170
+ # # Create a client object. The client can be reused for multiple calls.
2171
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
2172
+ #
2173
+ # # Create a request. To set request fields, pass in keyword arguments.
2174
+ # request = Google::Cloud::Sql::V1::SqlInstancesRotateServerCaRequest.new
2175
+ #
2176
+ # # Call the rotate_server_ca method.
2177
+ # result = client.rotate_server_ca request
2178
+ #
2179
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2180
+ # p result
2181
+ #
2182
+ def rotate_server_ca request, options = nil
2183
+ raise ::ArgumentError, "request must be provided" if request.nil?
2184
+
2185
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesRotateServerCaRequest
2186
+
2187
+ # Converts hash and nil to an options object
2188
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2189
+
2190
+ # Customize the options with defaults
2191
+ call_metadata = @config.rpcs.rotate_server_ca.metadata.to_h
2192
+
2193
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2194
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2195
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2196
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
2197
+ transports_version_send: [:rest]
2198
+
2199
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2200
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2201
+
2202
+ options.apply_defaults timeout: @config.rpcs.rotate_server_ca.timeout,
2203
+ metadata: call_metadata,
2204
+ retry_policy: @config.rpcs.rotate_server_ca.retry_policy
2205
+
2206
+ options.apply_defaults timeout: @config.timeout,
2207
+ metadata: @config.metadata,
2208
+ retry_policy: @config.retry_policy
2209
+
2210
+ @sql_instances_service_stub.rotate_server_ca request, options do |result, operation|
2211
+ yield result, operation if block_given?
2212
+ end
2213
+ rescue ::Gapic::Rest::Error => e
2214
+ raise ::Google::Cloud::Error.from_error(e)
2215
+ end
2216
+
2217
+ ##
2218
+ # Rotates the server certificate version to one previously added with the
2219
+ # addServerCertificate method. For instances not using Certificate Authority
2220
+ # Service (CAS) server CA, use RotateServerCa instead.
2221
+ #
2222
+ # @overload rotate_server_certificate(request, options = nil)
2223
+ # Pass arguments to `rotate_server_certificate` via a request object, either of type
2224
+ # {::Google::Cloud::Sql::V1::SqlInstancesRotateServerCertificateRequest} or an equivalent Hash.
2225
+ #
2226
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesRotateServerCertificateRequest, ::Hash]
2227
+ # A request object representing the call parameters. Required. To specify no
2228
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2229
+ # @param options [::Gapic::CallOptions, ::Hash]
2230
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2231
+ #
2232
+ # @overload rotate_server_certificate(instance: nil, project: nil, body: nil)
2233
+ # Pass arguments to `rotate_server_certificate` via keyword arguments. Note that at
2234
+ # least one keyword argument is required. To specify no parameters, or to keep all
2235
+ # the default parameter values, pass an empty Hash as a request object (see above).
2236
+ #
2237
+ # @param instance [::String]
2238
+ # Required. Cloud SQL instance ID. This does not include the project ID.
2239
+ # @param project [::String]
2240
+ # Required. Project ID of the project that contains the instance.
2241
+ # @param body [::Google::Cloud::Sql::V1::InstancesRotateServerCertificateRequest, ::Hash]
2242
+ # Optional. Rotate server certificate request body.
2243
+ # @yield [result, operation] Access the result along with the TransportOperation object
2244
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
2245
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2246
+ #
2247
+ # @return [::Google::Cloud::Sql::V1::Operation]
2248
+ #
2249
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2250
+ #
2251
+ # @example Basic example
2252
+ # require "google/cloud/sql/v1"
2253
+ #
2254
+ # # Create a client object. The client can be reused for multiple calls.
2255
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
2256
+ #
2257
+ # # Create a request. To set request fields, pass in keyword arguments.
2258
+ # request = Google::Cloud::Sql::V1::SqlInstancesRotateServerCertificateRequest.new
2259
+ #
2260
+ # # Call the rotate_server_certificate method.
2261
+ # result = client.rotate_server_certificate request
2262
+ #
2263
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2264
+ # p result
2265
+ #
2266
+ def rotate_server_certificate request, options = nil
2267
+ raise ::ArgumentError, "request must be provided" if request.nil?
2268
+
2269
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesRotateServerCertificateRequest
2270
+
2271
+ # Converts hash and nil to an options object
2272
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2273
+
2274
+ # Customize the options with defaults
2275
+ call_metadata = @config.rpcs.rotate_server_certificate.metadata.to_h
2276
+
2277
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2278
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2279
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2280
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
2281
+ transports_version_send: [:rest]
2282
+
2283
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2284
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2285
+
2286
+ options.apply_defaults timeout: @config.rpcs.rotate_server_certificate.timeout,
2287
+ metadata: call_metadata,
2288
+ retry_policy: @config.rpcs.rotate_server_certificate.retry_policy
2289
+
2290
+ options.apply_defaults timeout: @config.timeout,
2291
+ metadata: @config.metadata,
2292
+ retry_policy: @config.retry_policy
2293
+
2294
+ @sql_instances_service_stub.rotate_server_certificate request, options do |result, operation|
2295
+ yield result, operation if block_given?
2296
+ end
2297
+ rescue ::Gapic::Rest::Error => e
2298
+ raise ::Google::Cloud::Error.from_error(e)
2299
+ end
2300
+
2301
+ ##
2302
+ # Rotates the server certificate version to one previously added with the
2303
+ # addEntraIdCertificate method.
2304
+ #
2305
+ # @overload rotate_entra_id_certificate(request, options = nil)
2306
+ # Pass arguments to `rotate_entra_id_certificate` via a request object, either of type
2307
+ # {::Google::Cloud::Sql::V1::SqlInstancesRotateEntraIdCertificateRequest} or an equivalent Hash.
2308
+ #
2309
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesRotateEntraIdCertificateRequest, ::Hash]
2310
+ # A request object representing the call parameters. Required. To specify no
2311
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2312
+ # @param options [::Gapic::CallOptions, ::Hash]
2313
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2314
+ #
2315
+ # @overload rotate_entra_id_certificate(instance: nil, project: nil, body: nil)
2316
+ # Pass arguments to `rotate_entra_id_certificate` via keyword arguments. Note that at
2317
+ # least one keyword argument is required. To specify no parameters, or to keep all
2318
+ # the default parameter values, pass an empty Hash as a request object (see above).
2319
+ #
2320
+ # @param instance [::String]
2321
+ # Required. Cloud SQL instance ID. This does not include the project ID.
2322
+ # @param project [::String]
2323
+ # Required. Project ID of the project that contains the instance.
2324
+ # @param body [::Google::Cloud::Sql::V1::InstancesRotateEntraIdCertificateRequest, ::Hash]
2325
+ # Optional. Rotate Entra ID certificate request body.
2326
+ # @yield [result, operation] Access the result along with the TransportOperation object
2327
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
2328
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2329
+ #
2330
+ # @return [::Google::Cloud::Sql::V1::Operation]
2331
+ #
2332
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2333
+ #
2334
+ # @example Basic example
2335
+ # require "google/cloud/sql/v1"
2336
+ #
2337
+ # # Create a client object. The client can be reused for multiple calls.
2338
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
2339
+ #
2340
+ # # Create a request. To set request fields, pass in keyword arguments.
2341
+ # request = Google::Cloud::Sql::V1::SqlInstancesRotateEntraIdCertificateRequest.new
2342
+ #
2343
+ # # Call the rotate_entra_id_certificate method.
2344
+ # result = client.rotate_entra_id_certificate request
2345
+ #
2346
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2347
+ # p result
2348
+ #
2349
+ def rotate_entra_id_certificate request, options = nil
2350
+ raise ::ArgumentError, "request must be provided" if request.nil?
2351
+
2352
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesRotateEntraIdCertificateRequest
2353
+
2354
+ # Converts hash and nil to an options object
2355
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2356
+
2357
+ # Customize the options with defaults
2358
+ call_metadata = @config.rpcs.rotate_entra_id_certificate.metadata.to_h
2359
+
2360
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2361
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2362
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2363
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
2364
+ transports_version_send: [:rest]
2365
+
2366
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2367
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2368
+
2369
+ options.apply_defaults timeout: @config.rpcs.rotate_entra_id_certificate.timeout,
2370
+ metadata: call_metadata,
2371
+ retry_policy: @config.rpcs.rotate_entra_id_certificate.retry_policy
2372
+
2373
+ options.apply_defaults timeout: @config.timeout,
2374
+ metadata: @config.metadata,
2375
+ retry_policy: @config.retry_policy
2376
+
2377
+ @sql_instances_service_stub.rotate_entra_id_certificate request, options do |result, operation|
2378
+ yield result, operation if block_given?
2379
+ end
2380
+ rescue ::Gapic::Rest::Error => e
2381
+ raise ::Google::Cloud::Error.from_error(e)
2382
+ end
2383
+
2384
+ ##
2385
+ # Starts the replication in the read replica instance.
2386
+ #
2387
+ # @overload start_replica(request, options = nil)
2388
+ # Pass arguments to `start_replica` via a request object, either of type
2389
+ # {::Google::Cloud::Sql::V1::SqlInstancesStartReplicaRequest} or an equivalent Hash.
2390
+ #
2391
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesStartReplicaRequest, ::Hash]
2392
+ # A request object representing the call parameters. Required. To specify no
2393
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2394
+ # @param options [::Gapic::CallOptions, ::Hash]
2395
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2396
+ #
2397
+ # @overload start_replica(instance: nil, project: nil)
2398
+ # Pass arguments to `start_replica` via keyword arguments. Note that at
2399
+ # least one keyword argument is required. To specify no parameters, or to keep all
2400
+ # the default parameter values, pass an empty Hash as a request object (see above).
2401
+ #
2402
+ # @param instance [::String]
2403
+ # Cloud SQL read replica instance name.
2404
+ # @param project [::String]
2405
+ # ID of the project that contains the read replica.
2406
+ # @yield [result, operation] Access the result along with the TransportOperation object
2407
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
2408
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2409
+ #
2410
+ # @return [::Google::Cloud::Sql::V1::Operation]
2411
+ #
2412
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2413
+ #
2414
+ # @example Basic example
2415
+ # require "google/cloud/sql/v1"
2416
+ #
2417
+ # # Create a client object. The client can be reused for multiple calls.
2418
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
2419
+ #
2420
+ # # Create a request. To set request fields, pass in keyword arguments.
2421
+ # request = Google::Cloud::Sql::V1::SqlInstancesStartReplicaRequest.new
2422
+ #
2423
+ # # Call the start_replica method.
2424
+ # result = client.start_replica request
2425
+ #
2426
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2427
+ # p result
2428
+ #
2429
+ def start_replica request, options = nil
2430
+ raise ::ArgumentError, "request must be provided" if request.nil?
2431
+
2432
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesStartReplicaRequest
2433
+
2434
+ # Converts hash and nil to an options object
2435
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2436
+
2437
+ # Customize the options with defaults
2438
+ call_metadata = @config.rpcs.start_replica.metadata.to_h
2439
+
2440
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2441
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2442
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2443
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
2444
+ transports_version_send: [:rest]
2445
+
2446
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2447
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2448
+
2449
+ options.apply_defaults timeout: @config.rpcs.start_replica.timeout,
2450
+ metadata: call_metadata,
2451
+ retry_policy: @config.rpcs.start_replica.retry_policy
2452
+
2453
+ options.apply_defaults timeout: @config.timeout,
2454
+ metadata: @config.metadata,
2455
+ retry_policy: @config.retry_policy
2456
+
2457
+ @sql_instances_service_stub.start_replica request, options do |result, operation|
2458
+ yield result, operation if block_given?
2459
+ end
2460
+ rescue ::Gapic::Rest::Error => e
2461
+ raise ::Google::Cloud::Error.from_error(e)
2462
+ end
2463
+
2464
+ ##
2465
+ # Stops the replication in the read replica instance.
2466
+ #
2467
+ # @overload stop_replica(request, options = nil)
2468
+ # Pass arguments to `stop_replica` via a request object, either of type
2469
+ # {::Google::Cloud::Sql::V1::SqlInstancesStopReplicaRequest} or an equivalent Hash.
2470
+ #
2471
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesStopReplicaRequest, ::Hash]
2472
+ # A request object representing the call parameters. Required. To specify no
2473
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2474
+ # @param options [::Gapic::CallOptions, ::Hash]
2475
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2476
+ #
2477
+ # @overload stop_replica(instance: nil, project: nil)
2478
+ # Pass arguments to `stop_replica` via keyword arguments. Note that at
2479
+ # least one keyword argument is required. To specify no parameters, or to keep all
2480
+ # the default parameter values, pass an empty Hash as a request object (see above).
2481
+ #
2482
+ # @param instance [::String]
2483
+ # Cloud SQL read replica instance name.
2484
+ # @param project [::String]
2485
+ # ID of the project that contains the read replica.
2486
+ # @yield [result, operation] Access the result along with the TransportOperation object
2487
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
2488
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2489
+ #
2490
+ # @return [::Google::Cloud::Sql::V1::Operation]
2491
+ #
2492
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2493
+ #
2494
+ # @example Basic example
2495
+ # require "google/cloud/sql/v1"
2496
+ #
2497
+ # # Create a client object. The client can be reused for multiple calls.
2498
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
2499
+ #
2500
+ # # Create a request. To set request fields, pass in keyword arguments.
2501
+ # request = Google::Cloud::Sql::V1::SqlInstancesStopReplicaRequest.new
2502
+ #
2503
+ # # Call the stop_replica method.
2504
+ # result = client.stop_replica request
2505
+ #
2506
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2507
+ # p result
2508
+ #
2509
+ def stop_replica request, options = nil
2510
+ raise ::ArgumentError, "request must be provided" if request.nil?
2511
+
2512
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesStopReplicaRequest
2513
+
2514
+ # Converts hash and nil to an options object
2515
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2516
+
2517
+ # Customize the options with defaults
2518
+ call_metadata = @config.rpcs.stop_replica.metadata.to_h
2519
+
2520
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2521
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2522
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2523
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
2524
+ transports_version_send: [:rest]
2525
+
2526
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2527
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2528
+
2529
+ options.apply_defaults timeout: @config.rpcs.stop_replica.timeout,
2530
+ metadata: call_metadata,
2531
+ retry_policy: @config.rpcs.stop_replica.retry_policy
2532
+
2533
+ options.apply_defaults timeout: @config.timeout,
2534
+ metadata: @config.metadata,
2535
+ retry_policy: @config.retry_policy
2536
+
2537
+ @sql_instances_service_stub.stop_replica request, options do |result, operation|
2538
+ yield result, operation if block_given?
2539
+ end
2540
+ rescue ::Gapic::Rest::Error => e
2541
+ raise ::Google::Cloud::Error.from_error(e)
2542
+ end
2543
+
2544
+ ##
2545
+ # Truncate MySQL general and slow query log tables
2546
+ # MySQL only.
2547
+ #
2548
+ # @overload truncate_log(request, options = nil)
2549
+ # Pass arguments to `truncate_log` via a request object, either of type
2550
+ # {::Google::Cloud::Sql::V1::SqlInstancesTruncateLogRequest} or an equivalent Hash.
2551
+ #
2552
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesTruncateLogRequest, ::Hash]
2553
+ # A request object representing the call parameters. Required. To specify no
2554
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2555
+ # @param options [::Gapic::CallOptions, ::Hash]
2556
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2557
+ #
2558
+ # @overload truncate_log(instance: nil, project: nil, body: nil)
2559
+ # Pass arguments to `truncate_log` via keyword arguments. Note that at
2560
+ # least one keyword argument is required. To specify no parameters, or to keep all
2561
+ # the default parameter values, pass an empty Hash as a request object (see above).
2562
+ #
2563
+ # @param instance [::String]
2564
+ # Cloud SQL instance ID. This does not include the project ID.
2565
+ # @param project [::String]
2566
+ # Project ID of the Cloud SQL project.
2567
+ # @param body [::Google::Cloud::Sql::V1::InstancesTruncateLogRequest, ::Hash]
2568
+ # @yield [result, operation] Access the result along with the TransportOperation object
2569
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
2570
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2571
+ #
2572
+ # @return [::Google::Cloud::Sql::V1::Operation]
2573
+ #
2574
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2575
+ #
2576
+ # @example Basic example
2577
+ # require "google/cloud/sql/v1"
2578
+ #
2579
+ # # Create a client object. The client can be reused for multiple calls.
2580
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
2581
+ #
2582
+ # # Create a request. To set request fields, pass in keyword arguments.
2583
+ # request = Google::Cloud::Sql::V1::SqlInstancesTruncateLogRequest.new
2584
+ #
2585
+ # # Call the truncate_log method.
2586
+ # result = client.truncate_log request
2587
+ #
2588
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2589
+ # p result
2590
+ #
2591
+ def truncate_log request, options = nil
2592
+ raise ::ArgumentError, "request must be provided" if request.nil?
2593
+
2594
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesTruncateLogRequest
2595
+
2596
+ # Converts hash and nil to an options object
2597
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2598
+
2599
+ # Customize the options with defaults
2600
+ call_metadata = @config.rpcs.truncate_log.metadata.to_h
2601
+
2602
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2603
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2604
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2605
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
2606
+ transports_version_send: [:rest]
2607
+
2608
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2609
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2610
+
2611
+ options.apply_defaults timeout: @config.rpcs.truncate_log.timeout,
2612
+ metadata: call_metadata,
2613
+ retry_policy: @config.rpcs.truncate_log.retry_policy
2614
+
2615
+ options.apply_defaults timeout: @config.timeout,
2616
+ metadata: @config.metadata,
2617
+ retry_policy: @config.retry_policy
2618
+
2619
+ @sql_instances_service_stub.truncate_log request, options do |result, operation|
2620
+ yield result, operation if block_given?
2621
+ end
2622
+ rescue ::Gapic::Rest::Error => e
2623
+ raise ::Google::Cloud::Error.from_error(e)
2624
+ end
2625
+
2626
+ ##
2627
+ # Updates settings of a Cloud SQL instance. Using this operation might cause
2628
+ # your instance to restart.
2629
+ #
2630
+ # @overload update(request, options = nil)
2631
+ # Pass arguments to `update` via a request object, either of type
2632
+ # {::Google::Cloud::Sql::V1::SqlInstancesUpdateRequest} or an equivalent Hash.
2633
+ #
2634
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesUpdateRequest, ::Hash]
2635
+ # A request object representing the call parameters. Required. To specify no
2636
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2637
+ # @param options [::Gapic::CallOptions, ::Hash]
2638
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2639
+ #
2640
+ # @overload update(instance: nil, project: nil, body: nil)
2641
+ # Pass arguments to `update` via keyword arguments. Note that at
2642
+ # least one keyword argument is required. To specify no parameters, or to keep all
2643
+ # the default parameter values, pass an empty Hash as a request object (see above).
2644
+ #
2645
+ # @param instance [::String]
2646
+ # Cloud SQL instance ID. This does not include the project ID.
2647
+ # @param project [::String]
2648
+ # Project ID of the project that contains the instance.
2649
+ # @param body [::Google::Cloud::Sql::V1::DatabaseInstance, ::Hash]
2650
+ # @yield [result, operation] Access the result along with the TransportOperation object
2651
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
2652
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2653
+ #
2654
+ # @return [::Google::Cloud::Sql::V1::Operation]
2655
+ #
2656
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2657
+ #
2658
+ # @example Basic example
2659
+ # require "google/cloud/sql/v1"
2660
+ #
2661
+ # # Create a client object. The client can be reused for multiple calls.
2662
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
2663
+ #
2664
+ # # Create a request. To set request fields, pass in keyword arguments.
2665
+ # request = Google::Cloud::Sql::V1::SqlInstancesUpdateRequest.new
2666
+ #
2667
+ # # Call the update method.
2668
+ # result = client.update request
2669
+ #
2670
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2671
+ # p result
2672
+ #
2673
+ def update request, options = nil
2674
+ raise ::ArgumentError, "request must be provided" if request.nil?
2675
+
2676
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesUpdateRequest
2677
+
2678
+ # Converts hash and nil to an options object
2679
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2680
+
2681
+ # Customize the options with defaults
2682
+ call_metadata = @config.rpcs.update.metadata.to_h
2683
+
2684
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2685
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2686
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2687
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
2688
+ transports_version_send: [:rest]
2689
+
2690
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2691
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2692
+
2693
+ options.apply_defaults timeout: @config.rpcs.update.timeout,
2694
+ metadata: call_metadata,
2695
+ retry_policy: @config.rpcs.update.retry_policy
2696
+
2697
+ options.apply_defaults timeout: @config.timeout,
2698
+ metadata: @config.metadata,
2699
+ retry_policy: @config.retry_policy
2700
+
2701
+ @sql_instances_service_stub.update request, options do |result, operation|
2702
+ yield result, operation if block_given?
2703
+ end
2704
+ rescue ::Gapic::Rest::Error => e
2705
+ raise ::Google::Cloud::Error.from_error(e)
2706
+ end
2707
+
2708
+ ##
2709
+ # Generates a short-lived X509 certificate containing the provided public key
2710
+ # and signed by a private key specific to the target instance. Users may use
2711
+ # the certificate to authenticate as themselves when connecting to the
2712
+ # database.
2713
+ #
2714
+ # @overload create_ephemeral(request, options = nil)
2715
+ # Pass arguments to `create_ephemeral` via a request object, either of type
2716
+ # {::Google::Cloud::Sql::V1::SqlInstancesCreateEphemeralCertRequest} or an equivalent Hash.
2717
+ #
2718
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesCreateEphemeralCertRequest, ::Hash]
2719
+ # A request object representing the call parameters. Required. To specify no
2720
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2721
+ # @param options [::Gapic::CallOptions, ::Hash]
2722
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2723
+ #
2724
+ # @overload create_ephemeral(instance: nil, project: nil, body: nil)
2725
+ # Pass arguments to `create_ephemeral` via keyword arguments. Note that at
2726
+ # least one keyword argument is required. To specify no parameters, or to keep all
2727
+ # the default parameter values, pass an empty Hash as a request object (see above).
2728
+ #
2729
+ # @param instance [::String]
2730
+ # Cloud SQL instance ID. This does not include the project ID.
2731
+ # @param project [::String]
2732
+ # Project ID of the Cloud SQL project.
2733
+ # @param body [::Google::Cloud::Sql::V1::SslCertsCreateEphemeralRequest, ::Hash]
2734
+ # @yield [result, operation] Access the result along with the TransportOperation object
2735
+ # @yieldparam result [::Google::Cloud::Sql::V1::SslCert]
2736
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2737
+ #
2738
+ # @return [::Google::Cloud::Sql::V1::SslCert]
2739
+ #
2740
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2741
+ #
2742
+ # @example Basic example
2743
+ # require "google/cloud/sql/v1"
2744
+ #
2745
+ # # Create a client object. The client can be reused for multiple calls.
2746
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
2747
+ #
2748
+ # # Create a request. To set request fields, pass in keyword arguments.
2749
+ # request = Google::Cloud::Sql::V1::SqlInstancesCreateEphemeralCertRequest.new
2750
+ #
2751
+ # # Call the create_ephemeral method.
2752
+ # result = client.create_ephemeral request
2753
+ #
2754
+ # # The returned object is of type Google::Cloud::Sql::V1::SslCert.
2755
+ # p result
2756
+ #
2757
+ def create_ephemeral request, options = nil
2758
+ raise ::ArgumentError, "request must be provided" if request.nil?
2759
+
2760
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesCreateEphemeralCertRequest
2761
+
2762
+ # Converts hash and nil to an options object
2763
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2764
+
2765
+ # Customize the options with defaults
2766
+ call_metadata = @config.rpcs.create_ephemeral.metadata.to_h
2767
+
2768
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2769
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2770
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2771
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
2772
+ transports_version_send: [:rest]
2773
+
2774
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2775
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2776
+
2777
+ options.apply_defaults timeout: @config.rpcs.create_ephemeral.timeout,
2778
+ metadata: call_metadata,
2779
+ retry_policy: @config.rpcs.create_ephemeral.retry_policy
2780
+
2781
+ options.apply_defaults timeout: @config.timeout,
2782
+ metadata: @config.metadata,
2783
+ retry_policy: @config.retry_policy
2784
+
2785
+ @sql_instances_service_stub.create_ephemeral request, options do |result, operation|
2786
+ yield result, operation if block_given?
2787
+ end
2788
+ rescue ::Gapic::Rest::Error => e
2789
+ raise ::Google::Cloud::Error.from_error(e)
2790
+ end
2791
+
2792
+ ##
2793
+ # Reschedules the maintenance on the given instance.
2794
+ #
2795
+ # @overload reschedule_maintenance(request, options = nil)
2796
+ # Pass arguments to `reschedule_maintenance` via a request object, either of type
2797
+ # {::Google::Cloud::Sql::V1::SqlInstancesRescheduleMaintenanceRequest} or an equivalent Hash.
2798
+ #
2799
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesRescheduleMaintenanceRequest, ::Hash]
2800
+ # A request object representing the call parameters. Required. To specify no
2801
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2802
+ # @param options [::Gapic::CallOptions, ::Hash]
2803
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2804
+ #
2805
+ # @overload reschedule_maintenance(instance: nil, project: nil, body: nil)
2806
+ # Pass arguments to `reschedule_maintenance` via keyword arguments. Note that at
2807
+ # least one keyword argument is required. To specify no parameters, or to keep all
2808
+ # the default parameter values, pass an empty Hash as a request object (see above).
2809
+ #
2810
+ # @param instance [::String]
2811
+ # Cloud SQL instance ID. This does not include the project ID.
2812
+ # @param project [::String]
2813
+ # ID of the project that contains the instance.
2814
+ # @param body [::Google::Cloud::Sql::V1::SqlInstancesRescheduleMaintenanceRequestBody, ::Hash]
2815
+ # @yield [result, operation] Access the result along with the TransportOperation object
2816
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
2817
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2818
+ #
2819
+ # @return [::Google::Cloud::Sql::V1::Operation]
2820
+ #
2821
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2822
+ #
2823
+ # @example Basic example
2824
+ # require "google/cloud/sql/v1"
2825
+ #
2826
+ # # Create a client object. The client can be reused for multiple calls.
2827
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
2828
+ #
2829
+ # # Create a request. To set request fields, pass in keyword arguments.
2830
+ # request = Google::Cloud::Sql::V1::SqlInstancesRescheduleMaintenanceRequest.new
2831
+ #
2832
+ # # Call the reschedule_maintenance method.
2833
+ # result = client.reschedule_maintenance request
2834
+ #
2835
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2836
+ # p result
2837
+ #
2838
+ def reschedule_maintenance request, options = nil
2839
+ raise ::ArgumentError, "request must be provided" if request.nil?
2840
+
2841
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesRescheduleMaintenanceRequest
2842
+
2843
+ # Converts hash and nil to an options object
2844
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2845
+
2846
+ # Customize the options with defaults
2847
+ call_metadata = @config.rpcs.reschedule_maintenance.metadata.to_h
2848
+
2849
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2850
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2851
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2852
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
2853
+ transports_version_send: [:rest]
2854
+
2855
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2856
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2857
+
2858
+ options.apply_defaults timeout: @config.rpcs.reschedule_maintenance.timeout,
2859
+ metadata: call_metadata,
2860
+ retry_policy: @config.rpcs.reschedule_maintenance.retry_policy
2861
+
2862
+ options.apply_defaults timeout: @config.timeout,
2863
+ metadata: @config.metadata,
2864
+ retry_policy: @config.retry_policy
2865
+
2866
+ @sql_instances_service_stub.reschedule_maintenance request, options do |result, operation|
2867
+ yield result, operation if block_given?
2868
+ end
2869
+ rescue ::Gapic::Rest::Error => e
2870
+ raise ::Google::Cloud::Error.from_error(e)
2871
+ end
2872
+
2873
+ ##
2874
+ # Verify External primary instance external sync settings.
2875
+ #
2876
+ # @overload verify_external_sync_settings(request, options = nil)
2877
+ # Pass arguments to `verify_external_sync_settings` via a request object, either of type
2878
+ # {::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest} or an equivalent Hash.
2879
+ #
2880
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest, ::Hash]
2881
+ # A request object representing the call parameters. Required. To specify no
2882
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2883
+ # @param options [::Gapic::CallOptions, ::Hash]
2884
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2885
+ #
2886
+ # @overload verify_external_sync_settings(instance: nil, project: nil, verify_connection_only: nil, sync_mode: nil, verify_replication_only: nil, mysql_sync_config: nil, migration_type: nil, sync_parallel_level: nil, selected_objects: nil)
2887
+ # Pass arguments to `verify_external_sync_settings` via keyword arguments. Note that at
2888
+ # least one keyword argument is required. To specify no parameters, or to keep all
2889
+ # the default parameter values, pass an empty Hash as a request object (see above).
2890
+ #
2891
+ # @param instance [::String]
2892
+ # Cloud SQL instance ID. This does not include the project ID.
2893
+ # @param project [::String]
2894
+ # Project ID of the project that contains the instance.
2895
+ # @param verify_connection_only [::Boolean]
2896
+ # Flag to enable verifying connection only
2897
+ # @param sync_mode [::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest::ExternalSyncMode]
2898
+ # External sync mode
2899
+ # @param verify_replication_only [::Boolean]
2900
+ # Optional. Flag to verify settings required by replication setup only
2901
+ # @param mysql_sync_config [::Google::Cloud::Sql::V1::MySqlSyncConfig, ::Hash]
2902
+ # Optional. MySQL-specific settings for start external sync.
2903
+ # @param migration_type [::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest::MigrationType]
2904
+ # Optional. MigrationType configures the migration to use physical files or
2905
+ # logical dump files. If not set, then the logical dump file configuration is
2906
+ # used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
2907
+ # @param sync_parallel_level [::Google::Cloud::Sql::V1::ExternalSyncParallelLevel]
2908
+ # Optional. Parallel level for initial data sync. Only applicable for
2909
+ # PostgreSQL.
2910
+ # @param selected_objects [::Array<::Google::Cloud::Sql::V1::ExternalSyncSelectedObject, ::Hash>]
2911
+ # Optional. Migrate only the specified objects from the source instance. If
2912
+ # this field is empty, then migrate all objects.
2913
+ # @yield [result, operation] Access the result along with the TransportOperation object
2914
+ # @yieldparam result [::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsResponse]
2915
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2916
+ #
2917
+ # @return [::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsResponse]
2918
+ #
2919
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2920
+ #
2921
+ # @example Basic example
2922
+ # require "google/cloud/sql/v1"
2923
+ #
2924
+ # # Create a client object. The client can be reused for multiple calls.
2925
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
2926
+ #
2927
+ # # Create a request. To set request fields, pass in keyword arguments.
2928
+ # request = Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest.new
2929
+ #
2930
+ # # Call the verify_external_sync_settings method.
2931
+ # result = client.verify_external_sync_settings request
2932
+ #
2933
+ # # The returned object is of type Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsResponse.
2934
+ # p result
2935
+ #
2936
+ def verify_external_sync_settings request, options = nil
2937
+ raise ::ArgumentError, "request must be provided" if request.nil?
2938
+
2939
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest
2940
+
2941
+ # Converts hash and nil to an options object
2942
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2943
+
2944
+ # Customize the options with defaults
2945
+ call_metadata = @config.rpcs.verify_external_sync_settings.metadata.to_h
2946
+
2947
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2948
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2949
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2950
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
2951
+ transports_version_send: [:rest]
2952
+
2953
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2954
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2955
+
2956
+ options.apply_defaults timeout: @config.rpcs.verify_external_sync_settings.timeout,
2957
+ metadata: call_metadata,
2958
+ retry_policy: @config.rpcs.verify_external_sync_settings.retry_policy
2959
+
2960
+ options.apply_defaults timeout: @config.timeout,
2961
+ metadata: @config.metadata,
2962
+ retry_policy: @config.retry_policy
2963
+
2964
+ @sql_instances_service_stub.verify_external_sync_settings request, options do |result, operation|
2965
+ yield result, operation if block_given?
2966
+ end
2967
+ rescue ::Gapic::Rest::Error => e
2968
+ raise ::Google::Cloud::Error.from_error(e)
2969
+ end
2970
+
2971
+ ##
2972
+ # Start External primary instance migration.
2973
+ #
2974
+ # @overload start_external_sync(request, options = nil)
2975
+ # Pass arguments to `start_external_sync` via a request object, either of type
2976
+ # {::Google::Cloud::Sql::V1::SqlInstancesStartExternalSyncRequest} or an equivalent Hash.
2977
+ #
2978
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesStartExternalSyncRequest, ::Hash]
2979
+ # A request object representing the call parameters. Required. To specify no
2980
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2981
+ # @param options [::Gapic::CallOptions, ::Hash]
2982
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2983
+ #
2984
+ # @overload start_external_sync(instance: nil, project: nil, sync_mode: nil, skip_verification: nil, mysql_sync_config: nil, sync_parallel_level: nil, migration_type: nil, replica_overwrite_enabled: nil)
2985
+ # Pass arguments to `start_external_sync` via keyword arguments. Note that at
2986
+ # least one keyword argument is required. To specify no parameters, or to keep all
2987
+ # the default parameter values, pass an empty Hash as a request object (see above).
2988
+ #
2989
+ # @param instance [::String]
2990
+ # Cloud SQL instance ID. This does not include the project ID.
2991
+ # @param project [::String]
2992
+ # ID of the project that contains the instance.
2993
+ # @param sync_mode [::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest::ExternalSyncMode]
2994
+ # External sync mode.
2995
+ # @param skip_verification [::Boolean]
2996
+ # Whether to skip the verification step (VESS).
2997
+ # @param mysql_sync_config [::Google::Cloud::Sql::V1::MySqlSyncConfig, ::Hash]
2998
+ # MySQL-specific settings for start external sync.
2999
+ # @param sync_parallel_level [::Google::Cloud::Sql::V1::ExternalSyncParallelLevel]
3000
+ # Optional. Parallel level for initial data sync. Currently only applicable
3001
+ # for MySQL.
3002
+ # @param migration_type [::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest::MigrationType]
3003
+ # Optional. MigrationType configures the migration to use physical files or
3004
+ # logical dump files. If not set, then the logical dump file configuration is
3005
+ # used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
3006
+ # @param replica_overwrite_enabled [::Boolean]
3007
+ # Optional. MySQL only. True if end-user has confirmed that this SES call
3008
+ # will wipe replica databases overlapping with the proposed selected_objects.
3009
+ # If this field is not set and there are both overlapping and additional
3010
+ # databases proposed, an error will be returned.
3011
+ # @yield [result, operation] Access the result along with the TransportOperation object
3012
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
3013
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3014
+ #
3015
+ # @return [::Google::Cloud::Sql::V1::Operation]
3016
+ #
3017
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3018
+ #
3019
+ # @example Basic example
3020
+ # require "google/cloud/sql/v1"
3021
+ #
3022
+ # # Create a client object. The client can be reused for multiple calls.
3023
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
3024
+ #
3025
+ # # Create a request. To set request fields, pass in keyword arguments.
3026
+ # request = Google::Cloud::Sql::V1::SqlInstancesStartExternalSyncRequest.new
3027
+ #
3028
+ # # Call the start_external_sync method.
3029
+ # result = client.start_external_sync request
3030
+ #
3031
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
3032
+ # p result
3033
+ #
3034
+ def start_external_sync request, options = nil
3035
+ raise ::ArgumentError, "request must be provided" if request.nil?
3036
+
3037
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesStartExternalSyncRequest
3038
+
3039
+ # Converts hash and nil to an options object
3040
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3041
+
3042
+ # Customize the options with defaults
3043
+ call_metadata = @config.rpcs.start_external_sync.metadata.to_h
3044
+
3045
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3046
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3047
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3048
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
3049
+ transports_version_send: [:rest]
3050
+
3051
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3052
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3053
+
3054
+ options.apply_defaults timeout: @config.rpcs.start_external_sync.timeout,
3055
+ metadata: call_metadata,
3056
+ retry_policy: @config.rpcs.start_external_sync.retry_policy
3057
+
3058
+ options.apply_defaults timeout: @config.timeout,
3059
+ metadata: @config.metadata,
3060
+ retry_policy: @config.retry_policy
3061
+
3062
+ @sql_instances_service_stub.start_external_sync request, options do |result, operation|
3063
+ yield result, operation if block_given?
3064
+ end
3065
+ rescue ::Gapic::Rest::Error => e
3066
+ raise ::Google::Cloud::Error.from_error(e)
3067
+ end
3068
+
3069
+ ##
3070
+ # Perform Disk Shrink on primary instance.
3071
+ #
3072
+ # @overload perform_disk_shrink(request, options = nil)
3073
+ # Pass arguments to `perform_disk_shrink` via a request object, either of type
3074
+ # {::Google::Cloud::Sql::V1::SqlInstancesPerformDiskShrinkRequest} or an equivalent Hash.
3075
+ #
3076
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesPerformDiskShrinkRequest, ::Hash]
3077
+ # A request object representing the call parameters. Required. To specify no
3078
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3079
+ # @param options [::Gapic::CallOptions, ::Hash]
3080
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3081
+ #
3082
+ # @overload perform_disk_shrink(instance: nil, project: nil, body: nil)
3083
+ # Pass arguments to `perform_disk_shrink` via keyword arguments. Note that at
3084
+ # least one keyword argument is required. To specify no parameters, or to keep all
3085
+ # the default parameter values, pass an empty Hash as a request object (see above).
3086
+ #
3087
+ # @param instance [::String]
3088
+ # Cloud SQL instance ID. This does not include the project ID.
3089
+ # @param project [::String]
3090
+ # Project ID of the project that contains the instance.
3091
+ # @param body [::Google::Cloud::Sql::V1::PerformDiskShrinkContext, ::Hash]
3092
+ # Perform disk shrink context.
3093
+ # @yield [result, operation] Access the result along with the TransportOperation object
3094
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
3095
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3096
+ #
3097
+ # @return [::Google::Cloud::Sql::V1::Operation]
3098
+ #
3099
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3100
+ #
3101
+ # @example Basic example
3102
+ # require "google/cloud/sql/v1"
3103
+ #
3104
+ # # Create a client object. The client can be reused for multiple calls.
3105
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
3106
+ #
3107
+ # # Create a request. To set request fields, pass in keyword arguments.
3108
+ # request = Google::Cloud::Sql::V1::SqlInstancesPerformDiskShrinkRequest.new
3109
+ #
3110
+ # # Call the perform_disk_shrink method.
3111
+ # result = client.perform_disk_shrink request
3112
+ #
3113
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
3114
+ # p result
3115
+ #
3116
+ def perform_disk_shrink request, options = nil
3117
+ raise ::ArgumentError, "request must be provided" if request.nil?
3118
+
3119
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesPerformDiskShrinkRequest
3120
+
3121
+ # Converts hash and nil to an options object
3122
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3123
+
3124
+ # Customize the options with defaults
3125
+ call_metadata = @config.rpcs.perform_disk_shrink.metadata.to_h
3126
+
3127
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3128
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3129
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3130
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
3131
+ transports_version_send: [:rest]
3132
+
3133
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3134
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3135
+
3136
+ options.apply_defaults timeout: @config.rpcs.perform_disk_shrink.timeout,
3137
+ metadata: call_metadata,
3138
+ retry_policy: @config.rpcs.perform_disk_shrink.retry_policy
3139
+
3140
+ options.apply_defaults timeout: @config.timeout,
3141
+ metadata: @config.metadata,
3142
+ retry_policy: @config.retry_policy
3143
+
3144
+ @sql_instances_service_stub.perform_disk_shrink request, options do |result, operation|
3145
+ yield result, operation if block_given?
3146
+ end
3147
+ rescue ::Gapic::Rest::Error => e
3148
+ raise ::Google::Cloud::Error.from_error(e)
3149
+ end
3150
+
3151
+ ##
3152
+ # Get Disk Shrink Config for a given instance.
3153
+ #
3154
+ # @overload get_disk_shrink_config(request, options = nil)
3155
+ # Pass arguments to `get_disk_shrink_config` via a request object, either of type
3156
+ # {::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigRequest} or an equivalent Hash.
3157
+ #
3158
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigRequest, ::Hash]
3159
+ # A request object representing the call parameters. Required. To specify no
3160
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3161
+ # @param options [::Gapic::CallOptions, ::Hash]
3162
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3163
+ #
3164
+ # @overload get_disk_shrink_config(instance: nil, project: nil)
3165
+ # Pass arguments to `get_disk_shrink_config` via keyword arguments. Note that at
3166
+ # least one keyword argument is required. To specify no parameters, or to keep all
3167
+ # the default parameter values, pass an empty Hash as a request object (see above).
3168
+ #
3169
+ # @param instance [::String]
3170
+ # Cloud SQL instance ID. This does not include the project ID.
3171
+ # @param project [::String]
3172
+ # Project ID of the project that contains the instance.
3173
+ # @yield [result, operation] Access the result along with the TransportOperation object
3174
+ # @yieldparam result [::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigResponse]
3175
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3176
+ #
3177
+ # @return [::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigResponse]
3178
+ #
3179
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3180
+ #
3181
+ # @example Basic example
3182
+ # require "google/cloud/sql/v1"
3183
+ #
3184
+ # # Create a client object. The client can be reused for multiple calls.
3185
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
3186
+ #
3187
+ # # Create a request. To set request fields, pass in keyword arguments.
3188
+ # request = Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigRequest.new
3189
+ #
3190
+ # # Call the get_disk_shrink_config method.
3191
+ # result = client.get_disk_shrink_config request
3192
+ #
3193
+ # # The returned object is of type Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigResponse.
3194
+ # p result
3195
+ #
3196
+ def get_disk_shrink_config request, options = nil
3197
+ raise ::ArgumentError, "request must be provided" if request.nil?
3198
+
3199
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigRequest
3200
+
3201
+ # Converts hash and nil to an options object
3202
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3203
+
3204
+ # Customize the options with defaults
3205
+ call_metadata = @config.rpcs.get_disk_shrink_config.metadata.to_h
3206
+
3207
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3208
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3209
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3210
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
3211
+ transports_version_send: [:rest]
3212
+
3213
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3214
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3215
+
3216
+ options.apply_defaults timeout: @config.rpcs.get_disk_shrink_config.timeout,
3217
+ metadata: call_metadata,
3218
+ retry_policy: @config.rpcs.get_disk_shrink_config.retry_policy
3219
+
3220
+ options.apply_defaults timeout: @config.timeout,
3221
+ metadata: @config.metadata,
3222
+ retry_policy: @config.retry_policy
3223
+
3224
+ @sql_instances_service_stub.get_disk_shrink_config request, options do |result, operation|
3225
+ yield result, operation if block_given?
3226
+ end
3227
+ rescue ::Gapic::Rest::Error => e
3228
+ raise ::Google::Cloud::Error.from_error(e)
3229
+ end
3230
+
3231
+ ##
3232
+ # Reset Replica Size to primary instance disk size.
3233
+ #
3234
+ # @overload reset_replica_size(request, options = nil)
3235
+ # Pass arguments to `reset_replica_size` via a request object, either of type
3236
+ # {::Google::Cloud::Sql::V1::SqlInstancesResetReplicaSizeRequest} or an equivalent Hash.
3237
+ #
3238
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesResetReplicaSizeRequest, ::Hash]
3239
+ # A request object representing the call parameters. Required. To specify no
3240
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3241
+ # @param options [::Gapic::CallOptions, ::Hash]
3242
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3243
+ #
3244
+ # @overload reset_replica_size(instance: nil, project: nil)
3245
+ # Pass arguments to `reset_replica_size` via keyword arguments. Note that at
3246
+ # least one keyword argument is required. To specify no parameters, or to keep all
3247
+ # the default parameter values, pass an empty Hash as a request object (see above).
3248
+ #
3249
+ # @param instance [::String]
3250
+ # Cloud SQL read replica instance name.
3251
+ # @param project [::String]
3252
+ # ID of the project that contains the read replica.
3253
+ # @yield [result, operation] Access the result along with the TransportOperation object
3254
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
3255
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3256
+ #
3257
+ # @return [::Google::Cloud::Sql::V1::Operation]
3258
+ #
3259
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3260
+ #
3261
+ # @example Basic example
3262
+ # require "google/cloud/sql/v1"
3263
+ #
3264
+ # # Create a client object. The client can be reused for multiple calls.
3265
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
3266
+ #
3267
+ # # Create a request. To set request fields, pass in keyword arguments.
3268
+ # request = Google::Cloud::Sql::V1::SqlInstancesResetReplicaSizeRequest.new
3269
+ #
3270
+ # # Call the reset_replica_size method.
3271
+ # result = client.reset_replica_size request
3272
+ #
3273
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
3274
+ # p result
3275
+ #
3276
+ def reset_replica_size request, options = nil
3277
+ raise ::ArgumentError, "request must be provided" if request.nil?
3278
+
3279
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesResetReplicaSizeRequest
3280
+
3281
+ # Converts hash and nil to an options object
3282
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3283
+
3284
+ # Customize the options with defaults
3285
+ call_metadata = @config.rpcs.reset_replica_size.metadata.to_h
3286
+
3287
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3288
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3289
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3290
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
3291
+ transports_version_send: [:rest]
3292
+
3293
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3294
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3295
+
3296
+ options.apply_defaults timeout: @config.rpcs.reset_replica_size.timeout,
3297
+ metadata: call_metadata,
3298
+ retry_policy: @config.rpcs.reset_replica_size.retry_policy
3299
+
3300
+ options.apply_defaults timeout: @config.timeout,
3301
+ metadata: @config.metadata,
3302
+ retry_policy: @config.retry_policy
3303
+
3304
+ @sql_instances_service_stub.reset_replica_size request, options do |result, operation|
3305
+ yield result, operation if block_given?
3306
+ end
3307
+ rescue ::Gapic::Rest::Error => e
3308
+ raise ::Google::Cloud::Error.from_error(e)
3309
+ end
3310
+
3311
+ ##
3312
+ # Get Latest Recovery Time for a given instance.
3313
+ #
3314
+ # @overload get_latest_recovery_time(request, options = nil)
3315
+ # Pass arguments to `get_latest_recovery_time` via a request object, either of type
3316
+ # {::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeRequest} or an equivalent Hash.
3317
+ #
3318
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeRequest, ::Hash]
3319
+ # A request object representing the call parameters. Required. To specify no
3320
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3321
+ # @param options [::Gapic::CallOptions, ::Hash]
3322
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3323
+ #
3324
+ # @overload get_latest_recovery_time(instance: nil, project: nil, source_instance_deletion_time: nil)
3325
+ # Pass arguments to `get_latest_recovery_time` via keyword arguments. Note that at
3326
+ # least one keyword argument is required. To specify no parameters, or to keep all
3327
+ # the default parameter values, pass an empty Hash as a request object (see above).
3328
+ #
3329
+ # @param instance [::String]
3330
+ # Cloud SQL instance ID. This does not include the project ID.
3331
+ # @param project [::String]
3332
+ # Project ID of the project that contains the instance.
3333
+ # @param source_instance_deletion_time [::Google::Protobuf::Timestamp, ::Hash]
3334
+ # The timestamp used to identify the time when the source instance is
3335
+ # deleted. If this instance is deleted, then you must set the timestamp.
3336
+ # @yield [result, operation] Access the result along with the TransportOperation object
3337
+ # @yieldparam result [::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeResponse]
3338
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3339
+ #
3340
+ # @return [::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeResponse]
3341
+ #
3342
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3343
+ #
3344
+ # @example Basic example
3345
+ # require "google/cloud/sql/v1"
3346
+ #
3347
+ # # Create a client object. The client can be reused for multiple calls.
3348
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
3349
+ #
3350
+ # # Create a request. To set request fields, pass in keyword arguments.
3351
+ # request = Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeRequest.new
3352
+ #
3353
+ # # Call the get_latest_recovery_time method.
3354
+ # result = client.get_latest_recovery_time request
3355
+ #
3356
+ # # The returned object is of type Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeResponse.
3357
+ # p result
3358
+ #
3359
+ def get_latest_recovery_time request, options = nil
3360
+ raise ::ArgumentError, "request must be provided" if request.nil?
3361
+
3362
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeRequest
3363
+
3364
+ # Converts hash and nil to an options object
3365
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3366
+
3367
+ # Customize the options with defaults
3368
+ call_metadata = @config.rpcs.get_latest_recovery_time.metadata.to_h
3369
+
3370
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3371
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3372
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3373
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
3374
+ transports_version_send: [:rest]
3375
+
3376
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3377
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3378
+
3379
+ options.apply_defaults timeout: @config.rpcs.get_latest_recovery_time.timeout,
3380
+ metadata: call_metadata,
3381
+ retry_policy: @config.rpcs.get_latest_recovery_time.retry_policy
3382
+
3383
+ options.apply_defaults timeout: @config.timeout,
3384
+ metadata: @config.metadata,
3385
+ retry_policy: @config.retry_policy
3386
+
3387
+ @sql_instances_service_stub.get_latest_recovery_time request, options do |result, operation|
3388
+ yield result, operation if block_given?
3389
+ end
3390
+ rescue ::Gapic::Rest::Error => e
3391
+ raise ::Google::Cloud::Error.from_error(e)
3392
+ end
3393
+
3394
+ ##
3395
+ # Execute SQL statements.
3396
+ #
3397
+ # @overload execute_sql(request, options = nil)
3398
+ # Pass arguments to `execute_sql` via a request object, either of type
3399
+ # {::Google::Cloud::Sql::V1::SqlInstancesExecuteSqlRequest} or an equivalent Hash.
3400
+ #
3401
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesExecuteSqlRequest, ::Hash]
3402
+ # A request object representing the call parameters. Required. To specify no
3403
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3404
+ # @param options [::Gapic::CallOptions, ::Hash]
3405
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3406
+ #
3407
+ # @overload execute_sql(instance: nil, project: nil, body: nil)
3408
+ # Pass arguments to `execute_sql` via keyword arguments. Note that at
3409
+ # least one keyword argument is required. To specify no parameters, or to keep all
3410
+ # the default parameter values, pass an empty Hash as a request object (see above).
3411
+ #
3412
+ # @param instance [::String]
3413
+ # Required. Database instance ID. This does not include the project ID.
3414
+ # @param project [::String]
3415
+ # Required. Project ID of the project that contains the instance.
3416
+ # @param body [::Google::Cloud::Sql::V1::ExecuteSqlPayload, ::Hash]
3417
+ # The request body.
3418
+ # @yield [result, operation] Access the result along with the TransportOperation object
3419
+ # @yieldparam result [::Google::Cloud::Sql::V1::SqlInstancesExecuteSqlResponse]
3420
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3421
+ #
3422
+ # @return [::Google::Cloud::Sql::V1::SqlInstancesExecuteSqlResponse]
3423
+ #
3424
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3425
+ #
3426
+ # @example Basic example
3427
+ # require "google/cloud/sql/v1"
3428
+ #
3429
+ # # Create a client object. The client can be reused for multiple calls.
3430
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
3431
+ #
3432
+ # # Create a request. To set request fields, pass in keyword arguments.
3433
+ # request = Google::Cloud::Sql::V1::SqlInstancesExecuteSqlRequest.new
3434
+ #
3435
+ # # Call the execute_sql method.
3436
+ # result = client.execute_sql request
3437
+ #
3438
+ # # The returned object is of type Google::Cloud::Sql::V1::SqlInstancesExecuteSqlResponse.
3439
+ # p result
3440
+ #
3441
+ def execute_sql request, options = nil
3442
+ raise ::ArgumentError, "request must be provided" if request.nil?
3443
+
3444
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesExecuteSqlRequest
3445
+
3446
+ # Converts hash and nil to an options object
3447
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3448
+
3449
+ # Customize the options with defaults
3450
+ call_metadata = @config.rpcs.execute_sql.metadata.to_h
3451
+
3452
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3453
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3454
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3455
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
3456
+ transports_version_send: [:rest]
3457
+
3458
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3459
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3460
+
3461
+ options.apply_defaults timeout: @config.rpcs.execute_sql.timeout,
3462
+ metadata: call_metadata,
3463
+ retry_policy: @config.rpcs.execute_sql.retry_policy
3464
+
3465
+ options.apply_defaults timeout: @config.timeout,
3466
+ metadata: @config.metadata,
3467
+ retry_policy: @config.retry_policy
3468
+
3469
+ @sql_instances_service_stub.execute_sql request, options do |result, operation|
3470
+ yield result, operation if block_given?
3471
+ end
3472
+ rescue ::Gapic::Rest::Error => e
3473
+ raise ::Google::Cloud::Error.from_error(e)
3474
+ end
3475
+
3476
+ ##
3477
+ # Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
3478
+ #
3479
+ # @overload acquire_ssrs_lease(request, options = nil)
3480
+ # Pass arguments to `acquire_ssrs_lease` via a request object, either of type
3481
+ # {::Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseRequest} or an equivalent Hash.
3482
+ #
3483
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseRequest, ::Hash]
3484
+ # A request object representing the call parameters. Required. To specify no
3485
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3486
+ # @param options [::Gapic::CallOptions, ::Hash]
3487
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3488
+ #
3489
+ # @overload acquire_ssrs_lease(instance: nil, project: nil, body: nil)
3490
+ # Pass arguments to `acquire_ssrs_lease` via keyword arguments. Note that at
3491
+ # least one keyword argument is required. To specify no parameters, or to keep all
3492
+ # the default parameter values, pass an empty Hash as a request object (see above).
3493
+ #
3494
+ # @param instance [::String]
3495
+ # Required. Cloud SQL instance ID. This doesn't include the project ID. It's
3496
+ # composed of lowercase letters, numbers, and hyphens, and it must start with
3497
+ # a letter. The total length must be 98 characters or less (Example:
3498
+ # instance-id).
3499
+ # @param project [::String]
3500
+ # Required. Project ID of the project that contains the instance (Example:
3501
+ # project-id).
3502
+ # @param body [::Google::Cloud::Sql::V1::InstancesAcquireSsrsLeaseRequest, ::Hash]
3503
+ # Required. The request body.
3504
+ # @yield [result, operation] Access the result along with the TransportOperation object
3505
+ # @yieldparam result [::Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseResponse]
3506
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3507
+ #
3508
+ # @return [::Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseResponse]
3509
+ #
3510
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3511
+ #
3512
+ # @example Basic example
3513
+ # require "google/cloud/sql/v1"
3514
+ #
3515
+ # # Create a client object. The client can be reused for multiple calls.
3516
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
3517
+ #
3518
+ # # Create a request. To set request fields, pass in keyword arguments.
3519
+ # request = Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseRequest.new
3520
+ #
3521
+ # # Call the acquire_ssrs_lease method.
3522
+ # result = client.acquire_ssrs_lease request
3523
+ #
3524
+ # # The returned object is of type Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseResponse.
3525
+ # p result
3526
+ #
3527
+ def acquire_ssrs_lease request, options = nil
3528
+ raise ::ArgumentError, "request must be provided" if request.nil?
3529
+
3530
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseRequest
3531
+
3532
+ # Converts hash and nil to an options object
3533
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3534
+
3535
+ # Customize the options with defaults
3536
+ call_metadata = @config.rpcs.acquire_ssrs_lease.metadata.to_h
3537
+
3538
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3539
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3540
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3541
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
3542
+ transports_version_send: [:rest]
3543
+
3544
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3545
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3546
+
3547
+ options.apply_defaults timeout: @config.rpcs.acquire_ssrs_lease.timeout,
3548
+ metadata: call_metadata,
3549
+ retry_policy: @config.rpcs.acquire_ssrs_lease.retry_policy
3550
+
3551
+ options.apply_defaults timeout: @config.timeout,
3552
+ metadata: @config.metadata,
3553
+ retry_policy: @config.retry_policy
3554
+
3555
+ @sql_instances_service_stub.acquire_ssrs_lease request, options do |result, operation|
3556
+ yield result, operation if block_given?
3557
+ end
3558
+ rescue ::Gapic::Rest::Error => e
3559
+ raise ::Google::Cloud::Error.from_error(e)
3560
+ end
3561
+
3562
+ ##
3563
+ # Release a lease for the setup of SQL Server Reporting Services (SSRS).
3564
+ #
3565
+ # @overload release_ssrs_lease(request, options = nil)
3566
+ # Pass arguments to `release_ssrs_lease` via a request object, either of type
3567
+ # {::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseRequest} or an equivalent Hash.
3568
+ #
3569
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseRequest, ::Hash]
3570
+ # A request object representing the call parameters. Required. To specify no
3571
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3572
+ # @param options [::Gapic::CallOptions, ::Hash]
3573
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3574
+ #
3575
+ # @overload release_ssrs_lease(instance: nil, project: nil)
3576
+ # Pass arguments to `release_ssrs_lease` via keyword arguments. Note that at
3577
+ # least one keyword argument is required. To specify no parameters, or to keep all
3578
+ # the default parameter values, pass an empty Hash as a request object (see above).
3579
+ #
3580
+ # @param instance [::String]
3581
+ # Required. The Cloud SQL instance ID. This doesn't include the project ID.
3582
+ # The instance ID contains lowercase letters, numbers, and hyphens, and it
3583
+ # must start with a letter. This ID can have a maximum length of 98
3584
+ # characters.
3585
+ # @param project [::String]
3586
+ # Required. The project ID that contains the instance.
3587
+ # @yield [result, operation] Access the result along with the TransportOperation object
3588
+ # @yieldparam result [::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseResponse]
3589
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3590
+ #
3591
+ # @return [::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseResponse]
3592
+ #
3593
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3594
+ #
3595
+ # @example Basic example
3596
+ # require "google/cloud/sql/v1"
3597
+ #
3598
+ # # Create a client object. The client can be reused for multiple calls.
3599
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
3600
+ #
3601
+ # # Create a request. To set request fields, pass in keyword arguments.
3602
+ # request = Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseRequest.new
3603
+ #
3604
+ # # Call the release_ssrs_lease method.
3605
+ # result = client.release_ssrs_lease request
3606
+ #
3607
+ # # The returned object is of type Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseResponse.
3608
+ # p result
3609
+ #
3610
+ def release_ssrs_lease request, options = nil
3611
+ raise ::ArgumentError, "request must be provided" if request.nil?
3612
+
3613
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseRequest
3614
+
3615
+ # Converts hash and nil to an options object
3616
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3617
+
3618
+ # Customize the options with defaults
3619
+ call_metadata = @config.rpcs.release_ssrs_lease.metadata.to_h
3620
+
3621
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3622
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3623
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3624
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
3625
+ transports_version_send: [:rest]
3626
+
3627
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3628
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3629
+
3630
+ options.apply_defaults timeout: @config.rpcs.release_ssrs_lease.timeout,
3631
+ metadata: call_metadata,
3632
+ retry_policy: @config.rpcs.release_ssrs_lease.retry_policy
3633
+
3634
+ options.apply_defaults timeout: @config.timeout,
3635
+ metadata: @config.metadata,
3636
+ retry_policy: @config.retry_policy
3637
+
3638
+ @sql_instances_service_stub.release_ssrs_lease request, options do |result, operation|
3639
+ yield result, operation if block_given?
3640
+ end
3641
+ rescue ::Gapic::Rest::Error => e
3642
+ raise ::Google::Cloud::Error.from_error(e)
3643
+ end
3644
+
3645
+ ##
3646
+ # Execute MVU Pre-checks
3647
+ #
3648
+ # @overload pre_check_major_version_upgrade(request, options = nil)
3649
+ # Pass arguments to `pre_check_major_version_upgrade` via a request object, either of type
3650
+ # {::Google::Cloud::Sql::V1::SqlInstancesPreCheckMajorVersionUpgradeRequest} or an equivalent Hash.
3651
+ #
3652
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesPreCheckMajorVersionUpgradeRequest, ::Hash]
3653
+ # A request object representing the call parameters. Required. To specify no
3654
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3655
+ # @param options [::Gapic::CallOptions, ::Hash]
3656
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3657
+ #
3658
+ # @overload pre_check_major_version_upgrade(instance: nil, project: nil, body: nil)
3659
+ # Pass arguments to `pre_check_major_version_upgrade` via keyword arguments. Note that at
3660
+ # least one keyword argument is required. To specify no parameters, or to keep all
3661
+ # the default parameter values, pass an empty Hash as a request object (see above).
3662
+ #
3663
+ # @param instance [::String]
3664
+ # Required. Cloud SQL instance ID. This does not include the project ID.
3665
+ # @param project [::String]
3666
+ # Required. Project ID of the project that contains the instance.
3667
+ # @param body [::Google::Cloud::Sql::V1::InstancesPreCheckMajorVersionUpgradeRequest, ::Hash]
3668
+ # Required. The context for request to perform the pre-check major version
3669
+ # upgrade operation.
3670
+ # @yield [result, operation] Access the result along with the TransportOperation object
3671
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
3672
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3673
+ #
3674
+ # @return [::Google::Cloud::Sql::V1::Operation]
3675
+ #
3676
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3677
+ #
3678
+ # @example Basic example
3679
+ # require "google/cloud/sql/v1"
3680
+ #
3681
+ # # Create a client object. The client can be reused for multiple calls.
3682
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
3683
+ #
3684
+ # # Create a request. To set request fields, pass in keyword arguments.
3685
+ # request = Google::Cloud::Sql::V1::SqlInstancesPreCheckMajorVersionUpgradeRequest.new
3686
+ #
3687
+ # # Call the pre_check_major_version_upgrade method.
3688
+ # result = client.pre_check_major_version_upgrade request
3689
+ #
3690
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
3691
+ # p result
3692
+ #
3693
+ def pre_check_major_version_upgrade request, options = nil
3694
+ raise ::ArgumentError, "request must be provided" if request.nil?
3695
+
3696
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesPreCheckMajorVersionUpgradeRequest
3697
+
3698
+ # Converts hash and nil to an options object
3699
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3700
+
3701
+ # Customize the options with defaults
3702
+ call_metadata = @config.rpcs.pre_check_major_version_upgrade.metadata.to_h
3703
+
3704
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3705
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3706
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3707
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
3708
+ transports_version_send: [:rest]
3709
+
3710
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3711
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3712
+
3713
+ options.apply_defaults timeout: @config.rpcs.pre_check_major_version_upgrade.timeout,
3714
+ metadata: call_metadata,
3715
+ retry_policy: @config.rpcs.pre_check_major_version_upgrade.retry_policy
3716
+
3717
+ options.apply_defaults timeout: @config.timeout,
3718
+ metadata: @config.metadata,
3719
+ retry_policy: @config.retry_policy
3720
+
3721
+ @sql_instances_service_stub.pre_check_major_version_upgrade request, options do |result, operation|
3722
+ yield result, operation if block_given?
3723
+ end
3724
+ rescue ::Gapic::Rest::Error => e
3725
+ raise ::Google::Cloud::Error.from_error(e)
3726
+ end
3727
+
3728
+ ##
3729
+ # Point in time restore for an instance managed by Google Cloud Backup and
3730
+ # Disaster Recovery.
3731
+ #
3732
+ # @overload point_in_time_restore(request, options = nil)
3733
+ # Pass arguments to `point_in_time_restore` via a request object, either of type
3734
+ # {::Google::Cloud::Sql::V1::SqlInstancesPointInTimeRestoreRequest} or an equivalent Hash.
3735
+ #
3736
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesPointInTimeRestoreRequest, ::Hash]
3737
+ # A request object representing the call parameters. Required. To specify no
3738
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3739
+ # @param options [::Gapic::CallOptions, ::Hash]
3740
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3741
+ #
3742
+ # @overload point_in_time_restore(parent: nil, context: nil)
3743
+ # Pass arguments to `point_in_time_restore` via keyword arguments. Note that at
3744
+ # least one keyword argument is required. To specify no parameters, or to keep all
3745
+ # the default parameter values, pass an empty Hash as a request object (see above).
3746
+ #
3747
+ # @param parent [::String]
3748
+ # Required. The parent resource where you created this instance.
3749
+ # Format: projects/\\{project}
3750
+ # @param context [::Google::Cloud::Sql::V1::PointInTimeRestoreContext, ::Hash]
3751
+ # Required. The context for request to perform a PITR on a Google Cloud
3752
+ # Backup and Disaster Recovery managed instance.
3753
+ # @yield [result, operation] Access the result along with the TransportOperation object
3754
+ # @yieldparam result [::Google::Cloud::Sql::V1::Operation]
3755
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3756
+ #
3757
+ # @return [::Google::Cloud::Sql::V1::Operation]
3758
+ #
3759
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3760
+ #
3761
+ # @example Basic example
3762
+ # require "google/cloud/sql/v1"
3763
+ #
3764
+ # # Create a client object. The client can be reused for multiple calls.
3765
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new
3766
+ #
3767
+ # # Create a request. To set request fields, pass in keyword arguments.
3768
+ # request = Google::Cloud::Sql::V1::SqlInstancesPointInTimeRestoreRequest.new
3769
+ #
3770
+ # # Call the point_in_time_restore method.
3771
+ # result = client.point_in_time_restore request
3772
+ #
3773
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
3774
+ # p result
3775
+ #
3776
+ def point_in_time_restore request, options = nil
3777
+ raise ::ArgumentError, "request must be provided" if request.nil?
3778
+
3779
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesPointInTimeRestoreRequest
3780
+
3781
+ # Converts hash and nil to an options object
3782
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3783
+
3784
+ # Customize the options with defaults
3785
+ call_metadata = @config.rpcs.point_in_time_restore.metadata.to_h
3786
+
3787
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3788
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3789
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3790
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION,
3791
+ transports_version_send: [:rest]
3792
+
3793
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3794
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3795
+
3796
+ options.apply_defaults timeout: @config.rpcs.point_in_time_restore.timeout,
3797
+ metadata: call_metadata,
3798
+ retry_policy: @config.rpcs.point_in_time_restore.retry_policy
3799
+
3800
+ options.apply_defaults timeout: @config.timeout,
3801
+ metadata: @config.metadata,
3802
+ retry_policy: @config.retry_policy
3803
+
3804
+ @sql_instances_service_stub.point_in_time_restore request, options do |result, operation|
3805
+ yield result, operation if block_given?
3806
+ end
3807
+ rescue ::Gapic::Rest::Error => e
3808
+ raise ::Google::Cloud::Error.from_error(e)
3809
+ end
3810
+
3811
+ ##
3812
+ # Configuration class for the SqlInstancesService REST API.
3813
+ #
3814
+ # This class represents the configuration for SqlInstancesService REST,
3815
+ # providing control over timeouts, retry behavior, logging, transport
3816
+ # parameters, and other low-level controls. Certain parameters can also be
3817
+ # applied individually to specific RPCs. See
3818
+ # {::Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client::Configuration::Rpcs}
3819
+ # for a list of RPCs that can be configured independently.
3820
+ #
3821
+ # Configuration can be applied globally to all clients, or to a single client
3822
+ # on construction.
3823
+ #
3824
+ # @example
3825
+ #
3826
+ # # Modify the global config, setting the timeout for
3827
+ # # add_server_ca to 20 seconds,
3828
+ # # and all remaining timeouts to 10 seconds.
3829
+ # ::Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.configure do |config|
3830
+ # config.timeout = 10.0
3831
+ # config.rpcs.add_server_ca.timeout = 20.0
3832
+ # end
3833
+ #
3834
+ # # Apply the above configuration only to a new client.
3835
+ # client = ::Google::Cloud::Sql::V1::SqlInstancesService::Rest::Client.new do |config|
3836
+ # config.timeout = 10.0
3837
+ # config.rpcs.add_server_ca.timeout = 20.0
3838
+ # end
3839
+ #
3840
+ # @!attribute [rw] endpoint
3841
+ # A custom service endpoint, as a hostname or hostname:port. The default is
3842
+ # nil, indicating to use the default endpoint in the current universe domain.
3843
+ # @return [::String,nil]
3844
+ # @!attribute [rw] credentials
3845
+ # Credentials to send with calls. You may provide any of the following types:
3846
+ # * (`String`) The path to a service account key file in JSON format
3847
+ # * (`Hash`) A service account key as a Hash
3848
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
3849
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
3850
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
3851
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
3852
+ # * (`nil`) indicating no credentials
3853
+ #
3854
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
3855
+ # external source for authentication to Google Cloud, you must validate it before
3856
+ # providing it to a Google API client library. Providing an unvalidated credential
3857
+ # configuration to Google APIs can compromise the security of your systems and data.
3858
+ # For more information, refer to [Validate credential configurations from external
3859
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
3860
+ # @return [::Object]
3861
+ # @!attribute [rw] scope
3862
+ # The OAuth scopes
3863
+ # @return [::Array<::String>]
3864
+ # @!attribute [rw] lib_name
3865
+ # The library name as recorded in instrumentation and logging
3866
+ # @return [::String]
3867
+ # @!attribute [rw] lib_version
3868
+ # The library version as recorded in instrumentation and logging
3869
+ # @return [::String]
3870
+ # @!attribute [rw] timeout
3871
+ # The call timeout in seconds.
3872
+ # @return [::Numeric]
3873
+ # @!attribute [rw] metadata
3874
+ # Additional headers to be sent with the call.
3875
+ # @return [::Hash{::Symbol=>::String}]
3876
+ # @!attribute [rw] retry_policy
3877
+ # The retry policy. The value is a hash with the following keys:
3878
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3879
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3880
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3881
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
3882
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3883
+ # trigger a retry.
3884
+ # @return [::Hash]
3885
+ # @!attribute [rw] quota_project
3886
+ # A separate project against which to charge quota.
3887
+ # @return [::String]
3888
+ # @!attribute [rw] universe_domain
3889
+ # The universe domain within which to make requests. This determines the
3890
+ # default endpoint URL. The default value of nil uses the environment
3891
+ # universe (usually the default "googleapis.com" universe).
3892
+ # @return [::String,nil]
3893
+ # @!attribute [rw] logger
3894
+ # A custom logger to use for request/response debug logging, or the value
3895
+ # `:default` (the default) to construct a default logger, or `nil` to
3896
+ # explicitly disable logging.
3897
+ # @return [::Logger,:default,nil]
3898
+ #
3899
+ class Configuration
3900
+ extend ::Gapic::Config
3901
+
3902
+ # @private
3903
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
3904
+ DEFAULT_ENDPOINT = "sqladmin.googleapis.com"
3905
+
3906
+ config_attr :endpoint, nil, ::String, nil
3907
+ config_attr :credentials, nil do |value|
3908
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
3909
+ allowed.any? { |klass| klass === value }
3910
+ end
3911
+ config_attr :scope, nil, ::String, ::Array, nil
3912
+ config_attr :lib_name, nil, ::String, nil
3913
+ config_attr :lib_version, nil, ::String, nil
3914
+ config_attr :timeout, nil, ::Numeric, nil
3915
+ config_attr :metadata, nil, ::Hash, nil
3916
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
3917
+ config_attr :quota_project, nil, ::String, nil
3918
+ config_attr :universe_domain, nil, ::String, nil
3919
+ config_attr :logger, :default, ::Logger, nil, :default
3920
+
3921
+ # @private
3922
+ def initialize parent_config = nil
3923
+ @parent_config = parent_config unless parent_config.nil?
3924
+
3925
+ yield self if block_given?
3926
+ end
3927
+
3928
+ ##
3929
+ # Configurations for individual RPCs
3930
+ # @return [Rpcs]
3931
+ #
3932
+ def rpcs
3933
+ @rpcs ||= begin
3934
+ parent_rpcs = nil
3935
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
3936
+ Rpcs.new parent_rpcs
3937
+ end
3938
+ end
3939
+
3940
+ ##
3941
+ # Configuration RPC class for the SqlInstancesService API.
3942
+ #
3943
+ # Includes fields providing the configuration for each RPC in this service.
3944
+ # Each configuration object is of type `Gapic::Config::Method` and includes
3945
+ # the following configuration fields:
3946
+ #
3947
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
3948
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
3949
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
3950
+ # include the following keys:
3951
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3952
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3953
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3954
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
3955
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3956
+ # trigger a retry.
3957
+ #
3958
+ class Rpcs
3959
+ ##
3960
+ # RPC-specific configuration for `add_server_ca`
3961
+ # @return [::Gapic::Config::Method]
3962
+ #
3963
+ attr_reader :add_server_ca
3964
+ ##
3965
+ # RPC-specific configuration for `add_server_certificate`
3966
+ # @return [::Gapic::Config::Method]
3967
+ #
3968
+ attr_reader :add_server_certificate
3969
+ ##
3970
+ # RPC-specific configuration for `add_entra_id_certificate`
3971
+ # @return [::Gapic::Config::Method]
3972
+ #
3973
+ attr_reader :add_entra_id_certificate
3974
+ ##
3975
+ # RPC-specific configuration for `call_clone`
3976
+ # @return [::Gapic::Config::Method]
3977
+ #
3978
+ attr_reader :call_clone
3979
+ ##
3980
+ # RPC-specific configuration for `delete`
3981
+ # @return [::Gapic::Config::Method]
3982
+ #
3983
+ attr_reader :delete
3984
+ ##
3985
+ # RPC-specific configuration for `demote_master`
3986
+ # @return [::Gapic::Config::Method]
3987
+ #
3988
+ attr_reader :demote_master
3989
+ ##
3990
+ # RPC-specific configuration for `demote`
3991
+ # @return [::Gapic::Config::Method]
3992
+ #
3993
+ attr_reader :demote
3994
+ ##
3995
+ # RPC-specific configuration for `export`
3996
+ # @return [::Gapic::Config::Method]
3997
+ #
3998
+ attr_reader :export
3999
+ ##
4000
+ # RPC-specific configuration for `failover`
4001
+ # @return [::Gapic::Config::Method]
4002
+ #
4003
+ attr_reader :failover
4004
+ ##
4005
+ # RPC-specific configuration for `reencrypt`
4006
+ # @return [::Gapic::Config::Method]
4007
+ #
4008
+ attr_reader :reencrypt
4009
+ ##
4010
+ # RPC-specific configuration for `get`
4011
+ # @return [::Gapic::Config::Method]
4012
+ #
4013
+ attr_reader :get
4014
+ ##
4015
+ # RPC-specific configuration for `import`
4016
+ # @return [::Gapic::Config::Method]
4017
+ #
4018
+ attr_reader :import
4019
+ ##
4020
+ # RPC-specific configuration for `insert`
4021
+ # @return [::Gapic::Config::Method]
4022
+ #
4023
+ attr_reader :insert
4024
+ ##
4025
+ # RPC-specific configuration for `list`
4026
+ # @return [::Gapic::Config::Method]
4027
+ #
4028
+ attr_reader :list
4029
+ ##
4030
+ # RPC-specific configuration for `list_server_cas`
4031
+ # @return [::Gapic::Config::Method]
4032
+ #
4033
+ attr_reader :list_server_cas
4034
+ ##
4035
+ # RPC-specific configuration for `list_server_certificates`
4036
+ # @return [::Gapic::Config::Method]
4037
+ #
4038
+ attr_reader :list_server_certificates
4039
+ ##
4040
+ # RPC-specific configuration for `list_entra_id_certificates`
4041
+ # @return [::Gapic::Config::Method]
4042
+ #
4043
+ attr_reader :list_entra_id_certificates
4044
+ ##
4045
+ # RPC-specific configuration for `patch`
4046
+ # @return [::Gapic::Config::Method]
4047
+ #
4048
+ attr_reader :patch
4049
+ ##
4050
+ # RPC-specific configuration for `promote_replica`
4051
+ # @return [::Gapic::Config::Method]
4052
+ #
4053
+ attr_reader :promote_replica
4054
+ ##
4055
+ # RPC-specific configuration for `switchover`
4056
+ # @return [::Gapic::Config::Method]
4057
+ #
4058
+ attr_reader :switchover
4059
+ ##
4060
+ # RPC-specific configuration for `reset_ssl_config`
4061
+ # @return [::Gapic::Config::Method]
4062
+ #
4063
+ attr_reader :reset_ssl_config
4064
+ ##
4065
+ # RPC-specific configuration for `restart`
4066
+ # @return [::Gapic::Config::Method]
4067
+ #
4068
+ attr_reader :restart
4069
+ ##
4070
+ # RPC-specific configuration for `restore_backup`
4071
+ # @return [::Gapic::Config::Method]
4072
+ #
4073
+ attr_reader :restore_backup
4074
+ ##
4075
+ # RPC-specific configuration for `rotate_server_ca`
4076
+ # @return [::Gapic::Config::Method]
4077
+ #
4078
+ attr_reader :rotate_server_ca
4079
+ ##
4080
+ # RPC-specific configuration for `rotate_server_certificate`
4081
+ # @return [::Gapic::Config::Method]
4082
+ #
4083
+ attr_reader :rotate_server_certificate
4084
+ ##
4085
+ # RPC-specific configuration for `rotate_entra_id_certificate`
4086
+ # @return [::Gapic::Config::Method]
4087
+ #
4088
+ attr_reader :rotate_entra_id_certificate
4089
+ ##
4090
+ # RPC-specific configuration for `start_replica`
4091
+ # @return [::Gapic::Config::Method]
4092
+ #
4093
+ attr_reader :start_replica
4094
+ ##
4095
+ # RPC-specific configuration for `stop_replica`
4096
+ # @return [::Gapic::Config::Method]
4097
+ #
4098
+ attr_reader :stop_replica
4099
+ ##
4100
+ # RPC-specific configuration for `truncate_log`
4101
+ # @return [::Gapic::Config::Method]
4102
+ #
4103
+ attr_reader :truncate_log
4104
+ ##
4105
+ # RPC-specific configuration for `update`
4106
+ # @return [::Gapic::Config::Method]
4107
+ #
4108
+ attr_reader :update
4109
+ ##
4110
+ # RPC-specific configuration for `create_ephemeral`
4111
+ # @return [::Gapic::Config::Method]
4112
+ #
4113
+ attr_reader :create_ephemeral
4114
+ ##
4115
+ # RPC-specific configuration for `reschedule_maintenance`
4116
+ # @return [::Gapic::Config::Method]
4117
+ #
4118
+ attr_reader :reschedule_maintenance
4119
+ ##
4120
+ # RPC-specific configuration for `verify_external_sync_settings`
4121
+ # @return [::Gapic::Config::Method]
4122
+ #
4123
+ attr_reader :verify_external_sync_settings
4124
+ ##
4125
+ # RPC-specific configuration for `start_external_sync`
4126
+ # @return [::Gapic::Config::Method]
4127
+ #
4128
+ attr_reader :start_external_sync
4129
+ ##
4130
+ # RPC-specific configuration for `perform_disk_shrink`
4131
+ # @return [::Gapic::Config::Method]
4132
+ #
4133
+ attr_reader :perform_disk_shrink
4134
+ ##
4135
+ # RPC-specific configuration for `get_disk_shrink_config`
4136
+ # @return [::Gapic::Config::Method]
4137
+ #
4138
+ attr_reader :get_disk_shrink_config
4139
+ ##
4140
+ # RPC-specific configuration for `reset_replica_size`
4141
+ # @return [::Gapic::Config::Method]
4142
+ #
4143
+ attr_reader :reset_replica_size
4144
+ ##
4145
+ # RPC-specific configuration for `get_latest_recovery_time`
4146
+ # @return [::Gapic::Config::Method]
4147
+ #
4148
+ attr_reader :get_latest_recovery_time
4149
+ ##
4150
+ # RPC-specific configuration for `execute_sql`
4151
+ # @return [::Gapic::Config::Method]
4152
+ #
4153
+ attr_reader :execute_sql
4154
+ ##
4155
+ # RPC-specific configuration for `acquire_ssrs_lease`
4156
+ # @return [::Gapic::Config::Method]
4157
+ #
4158
+ attr_reader :acquire_ssrs_lease
4159
+ ##
4160
+ # RPC-specific configuration for `release_ssrs_lease`
4161
+ # @return [::Gapic::Config::Method]
4162
+ #
4163
+ attr_reader :release_ssrs_lease
4164
+ ##
4165
+ # RPC-specific configuration for `pre_check_major_version_upgrade`
4166
+ # @return [::Gapic::Config::Method]
4167
+ #
4168
+ attr_reader :pre_check_major_version_upgrade
4169
+ ##
4170
+ # RPC-specific configuration for `point_in_time_restore`
4171
+ # @return [::Gapic::Config::Method]
4172
+ #
4173
+ attr_reader :point_in_time_restore
4174
+
4175
+ # @private
4176
+ def initialize parent_rpcs = nil
4177
+ add_server_ca_config = parent_rpcs.add_server_ca if parent_rpcs.respond_to? :add_server_ca
4178
+ @add_server_ca = ::Gapic::Config::Method.new add_server_ca_config
4179
+ add_server_certificate_config = parent_rpcs.add_server_certificate if parent_rpcs.respond_to? :add_server_certificate
4180
+ @add_server_certificate = ::Gapic::Config::Method.new add_server_certificate_config
4181
+ add_entra_id_certificate_config = parent_rpcs.add_entra_id_certificate if parent_rpcs.respond_to? :add_entra_id_certificate
4182
+ @add_entra_id_certificate = ::Gapic::Config::Method.new add_entra_id_certificate_config
4183
+ call_clone_config = parent_rpcs.call_clone if parent_rpcs.respond_to? :call_clone
4184
+ @call_clone = ::Gapic::Config::Method.new call_clone_config
4185
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
4186
+ @delete = ::Gapic::Config::Method.new delete_config
4187
+ demote_master_config = parent_rpcs.demote_master if parent_rpcs.respond_to? :demote_master
4188
+ @demote_master = ::Gapic::Config::Method.new demote_master_config
4189
+ demote_config = parent_rpcs.demote if parent_rpcs.respond_to? :demote
4190
+ @demote = ::Gapic::Config::Method.new demote_config
4191
+ export_config = parent_rpcs.export if parent_rpcs.respond_to? :export
4192
+ @export = ::Gapic::Config::Method.new export_config
4193
+ failover_config = parent_rpcs.failover if parent_rpcs.respond_to? :failover
4194
+ @failover = ::Gapic::Config::Method.new failover_config
4195
+ reencrypt_config = parent_rpcs.reencrypt if parent_rpcs.respond_to? :reencrypt
4196
+ @reencrypt = ::Gapic::Config::Method.new reencrypt_config
4197
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
4198
+ @get = ::Gapic::Config::Method.new get_config
4199
+ import_config = parent_rpcs.import if parent_rpcs.respond_to? :import
4200
+ @import = ::Gapic::Config::Method.new import_config
4201
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
4202
+ @insert = ::Gapic::Config::Method.new insert_config
4203
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
4204
+ @list = ::Gapic::Config::Method.new list_config
4205
+ list_server_cas_config = parent_rpcs.list_server_cas if parent_rpcs.respond_to? :list_server_cas
4206
+ @list_server_cas = ::Gapic::Config::Method.new list_server_cas_config
4207
+ list_server_certificates_config = parent_rpcs.list_server_certificates if parent_rpcs.respond_to? :list_server_certificates
4208
+ @list_server_certificates = ::Gapic::Config::Method.new list_server_certificates_config
4209
+ list_entra_id_certificates_config = parent_rpcs.list_entra_id_certificates if parent_rpcs.respond_to? :list_entra_id_certificates
4210
+ @list_entra_id_certificates = ::Gapic::Config::Method.new list_entra_id_certificates_config
4211
+ patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
4212
+ @patch = ::Gapic::Config::Method.new patch_config
4213
+ promote_replica_config = parent_rpcs.promote_replica if parent_rpcs.respond_to? :promote_replica
4214
+ @promote_replica = ::Gapic::Config::Method.new promote_replica_config
4215
+ switchover_config = parent_rpcs.switchover if parent_rpcs.respond_to? :switchover
4216
+ @switchover = ::Gapic::Config::Method.new switchover_config
4217
+ reset_ssl_config_config = parent_rpcs.reset_ssl_config if parent_rpcs.respond_to? :reset_ssl_config
4218
+ @reset_ssl_config = ::Gapic::Config::Method.new reset_ssl_config_config
4219
+ restart_config = parent_rpcs.restart if parent_rpcs.respond_to? :restart
4220
+ @restart = ::Gapic::Config::Method.new restart_config
4221
+ restore_backup_config = parent_rpcs.restore_backup if parent_rpcs.respond_to? :restore_backup
4222
+ @restore_backup = ::Gapic::Config::Method.new restore_backup_config
4223
+ rotate_server_ca_config = parent_rpcs.rotate_server_ca if parent_rpcs.respond_to? :rotate_server_ca
4224
+ @rotate_server_ca = ::Gapic::Config::Method.new rotate_server_ca_config
4225
+ rotate_server_certificate_config = parent_rpcs.rotate_server_certificate if parent_rpcs.respond_to? :rotate_server_certificate
4226
+ @rotate_server_certificate = ::Gapic::Config::Method.new rotate_server_certificate_config
4227
+ rotate_entra_id_certificate_config = parent_rpcs.rotate_entra_id_certificate if parent_rpcs.respond_to? :rotate_entra_id_certificate
4228
+ @rotate_entra_id_certificate = ::Gapic::Config::Method.new rotate_entra_id_certificate_config
4229
+ start_replica_config = parent_rpcs.start_replica if parent_rpcs.respond_to? :start_replica
4230
+ @start_replica = ::Gapic::Config::Method.new start_replica_config
4231
+ stop_replica_config = parent_rpcs.stop_replica if parent_rpcs.respond_to? :stop_replica
4232
+ @stop_replica = ::Gapic::Config::Method.new stop_replica_config
4233
+ truncate_log_config = parent_rpcs.truncate_log if parent_rpcs.respond_to? :truncate_log
4234
+ @truncate_log = ::Gapic::Config::Method.new truncate_log_config
4235
+ update_config = parent_rpcs.update if parent_rpcs.respond_to? :update
4236
+ @update = ::Gapic::Config::Method.new update_config
4237
+ create_ephemeral_config = parent_rpcs.create_ephemeral if parent_rpcs.respond_to? :create_ephemeral
4238
+ @create_ephemeral = ::Gapic::Config::Method.new create_ephemeral_config
4239
+ reschedule_maintenance_config = parent_rpcs.reschedule_maintenance if parent_rpcs.respond_to? :reschedule_maintenance
4240
+ @reschedule_maintenance = ::Gapic::Config::Method.new reschedule_maintenance_config
4241
+ verify_external_sync_settings_config = parent_rpcs.verify_external_sync_settings if parent_rpcs.respond_to? :verify_external_sync_settings
4242
+ @verify_external_sync_settings = ::Gapic::Config::Method.new verify_external_sync_settings_config
4243
+ start_external_sync_config = parent_rpcs.start_external_sync if parent_rpcs.respond_to? :start_external_sync
4244
+ @start_external_sync = ::Gapic::Config::Method.new start_external_sync_config
4245
+ perform_disk_shrink_config = parent_rpcs.perform_disk_shrink if parent_rpcs.respond_to? :perform_disk_shrink
4246
+ @perform_disk_shrink = ::Gapic::Config::Method.new perform_disk_shrink_config
4247
+ get_disk_shrink_config_config = parent_rpcs.get_disk_shrink_config if parent_rpcs.respond_to? :get_disk_shrink_config
4248
+ @get_disk_shrink_config = ::Gapic::Config::Method.new get_disk_shrink_config_config
4249
+ reset_replica_size_config = parent_rpcs.reset_replica_size if parent_rpcs.respond_to? :reset_replica_size
4250
+ @reset_replica_size = ::Gapic::Config::Method.new reset_replica_size_config
4251
+ get_latest_recovery_time_config = parent_rpcs.get_latest_recovery_time if parent_rpcs.respond_to? :get_latest_recovery_time
4252
+ @get_latest_recovery_time = ::Gapic::Config::Method.new get_latest_recovery_time_config
4253
+ execute_sql_config = parent_rpcs.execute_sql if parent_rpcs.respond_to? :execute_sql
4254
+ @execute_sql = ::Gapic::Config::Method.new execute_sql_config
4255
+ acquire_ssrs_lease_config = parent_rpcs.acquire_ssrs_lease if parent_rpcs.respond_to? :acquire_ssrs_lease
4256
+ @acquire_ssrs_lease = ::Gapic::Config::Method.new acquire_ssrs_lease_config
4257
+ release_ssrs_lease_config = parent_rpcs.release_ssrs_lease if parent_rpcs.respond_to? :release_ssrs_lease
4258
+ @release_ssrs_lease = ::Gapic::Config::Method.new release_ssrs_lease_config
4259
+ pre_check_major_version_upgrade_config = parent_rpcs.pre_check_major_version_upgrade if parent_rpcs.respond_to? :pre_check_major_version_upgrade
4260
+ @pre_check_major_version_upgrade = ::Gapic::Config::Method.new pre_check_major_version_upgrade_config
4261
+ point_in_time_restore_config = parent_rpcs.point_in_time_restore if parent_rpcs.respond_to? :point_in_time_restore
4262
+ @point_in_time_restore = ::Gapic::Config::Method.new point_in_time_restore_config
4263
+
4264
+ yield self if block_given?
4265
+ end
4266
+ end
4267
+ end
4268
+ end
4269
+ end
4270
+ end
4271
+ end
4272
+ end
4273
+ end
4274
+ end