google-cloud-sql-v1beta4 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 (108) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +153 -8
  5. data/lib/google/cloud/sql/v1beta4/cloud_sql_connect_pb.rb +35 -0
  6. data/lib/google/cloud/sql/v1beta4/cloud_sql_connect_services_pb.rb +53 -0
  7. data/lib/google/cloud/sql/v1beta4/cloud_sql_data_pb.rb +35 -0
  8. data/lib/google/cloud/sql/v1beta4/cloud_sql_data_services_pb.rb +80 -0
  9. data/lib/google/cloud/sql/v1beta4/cloud_sql_iam_policies_pb.rb +23 -0
  10. data/lib/google/cloud/sql/v1beta4/cloud_sql_iam_policies_services_pb.rb +29 -0
  11. data/lib/google/cloud/sql/v1beta4/cloud_sql_pb.rb +117 -0
  12. data/lib/google/cloud/sql/v1beta4/cloud_sql_resources_pb.rb +192 -0
  13. data/lib/google/cloud/sql/v1beta4/cloud_sql_services_pb.rb +325 -0
  14. data/lib/google/cloud/sql/v1beta4/cloud_sql_tiers_pb.rb +26 -0
  15. data/lib/google/cloud/sql/v1beta4/cloud_sql_tiers_services_pb.rb +46 -0
  16. data/lib/google/cloud/sql/v1beta4/cloud_sql_users_pb.rb +40 -0
  17. data/lib/google/cloud/sql/v1beta4/cloud_sql_users_services_pb.rb +52 -0
  18. data/lib/google/cloud/sql/v1beta4/rest.rb +46 -0
  19. data/lib/google/cloud/sql/v1beta4/sql_backup_runs_service/client.rb +807 -0
  20. data/lib/google/cloud/sql/v1beta4/sql_backup_runs_service/credentials.rb +48 -0
  21. data/lib/google/cloud/sql/v1beta4/sql_backup_runs_service/rest/client.rb +718 -0
  22. data/lib/google/cloud/sql/v1beta4/sql_backup_runs_service/rest/service_stub.rb +332 -0
  23. data/lib/google/cloud/sql/v1beta4/sql_backup_runs_service/rest.rb +49 -0
  24. data/lib/google/cloud/sql/v1beta4/sql_backup_runs_service.rb +52 -0
  25. data/lib/google/cloud/sql/v1beta4/sql_backups_service/client.rb +896 -0
  26. data/lib/google/cloud/sql/v1beta4/sql_backups_service/credentials.rb +48 -0
  27. data/lib/google/cloud/sql/v1beta4/sql_backups_service/paths.rb +83 -0
  28. data/lib/google/cloud/sql/v1beta4/sql_backups_service/rest/client.rb +818 -0
  29. data/lib/google/cloud/sql/v1beta4/sql_backups_service/rest/service_stub.rb +388 -0
  30. data/lib/google/cloud/sql/v1beta4/sql_backups_service/rest.rb +50 -0
  31. data/lib/google/cloud/sql/v1beta4/sql_backups_service.rb +53 -0
  32. data/lib/google/cloud/sql/v1beta4/sql_connect_service/client.rb +705 -0
  33. data/lib/google/cloud/sql/v1beta4/sql_connect_service/credentials.rb +48 -0
  34. data/lib/google/cloud/sql/v1beta4/sql_connect_service/rest/client.rb +632 -0
  35. data/lib/google/cloud/sql/v1beta4/sql_connect_service/rest/service_stub.rb +268 -0
  36. data/lib/google/cloud/sql/v1beta4/sql_connect_service/rest.rb +51 -0
  37. data/lib/google/cloud/sql/v1beta4/sql_connect_service.rb +54 -0
  38. data/lib/google/cloud/sql/v1beta4/sql_data_service/client.rb +520 -0
  39. data/lib/google/cloud/sql/v1beta4/sql_data_service/credentials.rb +48 -0
  40. data/lib/google/cloud/sql/v1beta4/sql_data_service/paths.rb +50 -0
  41. data/lib/google/cloud/sql/v1beta4/sql_data_service.rb +49 -0
  42. data/lib/google/cloud/sql/v1beta4/sql_databases_service/client.rb +1009 -0
  43. data/lib/google/cloud/sql/v1beta4/sql_databases_service/credentials.rb +48 -0
  44. data/lib/google/cloud/sql/v1beta4/sql_databases_service/rest/client.rb +894 -0
  45. data/lib/google/cloud/sql/v1beta4/sql_databases_service/rest/service_stub.rb +460 -0
  46. data/lib/google/cloud/sql/v1beta4/sql_databases_service/rest.rb +49 -0
  47. data/lib/google/cloud/sql/v1beta4/sql_databases_service.rb +52 -0
  48. data/lib/google/cloud/sql/v1beta4/sql_flags_service/client.rb +486 -0
  49. data/lib/google/cloud/sql/v1beta4/sql_flags_service/credentials.rb +48 -0
  50. data/lib/google/cloud/sql/v1beta4/sql_flags_service/rest/client.rb +444 -0
  51. data/lib/google/cloud/sql/v1beta4/sql_flags_service/rest/service_stub.rb +140 -0
  52. data/lib/google/cloud/sql/v1beta4/sql_flags_service/rest.rb +49 -0
  53. data/lib/google/cloud/sql/v1beta4/sql_flags_service.rb +52 -0
  54. data/lib/google/cloud/sql/v1beta4/sql_instances_service/client.rb +4745 -0
  55. data/lib/google/cloud/sql/v1beta4/sql_instances_service/credentials.rb +48 -0
  56. data/lib/google/cloud/sql/v1beta4/sql_instances_service/paths.rb +159 -0
  57. data/lib/google/cloud/sql/v1beta4/sql_instances_service/rest/client.rb +4281 -0
  58. data/lib/google/cloud/sql/v1beta4/sql_instances_service/rest/service_stub.rb +2769 -0
  59. data/lib/google/cloud/sql/v1beta4/sql_instances_service/rest.rb +50 -0
  60. data/lib/google/cloud/sql/v1beta4/sql_instances_service.rb +53 -0
  61. data/lib/google/cloud/sql/v1beta4/sql_operations_service/client.rb +699 -0
  62. data/lib/google/cloud/sql/v1beta4/sql_operations_service/credentials.rb +48 -0
  63. data/lib/google/cloud/sql/v1beta4/sql_operations_service/rest/client.rb +629 -0
  64. data/lib/google/cloud/sql/v1beta4/sql_operations_service/rest/service_stub.rb +266 -0
  65. data/lib/google/cloud/sql/v1beta4/sql_operations_service/rest.rb +49 -0
  66. data/lib/google/cloud/sql/v1beta4/sql_operations_service.rb +52 -0
  67. data/lib/google/cloud/sql/v1beta4/sql_ssl_certs_service/client.rb +802 -0
  68. data/lib/google/cloud/sql/v1beta4/sql_ssl_certs_service/credentials.rb +48 -0
  69. data/lib/google/cloud/sql/v1beta4/sql_ssl_certs_service/rest/client.rb +713 -0
  70. data/lib/google/cloud/sql/v1beta4/sql_ssl_certs_service/rest/service_stub.rb +332 -0
  71. data/lib/google/cloud/sql/v1beta4/sql_ssl_certs_service/rest.rb +49 -0
  72. data/lib/google/cloud/sql/v1beta4/sql_ssl_certs_service.rb +52 -0
  73. data/lib/google/cloud/sql/v1beta4/sql_tiers_service/client.rb +493 -0
  74. data/lib/google/cloud/sql/v1beta4/sql_tiers_service/credentials.rb +48 -0
  75. data/lib/google/cloud/sql/v1beta4/sql_tiers_service/rest/client.rb +443 -0
  76. data/lib/google/cloud/sql/v1beta4/sql_tiers_service/rest/service_stub.rb +142 -0
  77. data/lib/google/cloud/sql/v1beta4/sql_tiers_service/rest.rb +51 -0
  78. data/lib/google/cloud/sql/v1beta4/sql_tiers_service.rb +54 -0
  79. data/lib/google/cloud/sql/v1beta4/sql_users_service/client.rb +915 -0
  80. data/lib/google/cloud/sql/v1beta4/sql_users_service/credentials.rb +48 -0
  81. data/lib/google/cloud/sql/v1beta4/sql_users_service/rest/client.rb +819 -0
  82. data/lib/google/cloud/sql/v1beta4/sql_users_service/rest/service_stub.rb +394 -0
  83. data/lib/google/cloud/sql/v1beta4/sql_users_service/rest.rb +49 -0
  84. data/lib/google/cloud/sql/v1beta4/sql_users_service.rb +52 -0
  85. data/lib/google/cloud/sql/v1beta4/version.rb +7 -2
  86. data/lib/google/cloud/sql/v1beta4.rb +56 -0
  87. data/lib/google-cloud-sql-v1beta4.rb +21 -0
  88. data/proto_docs/README.md +4 -0
  89. data/proto_docs/google/api/client.rb +593 -0
  90. data/proto_docs/google/api/field_behavior.rb +85 -0
  91. data/proto_docs/google/api/field_info.rb +88 -0
  92. data/proto_docs/google/api/launch_stage.rb +71 -0
  93. data/proto_docs/google/api/resource.rb +227 -0
  94. data/proto_docs/google/cloud/sql/v1beta4/cloud_sql.rb +1329 -0
  95. data/proto_docs/google/cloud/sql/v1beta4/cloud_sql_connect.rb +207 -0
  96. data/proto_docs/google/cloud/sql/v1beta4/cloud_sql_data.rb +189 -0
  97. data/proto_docs/google/cloud/sql/v1beta4/cloud_sql_resources.rb +4489 -0
  98. data/proto_docs/google/cloud/sql/v1beta4/cloud_sql_tiers.rb +68 -0
  99. data/proto_docs/google/cloud/sql/v1beta4/cloud_sql_users.rb +308 -0
  100. data/proto_docs/google/protobuf/any.rb +145 -0
  101. data/proto_docs/google/protobuf/duration.rb +98 -0
  102. data/proto_docs/google/protobuf/empty.rb +34 -0
  103. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  104. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  105. data/proto_docs/google/protobuf/wrappers.rb +148 -0
  106. data/proto_docs/google/rpc/status.rb +48 -0
  107. data/proto_docs/google/type/interval.rb +45 -0
  108. metadata +153 -9
@@ -0,0 +1,4281 @@
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/v1beta4/cloud_sql_pb"
21
+ require "google/cloud/sql/v1beta4/sql_instances_service/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Sql
27
+ module V1beta4
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::V1beta4::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::V1beta4::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", "V1beta4"]
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::V1beta4::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::V1beta4::SqlInstancesService::Rest::Client.new
118
+ #
119
+ # # Create a client using a custom configuration
120
+ # client = ::Google::Cloud::Sql::V1beta4::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::V1beta4::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
+ # Add 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::V1beta4::SqlInstancesAddServerCaRequest} or an equivalent Hash.
207
+ #
208
+ # @param request [::Google::Cloud::Sql::V1beta4::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::V1beta4::Operation]
225
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
226
+ #
227
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
228
+ #
229
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
230
+ #
231
+ # @example Basic example
232
+ # require "google/cloud/sql/v1beta4"
233
+ #
234
+ # # Create a client object. The client can be reused for multiple calls.
235
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
236
+ #
237
+ # # Create a request. To set request fields, pass in keyword arguments.
238
+ # request = Google::Cloud::Sql::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::SqlInstancesAddServerCertificateRequest} or an equivalent Hash.
293
+ #
294
+ # @param request [::Google::Cloud::Sql::V1beta4::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
+ # Required. Cloud SQL instance ID. This does not include the project ID.
307
+ # @param project [::String]
308
+ # Required. 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::V1beta4::Operation]
311
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
312
+ #
313
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
314
+ #
315
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
316
+ #
317
+ # @example Basic example
318
+ # require "google/cloud/sql/v1beta4"
319
+ #
320
+ # # Create a client object. The client can be reused for multiple calls.
321
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
322
+ #
323
+ # # Create a request. To set request fields, pass in keyword arguments.
324
+ # request = Google::Cloud::Sql::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::SqlInstancesAddEntraIdCertificateRequest} or an equivalent Hash.
375
+ #
376
+ # @param request [::Google::Cloud::Sql::V1beta4::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::V1beta4::Operation]
393
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
394
+ #
395
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
396
+ #
397
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
398
+ #
399
+ # @example Basic example
400
+ # require "google/cloud/sql/v1beta4"
401
+ #
402
+ # # Create a client object. The client can be reused for multiple calls.
403
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
404
+ #
405
+ # # Create a request. To set request fields, pass in keyword arguments.
406
+ # request = Google::Cloud::Sql::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::SqlInstancesCloneRequest} or an equivalent Hash.
456
+ #
457
+ # @param request [::Google::Cloud::Sql::V1beta4::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
+ # The ID of the Cloud SQL instance to be cloned (source). This does not
470
+ # include the project ID.
471
+ # @param project [::String]
472
+ # Project ID of the source Cloud SQL instance.
473
+ # @param body [::Google::Cloud::Sql::V1beta4::InstancesCloneRequest, ::Hash]
474
+ # @yield [result, operation] Access the result along with the TransportOperation object
475
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
476
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
477
+ #
478
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
479
+ #
480
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
481
+ #
482
+ # @example Basic example
483
+ # require "google/cloud/sql/v1beta4"
484
+ #
485
+ # # Create a client object. The client can be reused for multiple calls.
486
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
487
+ #
488
+ # # Create a request. To set request fields, pass in keyword arguments.
489
+ # request = Google::Cloud::Sql::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::SqlInstancesDeleteRequest} or an equivalent Hash.
538
+ #
539
+ # @param request [::Google::Cloud::Sql::V1beta4::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::V1beta4::Operation]
569
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
570
+ #
571
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
572
+ #
573
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
574
+ #
575
+ # @example Basic example
576
+ # require "google/cloud/sql/v1beta4"
577
+ #
578
+ # # Create a client object. The client can be reused for multiple calls.
579
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
580
+ #
581
+ # # Create a request. To set request fields, pass in keyword arguments.
582
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesDeleteRequest.new
583
+ #
584
+ # # Call the delete method.
585
+ # result = client.delete request
586
+ #
587
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::SqlInstancesDemoteMasterRequest} or an equivalent Hash.
632
+ #
633
+ # @param request [::Google::Cloud::Sql::V1beta4::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::V1beta4::InstancesDemoteMasterRequest, ::Hash]
649
+ # @yield [result, operation] Access the result along with the TransportOperation object
650
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
651
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
652
+ #
653
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
654
+ #
655
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
656
+ #
657
+ # @example Basic example
658
+ # require "google/cloud/sql/v1beta4"
659
+ #
660
+ # # Create a client object. The client can be reused for multiple calls.
661
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
662
+ #
663
+ # # Create a request. To set request fields, pass in keyword arguments.
664
+ # request = Google::Cloud::Sql::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::SqlInstancesDemoteRequest} or an equivalent Hash.
714
+ #
715
+ # @param request [::Google::Cloud::Sql::V1beta4::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. The name of the Cloud SQL instance.
728
+ # @param project [::String]
729
+ # Required. The project ID of the project that contains the instance.
730
+ # @param body [::Google::Cloud::Sql::V1beta4::InstancesDemoteRequest, ::Hash]
731
+ # The request body.
732
+ # @yield [result, operation] Access the result along with the TransportOperation object
733
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
734
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
735
+ #
736
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
737
+ #
738
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
739
+ #
740
+ # @example Basic example
741
+ # require "google/cloud/sql/v1beta4"
742
+ #
743
+ # # Create a client object. The client can be reused for multiple calls.
744
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
745
+ #
746
+ # # Create a request. To set request fields, pass in keyword arguments.
747
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesDemoteRequest.new
748
+ #
749
+ # # Call the demote method.
750
+ # result = client.demote request
751
+ #
752
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::SqlInstancesExportRequest} or an equivalent Hash.
797
+ #
798
+ # @param request [::Google::Cloud::Sql::V1beta4::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
+ # The Cloud SQL instance ID. This doesn't 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::V1beta4::InstancesExportRequest, ::Hash]
814
+ # @yield [result, operation] Access the result along with the TransportOperation object
815
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
816
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
817
+ #
818
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
819
+ #
820
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
821
+ #
822
+ # @example Basic example
823
+ # require "google/cloud/sql/v1beta4"
824
+ #
825
+ # # Create a client object. The client can be reused for multiple calls.
826
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
827
+ #
828
+ # # Create a request. To set request fields, pass in keyword arguments.
829
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesExportRequest.new
830
+ #
831
+ # # Call the export method.
832
+ # result = client.export request
833
+ #
834
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::SqlInstancesFailoverRequest} or an equivalent Hash.
885
+ #
886
+ # @param request [::Google::Cloud::Sql::V1beta4::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::V1beta4::InstancesFailoverRequest, ::Hash]
902
+ # @yield [result, operation] Access the result along with the TransportOperation object
903
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
904
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
905
+ #
906
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
907
+ #
908
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
909
+ #
910
+ # @example Basic example
911
+ # require "google/cloud/sql/v1beta4"
912
+ #
913
+ # # Create a client object. The client can be reused for multiple calls.
914
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
915
+ #
916
+ # # Create a request. To set request fields, pass in keyword arguments.
917
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesFailoverRequest.new
918
+ #
919
+ # # Call the failover method.
920
+ # result = client.failover request
921
+ #
922
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::SqlInstancesReencryptRequest} or an equivalent Hash.
966
+ #
967
+ # @param request [::Google::Cloud::Sql::V1beta4::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::V1beta4::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::V1beta4::Operation]
986
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
987
+ #
988
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
989
+ #
990
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
991
+ #
992
+ # @example Basic example
993
+ # require "google/cloud/sql/v1beta4"
994
+ #
995
+ # # Create a client object. The client can be reused for multiple calls.
996
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
997
+ #
998
+ # # Create a request. To set request fields, pass in keyword arguments.
999
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesReencryptRequest.new
1000
+ #
1001
+ # # Call the reencrypt method.
1002
+ # result = client.reencrypt request
1003
+ #
1004
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::SqlInstancesGetRequest} or an equivalent Hash.
1048
+ #
1049
+ # @param request [::Google::Cloud::Sql::V1beta4::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
+ # Database instance ID. This does not include the project ID.
1062
+ # @param project [::String]
1063
+ # 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::V1beta4::DatabaseInstance]
1066
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1067
+ #
1068
+ # @return [::Google::Cloud::Sql::V1beta4::DatabaseInstance]
1069
+ #
1070
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1071
+ #
1072
+ # @example Basic example
1073
+ # require "google/cloud/sql/v1beta4"
1074
+ #
1075
+ # # Create a client object. The client can be reused for multiple calls.
1076
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
1077
+ #
1078
+ # # Create a request. To set request fields, pass in keyword arguments.
1079
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesGetRequest.new
1080
+ #
1081
+ # # Call the get method.
1082
+ # result = client.get request
1083
+ #
1084
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::SqlInstancesImportRequest} or an equivalent Hash.
1129
+ #
1130
+ # @param request [::Google::Cloud::Sql::V1beta4::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::V1beta4::InstancesImportRequest, ::Hash]
1146
+ # @yield [result, operation] Access the result along with the TransportOperation object
1147
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
1148
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1149
+ #
1150
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
1151
+ #
1152
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1153
+ #
1154
+ # @example Basic example
1155
+ # require "google/cloud/sql/v1beta4"
1156
+ #
1157
+ # # Create a client object. The client can be reused for multiple calls.
1158
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
1159
+ #
1160
+ # # Create a request. To set request fields, pass in keyword arguments.
1161
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesImportRequest.new
1162
+ #
1163
+ # # Call the import method.
1164
+ # result = client.import request
1165
+ #
1166
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::SqlInstancesInsertRequest} or an equivalent Hash.
1210
+ #
1211
+ # @param request [::Google::Cloud::Sql::V1beta4::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::V1beta4::DatabaseInstance, ::Hash]
1226
+ # @yield [result, operation] Access the result along with the TransportOperation object
1227
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
1228
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1229
+ #
1230
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
1231
+ #
1232
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1233
+ #
1234
+ # @example Basic example
1235
+ # require "google/cloud/sql/v1beta4"
1236
+ #
1237
+ # # Create a client object. The client can be reused for multiple calls.
1238
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
1239
+ #
1240
+ # # Create a request. To set request fields, pass in keyword arguments.
1241
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesInsertRequest.new
1242
+ #
1243
+ # # Call the insert method.
1244
+ # result = client.insert request
1245
+ #
1246
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::SqlInstancesListRequest} or an equivalent Hash.
1290
+ #
1291
+ # @param request [::Google::Cloud::Sql::V1beta4::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::V1beta4::InstancesListResponse]
1324
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1325
+ #
1326
+ # @return [::Google::Cloud::Sql::V1beta4::InstancesListResponse]
1327
+ #
1328
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1329
+ #
1330
+ # @example Basic example
1331
+ # require "google/cloud/sql/v1beta4"
1332
+ #
1333
+ # # Create a client object. The client can be reused for multiple calls.
1334
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
1335
+ #
1336
+ # # Create a request. To set request fields, pass in keyword arguments.
1337
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesListRequest.new
1338
+ #
1339
+ # # Call the list method.
1340
+ # result = client.list request
1341
+ #
1342
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::SqlInstancesListServerCasRequest} or an equivalent Hash.
1390
+ #
1391
+ # @param request [::Google::Cloud::Sql::V1beta4::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::V1beta4::InstancesListServerCasResponse]
1408
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1409
+ #
1410
+ # @return [::Google::Cloud::Sql::V1beta4::InstancesListServerCasResponse]
1411
+ #
1412
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1413
+ #
1414
+ # @example Basic example
1415
+ # require "google/cloud/sql/v1beta4"
1416
+ #
1417
+ # # Create a client object. The client can be reused for multiple calls.
1418
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
1419
+ #
1420
+ # # Create a request. To set request fields, pass in keyword arguments.
1421
+ # request = Google::Cloud::Sql::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::SqlInstancesListServerCertificatesRequest} or an equivalent Hash.
1475
+ #
1476
+ # @param request [::Google::Cloud::Sql::V1beta4::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::V1beta4::InstancesListServerCertificatesResponse]
1493
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1494
+ #
1495
+ # @return [::Google::Cloud::Sql::V1beta4::InstancesListServerCertificatesResponse]
1496
+ #
1497
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1498
+ #
1499
+ # @example Basic example
1500
+ # require "google/cloud/sql/v1beta4"
1501
+ #
1502
+ # # Create a client object. The client can be reused for multiple calls.
1503
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
1504
+ #
1505
+ # # Create a request. To set request fields, pass in keyword arguments.
1506
+ # request = Google::Cloud::Sql::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::SqlInstancesListEntraIdCertificatesRequest} or an equivalent Hash.
1558
+ #
1559
+ # @param request [::Google::Cloud::Sql::V1beta4::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::V1beta4::InstancesListEntraIdCertificatesResponse]
1576
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1577
+ #
1578
+ # @return [::Google::Cloud::Sql::V1beta4::InstancesListEntraIdCertificatesResponse]
1579
+ #
1580
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1581
+ #
1582
+ # @example Basic example
1583
+ # require "google/cloud/sql/v1beta4"
1584
+ #
1585
+ # # Create a client object. The client can be reused for multiple calls.
1586
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
1587
+ #
1588
+ # # Create a request. To set request fields, pass in keyword arguments.
1589
+ # request = Google::Cloud::Sql::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::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::V1beta4::SqlInstancesPatchRequest} or an equivalent Hash.
1639
+ #
1640
+ # @param request [::Google::Cloud::Sql::V1beta4::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, reconcile_psc_networking: nil, reconcile_psc_networking_force: 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 reconcile_psc_networking [::Boolean]
1656
+ # Optional. Set PSC config to the same value as the existing config to
1657
+ # reconcile the PSC networking.
1658
+ # @param reconcile_psc_networking_force [::Boolean]
1659
+ # Optional. Set PSC config to the same value as the existing config and force
1660
+ # reconcile the PSC networking.
1661
+ # @param body [::Google::Cloud::Sql::V1beta4::DatabaseInstance, ::Hash]
1662
+ # @yield [result, operation] Access the result along with the TransportOperation object
1663
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
1664
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1665
+ #
1666
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
1667
+ #
1668
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1669
+ #
1670
+ # @example Basic example
1671
+ # require "google/cloud/sql/v1beta4"
1672
+ #
1673
+ # # Create a client object. The client can be reused for multiple calls.
1674
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
1675
+ #
1676
+ # # Create a request. To set request fields, pass in keyword arguments.
1677
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesPatchRequest.new
1678
+ #
1679
+ # # Call the patch method.
1680
+ # result = client.patch request
1681
+ #
1682
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
1683
+ # p result
1684
+ #
1685
+ def patch request, options = nil
1686
+ raise ::ArgumentError, "request must be provided" if request.nil?
1687
+
1688
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesPatchRequest
1689
+
1690
+ # Converts hash and nil to an options object
1691
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1692
+
1693
+ # Customize the options with defaults
1694
+ call_metadata = @config.rpcs.patch.metadata.to_h
1695
+
1696
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1697
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1698
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1699
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
1700
+ transports_version_send: [:rest]
1701
+
1702
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1703
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1704
+
1705
+ options.apply_defaults timeout: @config.rpcs.patch.timeout,
1706
+ metadata: call_metadata,
1707
+ retry_policy: @config.rpcs.patch.retry_policy
1708
+
1709
+ options.apply_defaults timeout: @config.timeout,
1710
+ metadata: @config.metadata,
1711
+ retry_policy: @config.retry_policy
1712
+
1713
+ @sql_instances_service_stub.patch request, options do |result, operation|
1714
+ yield result, operation if block_given?
1715
+ end
1716
+ rescue ::Gapic::Rest::Error => e
1717
+ raise ::Google::Cloud::Error.from_error(e)
1718
+ end
1719
+
1720
+ ##
1721
+ # Promotes the read replica instance to be an independent Cloud SQL
1722
+ # primary instance.
1723
+ # Using this operation might cause your instance to restart.
1724
+ #
1725
+ # @overload promote_replica(request, options = nil)
1726
+ # Pass arguments to `promote_replica` via a request object, either of type
1727
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesPromoteReplicaRequest} or an equivalent Hash.
1728
+ #
1729
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesPromoteReplicaRequest, ::Hash]
1730
+ # A request object representing the call parameters. Required. To specify no
1731
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1732
+ # @param options [::Gapic::CallOptions, ::Hash]
1733
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1734
+ #
1735
+ # @overload promote_replica(instance: nil, project: nil, failover: nil)
1736
+ # Pass arguments to `promote_replica` via keyword arguments. Note that at
1737
+ # least one keyword argument is required. To specify no parameters, or to keep all
1738
+ # the default parameter values, pass an empty Hash as a request object (see above).
1739
+ #
1740
+ # @param instance [::String]
1741
+ # Cloud SQL read replica instance name.
1742
+ # @param project [::String]
1743
+ # ID of the project that contains the read replica.
1744
+ # @param failover [::Boolean]
1745
+ # Set to true to invoke a replica failover to the DR replica.
1746
+ # As part of replica failover, the promote operation attempts
1747
+ # to add the original primary instance as a replica of the promoted
1748
+ # DR replica when the original primary instance comes back online.
1749
+ # If set to false or not specified, then the original primary
1750
+ # instance becomes an independent Cloud SQL primary instance.
1751
+ # @yield [result, operation] Access the result along with the TransportOperation object
1752
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
1753
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1754
+ #
1755
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
1756
+ #
1757
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1758
+ #
1759
+ # @example Basic example
1760
+ # require "google/cloud/sql/v1beta4"
1761
+ #
1762
+ # # Create a client object. The client can be reused for multiple calls.
1763
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
1764
+ #
1765
+ # # Create a request. To set request fields, pass in keyword arguments.
1766
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesPromoteReplicaRequest.new
1767
+ #
1768
+ # # Call the promote_replica method.
1769
+ # result = client.promote_replica request
1770
+ #
1771
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
1772
+ # p result
1773
+ #
1774
+ def promote_replica request, options = nil
1775
+ raise ::ArgumentError, "request must be provided" if request.nil?
1776
+
1777
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesPromoteReplicaRequest
1778
+
1779
+ # Converts hash and nil to an options object
1780
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1781
+
1782
+ # Customize the options with defaults
1783
+ call_metadata = @config.rpcs.promote_replica.metadata.to_h
1784
+
1785
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1786
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1787
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1788
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
1789
+ transports_version_send: [:rest]
1790
+
1791
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1792
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1793
+
1794
+ options.apply_defaults timeout: @config.rpcs.promote_replica.timeout,
1795
+ metadata: call_metadata,
1796
+ retry_policy: @config.rpcs.promote_replica.retry_policy
1797
+
1798
+ options.apply_defaults timeout: @config.timeout,
1799
+ metadata: @config.metadata,
1800
+ retry_policy: @config.retry_policy
1801
+
1802
+ @sql_instances_service_stub.promote_replica request, options do |result, operation|
1803
+ yield result, operation if block_given?
1804
+ end
1805
+ rescue ::Gapic::Rest::Error => e
1806
+ raise ::Google::Cloud::Error.from_error(e)
1807
+ end
1808
+
1809
+ ##
1810
+ # Switches over from the primary instance to the DR replica
1811
+ # instance.
1812
+ #
1813
+ # @overload switchover(request, options = nil)
1814
+ # Pass arguments to `switchover` via a request object, either of type
1815
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesSwitchoverRequest} or an equivalent Hash.
1816
+ #
1817
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesSwitchoverRequest, ::Hash]
1818
+ # A request object representing the call parameters. Required. To specify no
1819
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1820
+ # @param options [::Gapic::CallOptions, ::Hash]
1821
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1822
+ #
1823
+ # @overload switchover(instance: nil, project: nil, db_timeout: nil)
1824
+ # Pass arguments to `switchover` via keyword arguments. Note that at
1825
+ # least one keyword argument is required. To specify no parameters, or to keep all
1826
+ # the default parameter values, pass an empty Hash as a request object (see above).
1827
+ #
1828
+ # @param instance [::String]
1829
+ # Cloud SQL read replica instance name.
1830
+ # @param project [::String]
1831
+ # ID of the project that contains the replica.
1832
+ # @param db_timeout [::Google::Protobuf::Duration, ::Hash]
1833
+ # Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
1834
+ # timeout, which is a sum of all database operations. Default value is 10
1835
+ # minutes and can be modified to a maximum value of 24 hours.
1836
+ # @yield [result, operation] Access the result along with the TransportOperation object
1837
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
1838
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1839
+ #
1840
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
1841
+ #
1842
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1843
+ #
1844
+ # @example Basic example
1845
+ # require "google/cloud/sql/v1beta4"
1846
+ #
1847
+ # # Create a client object. The client can be reused for multiple calls.
1848
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
1849
+ #
1850
+ # # Create a request. To set request fields, pass in keyword arguments.
1851
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesSwitchoverRequest.new
1852
+ #
1853
+ # # Call the switchover method.
1854
+ # result = client.switchover request
1855
+ #
1856
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
1857
+ # p result
1858
+ #
1859
+ def switchover request, options = nil
1860
+ raise ::ArgumentError, "request must be provided" if request.nil?
1861
+
1862
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesSwitchoverRequest
1863
+
1864
+ # Converts hash and nil to an options object
1865
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1866
+
1867
+ # Customize the options with defaults
1868
+ call_metadata = @config.rpcs.switchover.metadata.to_h
1869
+
1870
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1871
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1872
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1873
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
1874
+ transports_version_send: [:rest]
1875
+
1876
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1877
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1878
+
1879
+ options.apply_defaults timeout: @config.rpcs.switchover.timeout,
1880
+ metadata: call_metadata,
1881
+ retry_policy: @config.rpcs.switchover.retry_policy
1882
+
1883
+ options.apply_defaults timeout: @config.timeout,
1884
+ metadata: @config.metadata,
1885
+ retry_policy: @config.retry_policy
1886
+
1887
+ @sql_instances_service_stub.switchover request, options do |result, operation|
1888
+ yield result, operation if block_given?
1889
+ end
1890
+ rescue ::Gapic::Rest::Error => e
1891
+ raise ::Google::Cloud::Error.from_error(e)
1892
+ end
1893
+
1894
+ ##
1895
+ # Deletes all client certificates and generates a new server SSL certificate
1896
+ # for the instance.
1897
+ #
1898
+ # @overload reset_ssl_config(request, options = nil)
1899
+ # Pass arguments to `reset_ssl_config` via a request object, either of type
1900
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesResetSslConfigRequest} or an equivalent Hash.
1901
+ #
1902
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesResetSslConfigRequest, ::Hash]
1903
+ # A request object representing the call parameters. Required. To specify no
1904
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1905
+ # @param options [::Gapic::CallOptions, ::Hash]
1906
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1907
+ #
1908
+ # @overload reset_ssl_config(instance: nil, project: nil, mode: nil)
1909
+ # Pass arguments to `reset_ssl_config` via keyword arguments. Note that at
1910
+ # least one keyword argument is required. To specify no parameters, or to keep all
1911
+ # the default parameter values, pass an empty Hash as a request object (see above).
1912
+ #
1913
+ # @param instance [::String]
1914
+ # Cloud SQL instance ID. This does not include the project ID.
1915
+ # @param project [::String]
1916
+ # Project ID of the project that contains the instance.
1917
+ # @param mode [::Google::Cloud::Sql::V1beta4::SqlInstancesResetSslConfigRequest::ResetSslMode]
1918
+ # Optional. Reset SSL mode to use.
1919
+ # @yield [result, operation] Access the result along with the TransportOperation object
1920
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
1921
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1922
+ #
1923
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
1924
+ #
1925
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1926
+ #
1927
+ # @example Basic example
1928
+ # require "google/cloud/sql/v1beta4"
1929
+ #
1930
+ # # Create a client object. The client can be reused for multiple calls.
1931
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
1932
+ #
1933
+ # # Create a request. To set request fields, pass in keyword arguments.
1934
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesResetSslConfigRequest.new
1935
+ #
1936
+ # # Call the reset_ssl_config method.
1937
+ # result = client.reset_ssl_config request
1938
+ #
1939
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
1940
+ # p result
1941
+ #
1942
+ def reset_ssl_config request, options = nil
1943
+ raise ::ArgumentError, "request must be provided" if request.nil?
1944
+
1945
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesResetSslConfigRequest
1946
+
1947
+ # Converts hash and nil to an options object
1948
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1949
+
1950
+ # Customize the options with defaults
1951
+ call_metadata = @config.rpcs.reset_ssl_config.metadata.to_h
1952
+
1953
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1954
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1955
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1956
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
1957
+ transports_version_send: [:rest]
1958
+
1959
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1960
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1961
+
1962
+ options.apply_defaults timeout: @config.rpcs.reset_ssl_config.timeout,
1963
+ metadata: call_metadata,
1964
+ retry_policy: @config.rpcs.reset_ssl_config.retry_policy
1965
+
1966
+ options.apply_defaults timeout: @config.timeout,
1967
+ metadata: @config.metadata,
1968
+ retry_policy: @config.retry_policy
1969
+
1970
+ @sql_instances_service_stub.reset_ssl_config request, options do |result, operation|
1971
+ yield result, operation if block_given?
1972
+ end
1973
+ rescue ::Gapic::Rest::Error => e
1974
+ raise ::Google::Cloud::Error.from_error(e)
1975
+ end
1976
+
1977
+ ##
1978
+ # Restarts a Cloud SQL instance.
1979
+ #
1980
+ # @overload restart(request, options = nil)
1981
+ # Pass arguments to `restart` via a request object, either of type
1982
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesRestartRequest} or an equivalent Hash.
1983
+ #
1984
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesRestartRequest, ::Hash]
1985
+ # A request object representing the call parameters. Required. To specify no
1986
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1987
+ # @param options [::Gapic::CallOptions, ::Hash]
1988
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1989
+ #
1990
+ # @overload restart(instance: nil, project: nil)
1991
+ # Pass arguments to `restart` via keyword arguments. Note that at
1992
+ # least one keyword argument is required. To specify no parameters, or to keep all
1993
+ # the default parameter values, pass an empty Hash as a request object (see above).
1994
+ #
1995
+ # @param instance [::String]
1996
+ # Cloud SQL instance ID. This does not include the project ID.
1997
+ # @param project [::String]
1998
+ # Project ID of the project that contains the instance to be restarted.
1999
+ # @yield [result, operation] Access the result along with the TransportOperation object
2000
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
2001
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2002
+ #
2003
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
2004
+ #
2005
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2006
+ #
2007
+ # @example Basic example
2008
+ # require "google/cloud/sql/v1beta4"
2009
+ #
2010
+ # # Create a client object. The client can be reused for multiple calls.
2011
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
2012
+ #
2013
+ # # Create a request. To set request fields, pass in keyword arguments.
2014
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesRestartRequest.new
2015
+ #
2016
+ # # Call the restart method.
2017
+ # result = client.restart request
2018
+ #
2019
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
2020
+ # p result
2021
+ #
2022
+ def restart request, options = nil
2023
+ raise ::ArgumentError, "request must be provided" if request.nil?
2024
+
2025
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesRestartRequest
2026
+
2027
+ # Converts hash and nil to an options object
2028
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2029
+
2030
+ # Customize the options with defaults
2031
+ call_metadata = @config.rpcs.restart.metadata.to_h
2032
+
2033
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2034
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2035
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2036
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
2037
+ transports_version_send: [:rest]
2038
+
2039
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2040
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2041
+
2042
+ options.apply_defaults timeout: @config.rpcs.restart.timeout,
2043
+ metadata: call_metadata,
2044
+ retry_policy: @config.rpcs.restart.retry_policy
2045
+
2046
+ options.apply_defaults timeout: @config.timeout,
2047
+ metadata: @config.metadata,
2048
+ retry_policy: @config.retry_policy
2049
+
2050
+ @sql_instances_service_stub.restart request, options do |result, operation|
2051
+ yield result, operation if block_given?
2052
+ end
2053
+ rescue ::Gapic::Rest::Error => e
2054
+ raise ::Google::Cloud::Error.from_error(e)
2055
+ end
2056
+
2057
+ ##
2058
+ # Restores a backup of a Cloud SQL instance. Using this operation might cause
2059
+ # your instance to restart.
2060
+ #
2061
+ # @overload restore_backup(request, options = nil)
2062
+ # Pass arguments to `restore_backup` via a request object, either of type
2063
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesRestoreBackupRequest} or an equivalent Hash.
2064
+ #
2065
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesRestoreBackupRequest, ::Hash]
2066
+ # A request object representing the call parameters. Required. To specify no
2067
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2068
+ # @param options [::Gapic::CallOptions, ::Hash]
2069
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2070
+ #
2071
+ # @overload restore_backup(instance: nil, project: nil, body: nil)
2072
+ # Pass arguments to `restore_backup` via keyword arguments. Note that at
2073
+ # least one keyword argument is required. To specify no parameters, or to keep all
2074
+ # the default parameter values, pass an empty Hash as a request object (see above).
2075
+ #
2076
+ # @param instance [::String]
2077
+ # Cloud SQL instance ID. This does not include the project ID.
2078
+ # @param project [::String]
2079
+ # Project ID of the project that contains the instance.
2080
+ # @param body [::Google::Cloud::Sql::V1beta4::InstancesRestoreBackupRequest, ::Hash]
2081
+ # @yield [result, operation] Access the result along with the TransportOperation object
2082
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
2083
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2084
+ #
2085
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
2086
+ #
2087
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2088
+ #
2089
+ # @example Basic example
2090
+ # require "google/cloud/sql/v1beta4"
2091
+ #
2092
+ # # Create a client object. The client can be reused for multiple calls.
2093
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
2094
+ #
2095
+ # # Create a request. To set request fields, pass in keyword arguments.
2096
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesRestoreBackupRequest.new
2097
+ #
2098
+ # # Call the restore_backup method.
2099
+ # result = client.restore_backup request
2100
+ #
2101
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
2102
+ # p result
2103
+ #
2104
+ def restore_backup request, options = nil
2105
+ raise ::ArgumentError, "request must be provided" if request.nil?
2106
+
2107
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesRestoreBackupRequest
2108
+
2109
+ # Converts hash and nil to an options object
2110
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2111
+
2112
+ # Customize the options with defaults
2113
+ call_metadata = @config.rpcs.restore_backup.metadata.to_h
2114
+
2115
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2116
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2117
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2118
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
2119
+ transports_version_send: [:rest]
2120
+
2121
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2122
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2123
+
2124
+ options.apply_defaults timeout: @config.rpcs.restore_backup.timeout,
2125
+ metadata: call_metadata,
2126
+ retry_policy: @config.rpcs.restore_backup.retry_policy
2127
+
2128
+ options.apply_defaults timeout: @config.timeout,
2129
+ metadata: @config.metadata,
2130
+ retry_policy: @config.retry_policy
2131
+
2132
+ @sql_instances_service_stub.restore_backup request, options do |result, operation|
2133
+ yield result, operation if block_given?
2134
+ end
2135
+ rescue ::Gapic::Rest::Error => e
2136
+ raise ::Google::Cloud::Error.from_error(e)
2137
+ end
2138
+
2139
+ ##
2140
+ # Rotates the server certificate to one signed by the Certificate Authority
2141
+ # (CA) version previously added with the addServerCA method. For instances
2142
+ # that have enabled Certificate Authority Service (CAS) based server CA,
2143
+ # use RotateServerCertificate to rotate the server certificate.
2144
+ #
2145
+ # @overload rotate_server_ca(request, options = nil)
2146
+ # Pass arguments to `rotate_server_ca` via a request object, either of type
2147
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesRotateServerCaRequest} or an equivalent Hash.
2148
+ #
2149
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesRotateServerCaRequest, ::Hash]
2150
+ # A request object representing the call parameters. Required. To specify no
2151
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2152
+ # @param options [::Gapic::CallOptions, ::Hash]
2153
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2154
+ #
2155
+ # @overload rotate_server_ca(instance: nil, project: nil, body: nil)
2156
+ # Pass arguments to `rotate_server_ca` via keyword arguments. Note that at
2157
+ # least one keyword argument is required. To specify no parameters, or to keep all
2158
+ # the default parameter values, pass an empty Hash as a request object (see above).
2159
+ #
2160
+ # @param instance [::String]
2161
+ # Cloud SQL instance ID. This does not include the project ID.
2162
+ # @param project [::String]
2163
+ # Project ID of the project that contains the instance.
2164
+ # @param body [::Google::Cloud::Sql::V1beta4::InstancesRotateServerCaRequest, ::Hash]
2165
+ # @yield [result, operation] Access the result along with the TransportOperation object
2166
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
2167
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2168
+ #
2169
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
2170
+ #
2171
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2172
+ #
2173
+ # @example Basic example
2174
+ # require "google/cloud/sql/v1beta4"
2175
+ #
2176
+ # # Create a client object. The client can be reused for multiple calls.
2177
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
2178
+ #
2179
+ # # Create a request. To set request fields, pass in keyword arguments.
2180
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesRotateServerCaRequest.new
2181
+ #
2182
+ # # Call the rotate_server_ca method.
2183
+ # result = client.rotate_server_ca request
2184
+ #
2185
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
2186
+ # p result
2187
+ #
2188
+ def rotate_server_ca request, options = nil
2189
+ raise ::ArgumentError, "request must be provided" if request.nil?
2190
+
2191
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesRotateServerCaRequest
2192
+
2193
+ # Converts hash and nil to an options object
2194
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2195
+
2196
+ # Customize the options with defaults
2197
+ call_metadata = @config.rpcs.rotate_server_ca.metadata.to_h
2198
+
2199
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2200
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2201
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2202
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
2203
+ transports_version_send: [:rest]
2204
+
2205
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2206
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2207
+
2208
+ options.apply_defaults timeout: @config.rpcs.rotate_server_ca.timeout,
2209
+ metadata: call_metadata,
2210
+ retry_policy: @config.rpcs.rotate_server_ca.retry_policy
2211
+
2212
+ options.apply_defaults timeout: @config.timeout,
2213
+ metadata: @config.metadata,
2214
+ retry_policy: @config.retry_policy
2215
+
2216
+ @sql_instances_service_stub.rotate_server_ca request, options do |result, operation|
2217
+ yield result, operation if block_given?
2218
+ end
2219
+ rescue ::Gapic::Rest::Error => e
2220
+ raise ::Google::Cloud::Error.from_error(e)
2221
+ end
2222
+
2223
+ ##
2224
+ # Rotates the server certificate version to one previously added with the
2225
+ # addServerCertificate method. For instances not using Certificate Authority
2226
+ # Service (CAS) server CA, use RotateServerCa instead.
2227
+ #
2228
+ # @overload rotate_server_certificate(request, options = nil)
2229
+ # Pass arguments to `rotate_server_certificate` via a request object, either of type
2230
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesRotateServerCertificateRequest} or an equivalent Hash.
2231
+ #
2232
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesRotateServerCertificateRequest, ::Hash]
2233
+ # A request object representing the call parameters. Required. To specify no
2234
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2235
+ # @param options [::Gapic::CallOptions, ::Hash]
2236
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2237
+ #
2238
+ # @overload rotate_server_certificate(instance: nil, project: nil, body: nil)
2239
+ # Pass arguments to `rotate_server_certificate` via keyword arguments. Note that at
2240
+ # least one keyword argument is required. To specify no parameters, or to keep all
2241
+ # the default parameter values, pass an empty Hash as a request object (see above).
2242
+ #
2243
+ # @param instance [::String]
2244
+ # Required. Cloud SQL instance ID. This does not include the project ID.
2245
+ # @param project [::String]
2246
+ # Required. Project ID of the project that contains the instance.
2247
+ # @param body [::Google::Cloud::Sql::V1beta4::InstancesRotateServerCertificateRequest, ::Hash]
2248
+ # Required. Rotate server certificate request body.
2249
+ # @yield [result, operation] Access the result along with the TransportOperation object
2250
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
2251
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2252
+ #
2253
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
2254
+ #
2255
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2256
+ #
2257
+ # @example Basic example
2258
+ # require "google/cloud/sql/v1beta4"
2259
+ #
2260
+ # # Create a client object. The client can be reused for multiple calls.
2261
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
2262
+ #
2263
+ # # Create a request. To set request fields, pass in keyword arguments.
2264
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesRotateServerCertificateRequest.new
2265
+ #
2266
+ # # Call the rotate_server_certificate method.
2267
+ # result = client.rotate_server_certificate request
2268
+ #
2269
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
2270
+ # p result
2271
+ #
2272
+ def rotate_server_certificate request, options = nil
2273
+ raise ::ArgumentError, "request must be provided" if request.nil?
2274
+
2275
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesRotateServerCertificateRequest
2276
+
2277
+ # Converts hash and nil to an options object
2278
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2279
+
2280
+ # Customize the options with defaults
2281
+ call_metadata = @config.rpcs.rotate_server_certificate.metadata.to_h
2282
+
2283
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2284
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2285
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2286
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
2287
+ transports_version_send: [:rest]
2288
+
2289
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2290
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2291
+
2292
+ options.apply_defaults timeout: @config.rpcs.rotate_server_certificate.timeout,
2293
+ metadata: call_metadata,
2294
+ retry_policy: @config.rpcs.rotate_server_certificate.retry_policy
2295
+
2296
+ options.apply_defaults timeout: @config.timeout,
2297
+ metadata: @config.metadata,
2298
+ retry_policy: @config.retry_policy
2299
+
2300
+ @sql_instances_service_stub.rotate_server_certificate request, options do |result, operation|
2301
+ yield result, operation if block_given?
2302
+ end
2303
+ rescue ::Gapic::Rest::Error => e
2304
+ raise ::Google::Cloud::Error.from_error(e)
2305
+ end
2306
+
2307
+ ##
2308
+ # Rotates the Entra Id certificate version to one previously added with the
2309
+ # addEntraIdCertificate method.
2310
+ #
2311
+ # @overload rotate_entra_id_certificate(request, options = nil)
2312
+ # Pass arguments to `rotate_entra_id_certificate` via a request object, either of type
2313
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesRotateEntraIdCertificateRequest} or an equivalent Hash.
2314
+ #
2315
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesRotateEntraIdCertificateRequest, ::Hash]
2316
+ # A request object representing the call parameters. Required. To specify no
2317
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2318
+ # @param options [::Gapic::CallOptions, ::Hash]
2319
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2320
+ #
2321
+ # @overload rotate_entra_id_certificate(instance: nil, project: nil, body: nil)
2322
+ # Pass arguments to `rotate_entra_id_certificate` via keyword arguments. Note that at
2323
+ # least one keyword argument is required. To specify no parameters, or to keep all
2324
+ # the default parameter values, pass an empty Hash as a request object (see above).
2325
+ #
2326
+ # @param instance [::String]
2327
+ # Required. Cloud SQL instance ID. This does not include the project ID.
2328
+ # @param project [::String]
2329
+ # Required. Project ID of the project that contains the instance.
2330
+ # @param body [::Google::Cloud::Sql::V1beta4::InstancesRotateEntraIdCertificateRequest, ::Hash]
2331
+ # Required. Rotate Entra ID certificate request body.
2332
+ # @yield [result, operation] Access the result along with the TransportOperation object
2333
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
2334
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2335
+ #
2336
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
2337
+ #
2338
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2339
+ #
2340
+ # @example Basic example
2341
+ # require "google/cloud/sql/v1beta4"
2342
+ #
2343
+ # # Create a client object. The client can be reused for multiple calls.
2344
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
2345
+ #
2346
+ # # Create a request. To set request fields, pass in keyword arguments.
2347
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesRotateEntraIdCertificateRequest.new
2348
+ #
2349
+ # # Call the rotate_entra_id_certificate method.
2350
+ # result = client.rotate_entra_id_certificate request
2351
+ #
2352
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
2353
+ # p result
2354
+ #
2355
+ def rotate_entra_id_certificate request, options = nil
2356
+ raise ::ArgumentError, "request must be provided" if request.nil?
2357
+
2358
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesRotateEntraIdCertificateRequest
2359
+
2360
+ # Converts hash and nil to an options object
2361
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2362
+
2363
+ # Customize the options with defaults
2364
+ call_metadata = @config.rpcs.rotate_entra_id_certificate.metadata.to_h
2365
+
2366
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2367
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2368
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2369
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
2370
+ transports_version_send: [:rest]
2371
+
2372
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2373
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2374
+
2375
+ options.apply_defaults timeout: @config.rpcs.rotate_entra_id_certificate.timeout,
2376
+ metadata: call_metadata,
2377
+ retry_policy: @config.rpcs.rotate_entra_id_certificate.retry_policy
2378
+
2379
+ options.apply_defaults timeout: @config.timeout,
2380
+ metadata: @config.metadata,
2381
+ retry_policy: @config.retry_policy
2382
+
2383
+ @sql_instances_service_stub.rotate_entra_id_certificate request, options do |result, operation|
2384
+ yield result, operation if block_given?
2385
+ end
2386
+ rescue ::Gapic::Rest::Error => e
2387
+ raise ::Google::Cloud::Error.from_error(e)
2388
+ end
2389
+
2390
+ ##
2391
+ # Starts the replication in the read replica instance.
2392
+ #
2393
+ # @overload start_replica(request, options = nil)
2394
+ # Pass arguments to `start_replica` via a request object, either of type
2395
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesStartReplicaRequest} or an equivalent Hash.
2396
+ #
2397
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesStartReplicaRequest, ::Hash]
2398
+ # A request object representing the call parameters. Required. To specify no
2399
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2400
+ # @param options [::Gapic::CallOptions, ::Hash]
2401
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2402
+ #
2403
+ # @overload start_replica(instance: nil, project: nil)
2404
+ # Pass arguments to `start_replica` via keyword arguments. Note that at
2405
+ # least one keyword argument is required. To specify no parameters, or to keep all
2406
+ # the default parameter values, pass an empty Hash as a request object (see above).
2407
+ #
2408
+ # @param instance [::String]
2409
+ # Cloud SQL read replica instance name.
2410
+ # @param project [::String]
2411
+ # ID of the project that contains the read replica.
2412
+ # @yield [result, operation] Access the result along with the TransportOperation object
2413
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
2414
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2415
+ #
2416
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
2417
+ #
2418
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2419
+ #
2420
+ # @example Basic example
2421
+ # require "google/cloud/sql/v1beta4"
2422
+ #
2423
+ # # Create a client object. The client can be reused for multiple calls.
2424
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
2425
+ #
2426
+ # # Create a request. To set request fields, pass in keyword arguments.
2427
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesStartReplicaRequest.new
2428
+ #
2429
+ # # Call the start_replica method.
2430
+ # result = client.start_replica request
2431
+ #
2432
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
2433
+ # p result
2434
+ #
2435
+ def start_replica request, options = nil
2436
+ raise ::ArgumentError, "request must be provided" if request.nil?
2437
+
2438
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesStartReplicaRequest
2439
+
2440
+ # Converts hash and nil to an options object
2441
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2442
+
2443
+ # Customize the options with defaults
2444
+ call_metadata = @config.rpcs.start_replica.metadata.to_h
2445
+
2446
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2447
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2448
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2449
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
2450
+ transports_version_send: [:rest]
2451
+
2452
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2453
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2454
+
2455
+ options.apply_defaults timeout: @config.rpcs.start_replica.timeout,
2456
+ metadata: call_metadata,
2457
+ retry_policy: @config.rpcs.start_replica.retry_policy
2458
+
2459
+ options.apply_defaults timeout: @config.timeout,
2460
+ metadata: @config.metadata,
2461
+ retry_policy: @config.retry_policy
2462
+
2463
+ @sql_instances_service_stub.start_replica request, options do |result, operation|
2464
+ yield result, operation if block_given?
2465
+ end
2466
+ rescue ::Gapic::Rest::Error => e
2467
+ raise ::Google::Cloud::Error.from_error(e)
2468
+ end
2469
+
2470
+ ##
2471
+ # Stops the replication in the read replica instance.
2472
+ #
2473
+ # @overload stop_replica(request, options = nil)
2474
+ # Pass arguments to `stop_replica` via a request object, either of type
2475
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesStopReplicaRequest} or an equivalent Hash.
2476
+ #
2477
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesStopReplicaRequest, ::Hash]
2478
+ # A request object representing the call parameters. Required. To specify no
2479
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2480
+ # @param options [::Gapic::CallOptions, ::Hash]
2481
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2482
+ #
2483
+ # @overload stop_replica(instance: nil, project: nil)
2484
+ # Pass arguments to `stop_replica` via keyword arguments. Note that at
2485
+ # least one keyword argument is required. To specify no parameters, or to keep all
2486
+ # the default parameter values, pass an empty Hash as a request object (see above).
2487
+ #
2488
+ # @param instance [::String]
2489
+ # Cloud SQL read replica instance name.
2490
+ # @param project [::String]
2491
+ # ID of the project that contains the read replica.
2492
+ # @yield [result, operation] Access the result along with the TransportOperation object
2493
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
2494
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2495
+ #
2496
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
2497
+ #
2498
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2499
+ #
2500
+ # @example Basic example
2501
+ # require "google/cloud/sql/v1beta4"
2502
+ #
2503
+ # # Create a client object. The client can be reused for multiple calls.
2504
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
2505
+ #
2506
+ # # Create a request. To set request fields, pass in keyword arguments.
2507
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesStopReplicaRequest.new
2508
+ #
2509
+ # # Call the stop_replica method.
2510
+ # result = client.stop_replica request
2511
+ #
2512
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
2513
+ # p result
2514
+ #
2515
+ def stop_replica request, options = nil
2516
+ raise ::ArgumentError, "request must be provided" if request.nil?
2517
+
2518
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesStopReplicaRequest
2519
+
2520
+ # Converts hash and nil to an options object
2521
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2522
+
2523
+ # Customize the options with defaults
2524
+ call_metadata = @config.rpcs.stop_replica.metadata.to_h
2525
+
2526
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2527
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2528
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2529
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
2530
+ transports_version_send: [:rest]
2531
+
2532
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2533
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2534
+
2535
+ options.apply_defaults timeout: @config.rpcs.stop_replica.timeout,
2536
+ metadata: call_metadata,
2537
+ retry_policy: @config.rpcs.stop_replica.retry_policy
2538
+
2539
+ options.apply_defaults timeout: @config.timeout,
2540
+ metadata: @config.metadata,
2541
+ retry_policy: @config.retry_policy
2542
+
2543
+ @sql_instances_service_stub.stop_replica request, options do |result, operation|
2544
+ yield result, operation if block_given?
2545
+ end
2546
+ rescue ::Gapic::Rest::Error => e
2547
+ raise ::Google::Cloud::Error.from_error(e)
2548
+ end
2549
+
2550
+ ##
2551
+ # Truncate MySQL general and slow query log tables
2552
+ # MySQL only.
2553
+ #
2554
+ # @overload truncate_log(request, options = nil)
2555
+ # Pass arguments to `truncate_log` via a request object, either of type
2556
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesTruncateLogRequest} or an equivalent Hash.
2557
+ #
2558
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesTruncateLogRequest, ::Hash]
2559
+ # A request object representing the call parameters. Required. To specify no
2560
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2561
+ # @param options [::Gapic::CallOptions, ::Hash]
2562
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2563
+ #
2564
+ # @overload truncate_log(instance: nil, project: nil, body: nil)
2565
+ # Pass arguments to `truncate_log` via keyword arguments. Note that at
2566
+ # least one keyword argument is required. To specify no parameters, or to keep all
2567
+ # the default parameter values, pass an empty Hash as a request object (see above).
2568
+ #
2569
+ # @param instance [::String]
2570
+ # Cloud SQL instance ID. This does not include the project ID.
2571
+ # @param project [::String]
2572
+ # Project ID of the Cloud SQL project.
2573
+ # @param body [::Google::Cloud::Sql::V1beta4::InstancesTruncateLogRequest, ::Hash]
2574
+ # @yield [result, operation] Access the result along with the TransportOperation object
2575
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
2576
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2577
+ #
2578
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
2579
+ #
2580
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2581
+ #
2582
+ # @example Basic example
2583
+ # require "google/cloud/sql/v1beta4"
2584
+ #
2585
+ # # Create a client object. The client can be reused for multiple calls.
2586
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
2587
+ #
2588
+ # # Create a request. To set request fields, pass in keyword arguments.
2589
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesTruncateLogRequest.new
2590
+ #
2591
+ # # Call the truncate_log method.
2592
+ # result = client.truncate_log request
2593
+ #
2594
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
2595
+ # p result
2596
+ #
2597
+ def truncate_log request, options = nil
2598
+ raise ::ArgumentError, "request must be provided" if request.nil?
2599
+
2600
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesTruncateLogRequest
2601
+
2602
+ # Converts hash and nil to an options object
2603
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2604
+
2605
+ # Customize the options with defaults
2606
+ call_metadata = @config.rpcs.truncate_log.metadata.to_h
2607
+
2608
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2609
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2610
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2611
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
2612
+ transports_version_send: [:rest]
2613
+
2614
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2615
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2616
+
2617
+ options.apply_defaults timeout: @config.rpcs.truncate_log.timeout,
2618
+ metadata: call_metadata,
2619
+ retry_policy: @config.rpcs.truncate_log.retry_policy
2620
+
2621
+ options.apply_defaults timeout: @config.timeout,
2622
+ metadata: @config.metadata,
2623
+ retry_policy: @config.retry_policy
2624
+
2625
+ @sql_instances_service_stub.truncate_log request, options do |result, operation|
2626
+ yield result, operation if block_given?
2627
+ end
2628
+ rescue ::Gapic::Rest::Error => e
2629
+ raise ::Google::Cloud::Error.from_error(e)
2630
+ end
2631
+
2632
+ ##
2633
+ # Updates settings of a Cloud SQL instance. Using this operation might cause
2634
+ # your instance to restart.
2635
+ #
2636
+ # @overload update(request, options = nil)
2637
+ # Pass arguments to `update` via a request object, either of type
2638
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesUpdateRequest} or an equivalent Hash.
2639
+ #
2640
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesUpdateRequest, ::Hash]
2641
+ # A request object representing the call parameters. Required. To specify no
2642
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2643
+ # @param options [::Gapic::CallOptions, ::Hash]
2644
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2645
+ #
2646
+ # @overload update(instance: nil, project: nil, body: nil)
2647
+ # Pass arguments to `update` via keyword arguments. Note that at
2648
+ # least one keyword argument is required. To specify no parameters, or to keep all
2649
+ # the default parameter values, pass an empty Hash as a request object (see above).
2650
+ #
2651
+ # @param instance [::String]
2652
+ # Cloud SQL instance ID. This does not include the project ID.
2653
+ # @param project [::String]
2654
+ # Project ID of the project that contains the instance.
2655
+ # @param body [::Google::Cloud::Sql::V1beta4::DatabaseInstance, ::Hash]
2656
+ # @yield [result, operation] Access the result along with the TransportOperation object
2657
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
2658
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2659
+ #
2660
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
2661
+ #
2662
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2663
+ #
2664
+ # @example Basic example
2665
+ # require "google/cloud/sql/v1beta4"
2666
+ #
2667
+ # # Create a client object. The client can be reused for multiple calls.
2668
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
2669
+ #
2670
+ # # Create a request. To set request fields, pass in keyword arguments.
2671
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesUpdateRequest.new
2672
+ #
2673
+ # # Call the update method.
2674
+ # result = client.update request
2675
+ #
2676
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
2677
+ # p result
2678
+ #
2679
+ def update request, options = nil
2680
+ raise ::ArgumentError, "request must be provided" if request.nil?
2681
+
2682
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesUpdateRequest
2683
+
2684
+ # Converts hash and nil to an options object
2685
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2686
+
2687
+ # Customize the options with defaults
2688
+ call_metadata = @config.rpcs.update.metadata.to_h
2689
+
2690
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2691
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2692
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2693
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
2694
+ transports_version_send: [:rest]
2695
+
2696
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2697
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2698
+
2699
+ options.apply_defaults timeout: @config.rpcs.update.timeout,
2700
+ metadata: call_metadata,
2701
+ retry_policy: @config.rpcs.update.retry_policy
2702
+
2703
+ options.apply_defaults timeout: @config.timeout,
2704
+ metadata: @config.metadata,
2705
+ retry_policy: @config.retry_policy
2706
+
2707
+ @sql_instances_service_stub.update request, options do |result, operation|
2708
+ yield result, operation if block_given?
2709
+ end
2710
+ rescue ::Gapic::Rest::Error => e
2711
+ raise ::Google::Cloud::Error.from_error(e)
2712
+ end
2713
+
2714
+ ##
2715
+ # Generates a short-lived X509 certificate containing the provided public key
2716
+ # and signed by a private key specific to the target instance. Users may use
2717
+ # the certificate to authenticate as themselves when connecting to the
2718
+ # database.
2719
+ #
2720
+ # @overload create_ephemeral(request, options = nil)
2721
+ # Pass arguments to `create_ephemeral` via a request object, either of type
2722
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesCreateEphemeralCertRequest} or an equivalent Hash.
2723
+ #
2724
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesCreateEphemeralCertRequest, ::Hash]
2725
+ # A request object representing the call parameters. Required. To specify no
2726
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2727
+ # @param options [::Gapic::CallOptions, ::Hash]
2728
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2729
+ #
2730
+ # @overload create_ephemeral(instance: nil, project: nil, body: nil)
2731
+ # Pass arguments to `create_ephemeral` via keyword arguments. Note that at
2732
+ # least one keyword argument is required. To specify no parameters, or to keep all
2733
+ # the default parameter values, pass an empty Hash as a request object (see above).
2734
+ #
2735
+ # @param instance [::String]
2736
+ # Cloud SQL instance ID. This does not include the project ID.
2737
+ # @param project [::String]
2738
+ # Project ID of the Cloud SQL project.
2739
+ # @param body [::Google::Cloud::Sql::V1beta4::SslCertsCreateEphemeralRequest, ::Hash]
2740
+ # @yield [result, operation] Access the result along with the TransportOperation object
2741
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::SslCert]
2742
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2743
+ #
2744
+ # @return [::Google::Cloud::Sql::V1beta4::SslCert]
2745
+ #
2746
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2747
+ #
2748
+ # @example Basic example
2749
+ # require "google/cloud/sql/v1beta4"
2750
+ #
2751
+ # # Create a client object. The client can be reused for multiple calls.
2752
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
2753
+ #
2754
+ # # Create a request. To set request fields, pass in keyword arguments.
2755
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesCreateEphemeralCertRequest.new
2756
+ #
2757
+ # # Call the create_ephemeral method.
2758
+ # result = client.create_ephemeral request
2759
+ #
2760
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::SslCert.
2761
+ # p result
2762
+ #
2763
+ def create_ephemeral request, options = nil
2764
+ raise ::ArgumentError, "request must be provided" if request.nil?
2765
+
2766
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesCreateEphemeralCertRequest
2767
+
2768
+ # Converts hash and nil to an options object
2769
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2770
+
2771
+ # Customize the options with defaults
2772
+ call_metadata = @config.rpcs.create_ephemeral.metadata.to_h
2773
+
2774
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2775
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2776
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2777
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
2778
+ transports_version_send: [:rest]
2779
+
2780
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2781
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2782
+
2783
+ options.apply_defaults timeout: @config.rpcs.create_ephemeral.timeout,
2784
+ metadata: call_metadata,
2785
+ retry_policy: @config.rpcs.create_ephemeral.retry_policy
2786
+
2787
+ options.apply_defaults timeout: @config.timeout,
2788
+ metadata: @config.metadata,
2789
+ retry_policy: @config.retry_policy
2790
+
2791
+ @sql_instances_service_stub.create_ephemeral request, options do |result, operation|
2792
+ yield result, operation if block_given?
2793
+ end
2794
+ rescue ::Gapic::Rest::Error => e
2795
+ raise ::Google::Cloud::Error.from_error(e)
2796
+ end
2797
+
2798
+ ##
2799
+ # Reschedules the maintenance on the given instance.
2800
+ #
2801
+ # @overload reschedule_maintenance(request, options = nil)
2802
+ # Pass arguments to `reschedule_maintenance` via a request object, either of type
2803
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesRescheduleMaintenanceRequest} or an equivalent Hash.
2804
+ #
2805
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesRescheduleMaintenanceRequest, ::Hash]
2806
+ # A request object representing the call parameters. Required. To specify no
2807
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2808
+ # @param options [::Gapic::CallOptions, ::Hash]
2809
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2810
+ #
2811
+ # @overload reschedule_maintenance(instance: nil, project: nil, body: nil)
2812
+ # Pass arguments to `reschedule_maintenance` via keyword arguments. Note that at
2813
+ # least one keyword argument is required. To specify no parameters, or to keep all
2814
+ # the default parameter values, pass an empty Hash as a request object (see above).
2815
+ #
2816
+ # @param instance [::String]
2817
+ # Cloud SQL instance ID. This does not include the project ID.
2818
+ # @param project [::String]
2819
+ # ID of the project that contains the instance.
2820
+ # @param body [::Google::Cloud::Sql::V1beta4::SqlInstancesRescheduleMaintenanceRequestBody, ::Hash]
2821
+ # @yield [result, operation] Access the result along with the TransportOperation object
2822
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
2823
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2824
+ #
2825
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
2826
+ #
2827
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2828
+ #
2829
+ # @example Basic example
2830
+ # require "google/cloud/sql/v1beta4"
2831
+ #
2832
+ # # Create a client object. The client can be reused for multiple calls.
2833
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
2834
+ #
2835
+ # # Create a request. To set request fields, pass in keyword arguments.
2836
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesRescheduleMaintenanceRequest.new
2837
+ #
2838
+ # # Call the reschedule_maintenance method.
2839
+ # result = client.reschedule_maintenance request
2840
+ #
2841
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
2842
+ # p result
2843
+ #
2844
+ def reschedule_maintenance request, options = nil
2845
+ raise ::ArgumentError, "request must be provided" if request.nil?
2846
+
2847
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesRescheduleMaintenanceRequest
2848
+
2849
+ # Converts hash and nil to an options object
2850
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2851
+
2852
+ # Customize the options with defaults
2853
+ call_metadata = @config.rpcs.reschedule_maintenance.metadata.to_h
2854
+
2855
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2856
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2857
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2858
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
2859
+ transports_version_send: [:rest]
2860
+
2861
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2862
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2863
+
2864
+ options.apply_defaults timeout: @config.rpcs.reschedule_maintenance.timeout,
2865
+ metadata: call_metadata,
2866
+ retry_policy: @config.rpcs.reschedule_maintenance.retry_policy
2867
+
2868
+ options.apply_defaults timeout: @config.timeout,
2869
+ metadata: @config.metadata,
2870
+ retry_policy: @config.retry_policy
2871
+
2872
+ @sql_instances_service_stub.reschedule_maintenance request, options do |result, operation|
2873
+ yield result, operation if block_given?
2874
+ end
2875
+ rescue ::Gapic::Rest::Error => e
2876
+ raise ::Google::Cloud::Error.from_error(e)
2877
+ end
2878
+
2879
+ ##
2880
+ # Verify External primary instance external sync settings.
2881
+ #
2882
+ # @overload verify_external_sync_settings(request, options = nil)
2883
+ # Pass arguments to `verify_external_sync_settings` via a request object, either of type
2884
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesVerifyExternalSyncSettingsRequest} or an equivalent Hash.
2885
+ #
2886
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesVerifyExternalSyncSettingsRequest, ::Hash]
2887
+ # A request object representing the call parameters. Required. To specify no
2888
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2889
+ # @param options [::Gapic::CallOptions, ::Hash]
2890
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2891
+ #
2892
+ # @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)
2893
+ # Pass arguments to `verify_external_sync_settings` via keyword arguments. Note that at
2894
+ # least one keyword argument is required. To specify no parameters, or to keep all
2895
+ # the default parameter values, pass an empty Hash as a request object (see above).
2896
+ #
2897
+ # @param instance [::String]
2898
+ # Cloud SQL instance ID. This does not include the project ID.
2899
+ # @param project [::String]
2900
+ # Project ID of the project that contains the instance.
2901
+ # @param verify_connection_only [::Boolean]
2902
+ # Flag to enable verifying connection only
2903
+ # @param sync_mode [::Google::Cloud::Sql::V1beta4::SqlInstancesVerifyExternalSyncSettingsRequest::ExternalSyncMode]
2904
+ # External sync mode
2905
+ # @param verify_replication_only [::Boolean]
2906
+ # Optional. Flag to verify settings required by replication setup only
2907
+ # @param mysql_sync_config [::Google::Cloud::Sql::V1beta4::MySqlSyncConfig, ::Hash]
2908
+ # Optional. MySQL-specific settings for start external sync.
2909
+ # @param migration_type [::Google::Cloud::Sql::V1beta4::SqlInstancesVerifyExternalSyncSettingsRequest::MigrationType]
2910
+ # Optional. MigrationType configures the migration to use physical files or
2911
+ # logical dump files. If not set, then the logical dump file configuration is
2912
+ # used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
2913
+ # @param sync_parallel_level [::Google::Cloud::Sql::V1beta4::ExternalSyncParallelLevel]
2914
+ # Optional. Parallel level for initial data sync. Only applicable for
2915
+ # PostgreSQL.
2916
+ # @param selected_objects [::Array<::Google::Cloud::Sql::V1beta4::ExternalSyncSelectedObject, ::Hash>]
2917
+ # Optional. Migrate only the specified objects from the source instance. If
2918
+ # this field is empty, then migrate all objects.
2919
+ # @yield [result, operation] Access the result along with the TransportOperation object
2920
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::SqlInstancesVerifyExternalSyncSettingsResponse]
2921
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
2922
+ #
2923
+ # @return [::Google::Cloud::Sql::V1beta4::SqlInstancesVerifyExternalSyncSettingsResponse]
2924
+ #
2925
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
2926
+ #
2927
+ # @example Basic example
2928
+ # require "google/cloud/sql/v1beta4"
2929
+ #
2930
+ # # Create a client object. The client can be reused for multiple calls.
2931
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
2932
+ #
2933
+ # # Create a request. To set request fields, pass in keyword arguments.
2934
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesVerifyExternalSyncSettingsRequest.new
2935
+ #
2936
+ # # Call the verify_external_sync_settings method.
2937
+ # result = client.verify_external_sync_settings request
2938
+ #
2939
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::SqlInstancesVerifyExternalSyncSettingsResponse.
2940
+ # p result
2941
+ #
2942
+ def verify_external_sync_settings request, options = nil
2943
+ raise ::ArgumentError, "request must be provided" if request.nil?
2944
+
2945
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesVerifyExternalSyncSettingsRequest
2946
+
2947
+ # Converts hash and nil to an options object
2948
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2949
+
2950
+ # Customize the options with defaults
2951
+ call_metadata = @config.rpcs.verify_external_sync_settings.metadata.to_h
2952
+
2953
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2954
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2955
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2956
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
2957
+ transports_version_send: [:rest]
2958
+
2959
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2960
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2961
+
2962
+ options.apply_defaults timeout: @config.rpcs.verify_external_sync_settings.timeout,
2963
+ metadata: call_metadata,
2964
+ retry_policy: @config.rpcs.verify_external_sync_settings.retry_policy
2965
+
2966
+ options.apply_defaults timeout: @config.timeout,
2967
+ metadata: @config.metadata,
2968
+ retry_policy: @config.retry_policy
2969
+
2970
+ @sql_instances_service_stub.verify_external_sync_settings request, options do |result, operation|
2971
+ yield result, operation if block_given?
2972
+ end
2973
+ rescue ::Gapic::Rest::Error => e
2974
+ raise ::Google::Cloud::Error.from_error(e)
2975
+ end
2976
+
2977
+ ##
2978
+ # Start External primary instance migration.
2979
+ #
2980
+ # @overload start_external_sync(request, options = nil)
2981
+ # Pass arguments to `start_external_sync` via a request object, either of type
2982
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesStartExternalSyncRequest} or an equivalent Hash.
2983
+ #
2984
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesStartExternalSyncRequest, ::Hash]
2985
+ # A request object representing the call parameters. Required. To specify no
2986
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2987
+ # @param options [::Gapic::CallOptions, ::Hash]
2988
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
2989
+ #
2990
+ # @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)
2991
+ # Pass arguments to `start_external_sync` via keyword arguments. Note that at
2992
+ # least one keyword argument is required. To specify no parameters, or to keep all
2993
+ # the default parameter values, pass an empty Hash as a request object (see above).
2994
+ #
2995
+ # @param instance [::String]
2996
+ # Cloud SQL instance ID. This does not include the project ID.
2997
+ # @param project [::String]
2998
+ # ID of the project that contains the instance.
2999
+ # @param sync_mode [::Google::Cloud::Sql::V1beta4::SqlInstancesVerifyExternalSyncSettingsRequest::ExternalSyncMode]
3000
+ # External sync mode.
3001
+ # @param skip_verification [::Boolean]
3002
+ # Whether to skip the verification step (VESS).
3003
+ # @param mysql_sync_config [::Google::Cloud::Sql::V1beta4::MySqlSyncConfig, ::Hash]
3004
+ # MySQL-specific settings for start external sync.
3005
+ # @param sync_parallel_level [::Google::Cloud::Sql::V1beta4::ExternalSyncParallelLevel]
3006
+ # Optional. Parallel level for initial data sync. Currently only applicable
3007
+ # for MySQL.
3008
+ # @param migration_type [::Google::Cloud::Sql::V1beta4::SqlInstancesVerifyExternalSyncSettingsRequest::MigrationType]
3009
+ # Optional. MigrationType configures the migration to use physical files or
3010
+ # logical dump files. If not set, then the logical dump file configuration is
3011
+ # used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
3012
+ # @param replica_overwrite_enabled [::Boolean]
3013
+ # Optional. MySQL only. True if end-user has confirmed that this SES call
3014
+ # will wipe replica databases overlapping with the proposed selected_objects.
3015
+ # If this field is not set and there are both overlapping and additional
3016
+ # databases proposed, an error will be returned.
3017
+ # @yield [result, operation] Access the result along with the TransportOperation object
3018
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
3019
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3020
+ #
3021
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
3022
+ #
3023
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3024
+ #
3025
+ # @example Basic example
3026
+ # require "google/cloud/sql/v1beta4"
3027
+ #
3028
+ # # Create a client object. The client can be reused for multiple calls.
3029
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
3030
+ #
3031
+ # # Create a request. To set request fields, pass in keyword arguments.
3032
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesStartExternalSyncRequest.new
3033
+ #
3034
+ # # Call the start_external_sync method.
3035
+ # result = client.start_external_sync request
3036
+ #
3037
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
3038
+ # p result
3039
+ #
3040
+ def start_external_sync request, options = nil
3041
+ raise ::ArgumentError, "request must be provided" if request.nil?
3042
+
3043
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesStartExternalSyncRequest
3044
+
3045
+ # Converts hash and nil to an options object
3046
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3047
+
3048
+ # Customize the options with defaults
3049
+ call_metadata = @config.rpcs.start_external_sync.metadata.to_h
3050
+
3051
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3052
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3053
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3054
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
3055
+ transports_version_send: [:rest]
3056
+
3057
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3058
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3059
+
3060
+ options.apply_defaults timeout: @config.rpcs.start_external_sync.timeout,
3061
+ metadata: call_metadata,
3062
+ retry_policy: @config.rpcs.start_external_sync.retry_policy
3063
+
3064
+ options.apply_defaults timeout: @config.timeout,
3065
+ metadata: @config.metadata,
3066
+ retry_policy: @config.retry_policy
3067
+
3068
+ @sql_instances_service_stub.start_external_sync request, options do |result, operation|
3069
+ yield result, operation if block_given?
3070
+ end
3071
+ rescue ::Gapic::Rest::Error => e
3072
+ raise ::Google::Cloud::Error.from_error(e)
3073
+ end
3074
+
3075
+ ##
3076
+ # Perform Disk Shrink on primary instance.
3077
+ #
3078
+ # @overload perform_disk_shrink(request, options = nil)
3079
+ # Pass arguments to `perform_disk_shrink` via a request object, either of type
3080
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesPerformDiskShrinkRequest} or an equivalent Hash.
3081
+ #
3082
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesPerformDiskShrinkRequest, ::Hash]
3083
+ # A request object representing the call parameters. Required. To specify no
3084
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3085
+ # @param options [::Gapic::CallOptions, ::Hash]
3086
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3087
+ #
3088
+ # @overload perform_disk_shrink(instance: nil, project: nil, body: nil)
3089
+ # Pass arguments to `perform_disk_shrink` via keyword arguments. Note that at
3090
+ # least one keyword argument is required. To specify no parameters, or to keep all
3091
+ # the default parameter values, pass an empty Hash as a request object (see above).
3092
+ #
3093
+ # @param instance [::String]
3094
+ # Cloud SQL instance ID. This does not include the project ID.
3095
+ # @param project [::String]
3096
+ # Project ID of the project that contains the instance.
3097
+ # @param body [::Google::Cloud::Sql::V1beta4::PerformDiskShrinkContext, ::Hash]
3098
+ # Perform disk shrink context.
3099
+ # @yield [result, operation] Access the result along with the TransportOperation object
3100
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
3101
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3102
+ #
3103
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
3104
+ #
3105
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3106
+ #
3107
+ # @example Basic example
3108
+ # require "google/cloud/sql/v1beta4"
3109
+ #
3110
+ # # Create a client object. The client can be reused for multiple calls.
3111
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
3112
+ #
3113
+ # # Create a request. To set request fields, pass in keyword arguments.
3114
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesPerformDiskShrinkRequest.new
3115
+ #
3116
+ # # Call the perform_disk_shrink method.
3117
+ # result = client.perform_disk_shrink request
3118
+ #
3119
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
3120
+ # p result
3121
+ #
3122
+ def perform_disk_shrink request, options = nil
3123
+ raise ::ArgumentError, "request must be provided" if request.nil?
3124
+
3125
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesPerformDiskShrinkRequest
3126
+
3127
+ # Converts hash and nil to an options object
3128
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3129
+
3130
+ # Customize the options with defaults
3131
+ call_metadata = @config.rpcs.perform_disk_shrink.metadata.to_h
3132
+
3133
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3134
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3135
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3136
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
3137
+ transports_version_send: [:rest]
3138
+
3139
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3140
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3141
+
3142
+ options.apply_defaults timeout: @config.rpcs.perform_disk_shrink.timeout,
3143
+ metadata: call_metadata,
3144
+ retry_policy: @config.rpcs.perform_disk_shrink.retry_policy
3145
+
3146
+ options.apply_defaults timeout: @config.timeout,
3147
+ metadata: @config.metadata,
3148
+ retry_policy: @config.retry_policy
3149
+
3150
+ @sql_instances_service_stub.perform_disk_shrink request, options do |result, operation|
3151
+ yield result, operation if block_given?
3152
+ end
3153
+ rescue ::Gapic::Rest::Error => e
3154
+ raise ::Google::Cloud::Error.from_error(e)
3155
+ end
3156
+
3157
+ ##
3158
+ # Get Disk Shrink Config for a given instance.
3159
+ #
3160
+ # @overload get_disk_shrink_config(request, options = nil)
3161
+ # Pass arguments to `get_disk_shrink_config` via a request object, either of type
3162
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesGetDiskShrinkConfigRequest} or an equivalent Hash.
3163
+ #
3164
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesGetDiskShrinkConfigRequest, ::Hash]
3165
+ # A request object representing the call parameters. Required. To specify no
3166
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3167
+ # @param options [::Gapic::CallOptions, ::Hash]
3168
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3169
+ #
3170
+ # @overload get_disk_shrink_config(instance: nil, project: nil)
3171
+ # Pass arguments to `get_disk_shrink_config` via keyword arguments. Note that at
3172
+ # least one keyword argument is required. To specify no parameters, or to keep all
3173
+ # the default parameter values, pass an empty Hash as a request object (see above).
3174
+ #
3175
+ # @param instance [::String]
3176
+ # Cloud SQL instance ID. This does not include the project ID.
3177
+ # @param project [::String]
3178
+ # Project ID of the project that contains the instance.
3179
+ # @yield [result, operation] Access the result along with the TransportOperation object
3180
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::SqlInstancesGetDiskShrinkConfigResponse]
3181
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3182
+ #
3183
+ # @return [::Google::Cloud::Sql::V1beta4::SqlInstancesGetDiskShrinkConfigResponse]
3184
+ #
3185
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3186
+ #
3187
+ # @example Basic example
3188
+ # require "google/cloud/sql/v1beta4"
3189
+ #
3190
+ # # Create a client object. The client can be reused for multiple calls.
3191
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
3192
+ #
3193
+ # # Create a request. To set request fields, pass in keyword arguments.
3194
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesGetDiskShrinkConfigRequest.new
3195
+ #
3196
+ # # Call the get_disk_shrink_config method.
3197
+ # result = client.get_disk_shrink_config request
3198
+ #
3199
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::SqlInstancesGetDiskShrinkConfigResponse.
3200
+ # p result
3201
+ #
3202
+ def get_disk_shrink_config request, options = nil
3203
+ raise ::ArgumentError, "request must be provided" if request.nil?
3204
+
3205
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesGetDiskShrinkConfigRequest
3206
+
3207
+ # Converts hash and nil to an options object
3208
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3209
+
3210
+ # Customize the options with defaults
3211
+ call_metadata = @config.rpcs.get_disk_shrink_config.metadata.to_h
3212
+
3213
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3214
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3215
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3216
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
3217
+ transports_version_send: [:rest]
3218
+
3219
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3220
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3221
+
3222
+ options.apply_defaults timeout: @config.rpcs.get_disk_shrink_config.timeout,
3223
+ metadata: call_metadata,
3224
+ retry_policy: @config.rpcs.get_disk_shrink_config.retry_policy
3225
+
3226
+ options.apply_defaults timeout: @config.timeout,
3227
+ metadata: @config.metadata,
3228
+ retry_policy: @config.retry_policy
3229
+
3230
+ @sql_instances_service_stub.get_disk_shrink_config request, options do |result, operation|
3231
+ yield result, operation if block_given?
3232
+ end
3233
+ rescue ::Gapic::Rest::Error => e
3234
+ raise ::Google::Cloud::Error.from_error(e)
3235
+ end
3236
+
3237
+ ##
3238
+ # Reset Replica Size to primary instance disk size.
3239
+ #
3240
+ # @overload reset_replica_size(request, options = nil)
3241
+ # Pass arguments to `reset_replica_size` via a request object, either of type
3242
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesResetReplicaSizeRequest} or an equivalent Hash.
3243
+ #
3244
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesResetReplicaSizeRequest, ::Hash]
3245
+ # A request object representing the call parameters. Required. To specify no
3246
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3247
+ # @param options [::Gapic::CallOptions, ::Hash]
3248
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3249
+ #
3250
+ # @overload reset_replica_size(instance: nil, project: nil)
3251
+ # Pass arguments to `reset_replica_size` via keyword arguments. Note that at
3252
+ # least one keyword argument is required. To specify no parameters, or to keep all
3253
+ # the default parameter values, pass an empty Hash as a request object (see above).
3254
+ #
3255
+ # @param instance [::String]
3256
+ # Cloud SQL read replica instance name.
3257
+ # @param project [::String]
3258
+ # ID of the project that contains the read replica.
3259
+ # @yield [result, operation] Access the result along with the TransportOperation object
3260
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
3261
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3262
+ #
3263
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
3264
+ #
3265
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3266
+ #
3267
+ # @example Basic example
3268
+ # require "google/cloud/sql/v1beta4"
3269
+ #
3270
+ # # Create a client object. The client can be reused for multiple calls.
3271
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
3272
+ #
3273
+ # # Create a request. To set request fields, pass in keyword arguments.
3274
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesResetReplicaSizeRequest.new
3275
+ #
3276
+ # # Call the reset_replica_size method.
3277
+ # result = client.reset_replica_size request
3278
+ #
3279
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
3280
+ # p result
3281
+ #
3282
+ def reset_replica_size request, options = nil
3283
+ raise ::ArgumentError, "request must be provided" if request.nil?
3284
+
3285
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesResetReplicaSizeRequest
3286
+
3287
+ # Converts hash and nil to an options object
3288
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3289
+
3290
+ # Customize the options with defaults
3291
+ call_metadata = @config.rpcs.reset_replica_size.metadata.to_h
3292
+
3293
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3294
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3295
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3296
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
3297
+ transports_version_send: [:rest]
3298
+
3299
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3300
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3301
+
3302
+ options.apply_defaults timeout: @config.rpcs.reset_replica_size.timeout,
3303
+ metadata: call_metadata,
3304
+ retry_policy: @config.rpcs.reset_replica_size.retry_policy
3305
+
3306
+ options.apply_defaults timeout: @config.timeout,
3307
+ metadata: @config.metadata,
3308
+ retry_policy: @config.retry_policy
3309
+
3310
+ @sql_instances_service_stub.reset_replica_size request, options do |result, operation|
3311
+ yield result, operation if block_given?
3312
+ end
3313
+ rescue ::Gapic::Rest::Error => e
3314
+ raise ::Google::Cloud::Error.from_error(e)
3315
+ end
3316
+
3317
+ ##
3318
+ # Get Latest Recovery Time for a given instance.
3319
+ #
3320
+ # @overload get_latest_recovery_time(request, options = nil)
3321
+ # Pass arguments to `get_latest_recovery_time` via a request object, either of type
3322
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesGetLatestRecoveryTimeRequest} or an equivalent Hash.
3323
+ #
3324
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesGetLatestRecoveryTimeRequest, ::Hash]
3325
+ # A request object representing the call parameters. Required. To specify no
3326
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3327
+ # @param options [::Gapic::CallOptions, ::Hash]
3328
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3329
+ #
3330
+ # @overload get_latest_recovery_time(instance: nil, project: nil, source_instance_deletion_time: nil)
3331
+ # Pass arguments to `get_latest_recovery_time` via keyword arguments. Note that at
3332
+ # least one keyword argument is required. To specify no parameters, or to keep all
3333
+ # the default parameter values, pass an empty Hash as a request object (see above).
3334
+ #
3335
+ # @param instance [::String]
3336
+ # Cloud SQL instance ID. This does not include the project ID.
3337
+ # @param project [::String]
3338
+ # Project ID of the project that contains the instance.
3339
+ # @param source_instance_deletion_time [::Google::Protobuf::Timestamp, ::Hash]
3340
+ # The timestamp used to identify the time when the source instance is
3341
+ # deleted. If this instance is deleted, then you must set the timestamp.
3342
+ # @yield [result, operation] Access the result along with the TransportOperation object
3343
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::SqlInstancesGetLatestRecoveryTimeResponse]
3344
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3345
+ #
3346
+ # @return [::Google::Cloud::Sql::V1beta4::SqlInstancesGetLatestRecoveryTimeResponse]
3347
+ #
3348
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3349
+ #
3350
+ # @example Basic example
3351
+ # require "google/cloud/sql/v1beta4"
3352
+ #
3353
+ # # Create a client object. The client can be reused for multiple calls.
3354
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
3355
+ #
3356
+ # # Create a request. To set request fields, pass in keyword arguments.
3357
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesGetLatestRecoveryTimeRequest.new
3358
+ #
3359
+ # # Call the get_latest_recovery_time method.
3360
+ # result = client.get_latest_recovery_time request
3361
+ #
3362
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::SqlInstancesGetLatestRecoveryTimeResponse.
3363
+ # p result
3364
+ #
3365
+ def get_latest_recovery_time request, options = nil
3366
+ raise ::ArgumentError, "request must be provided" if request.nil?
3367
+
3368
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesGetLatestRecoveryTimeRequest
3369
+
3370
+ # Converts hash and nil to an options object
3371
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3372
+
3373
+ # Customize the options with defaults
3374
+ call_metadata = @config.rpcs.get_latest_recovery_time.metadata.to_h
3375
+
3376
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3377
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3378
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3379
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
3380
+ transports_version_send: [:rest]
3381
+
3382
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3383
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3384
+
3385
+ options.apply_defaults timeout: @config.rpcs.get_latest_recovery_time.timeout,
3386
+ metadata: call_metadata,
3387
+ retry_policy: @config.rpcs.get_latest_recovery_time.retry_policy
3388
+
3389
+ options.apply_defaults timeout: @config.timeout,
3390
+ metadata: @config.metadata,
3391
+ retry_policy: @config.retry_policy
3392
+
3393
+ @sql_instances_service_stub.get_latest_recovery_time request, options do |result, operation|
3394
+ yield result, operation if block_given?
3395
+ end
3396
+ rescue ::Gapic::Rest::Error => e
3397
+ raise ::Google::Cloud::Error.from_error(e)
3398
+ end
3399
+
3400
+ ##
3401
+ # Execute SQL statements.
3402
+ #
3403
+ # @overload execute_sql(request, options = nil)
3404
+ # Pass arguments to `execute_sql` via a request object, either of type
3405
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesExecuteSqlRequest} or an equivalent Hash.
3406
+ #
3407
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesExecuteSqlRequest, ::Hash]
3408
+ # A request object representing the call parameters. Required. To specify no
3409
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3410
+ # @param options [::Gapic::CallOptions, ::Hash]
3411
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3412
+ #
3413
+ # @overload execute_sql(instance: nil, project: nil, body: nil)
3414
+ # Pass arguments to `execute_sql` via keyword arguments. Note that at
3415
+ # least one keyword argument is required. To specify no parameters, or to keep all
3416
+ # the default parameter values, pass an empty Hash as a request object (see above).
3417
+ #
3418
+ # @param instance [::String]
3419
+ # Required. Database instance ID. This does not include the project ID.
3420
+ # @param project [::String]
3421
+ # Required. Project ID of the project that contains the instance.
3422
+ # @param body [::Google::Cloud::Sql::V1beta4::ExecuteSqlPayload, ::Hash]
3423
+ # The request body.
3424
+ # @yield [result, operation] Access the result along with the TransportOperation object
3425
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::SqlInstancesExecuteSqlResponse]
3426
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3427
+ #
3428
+ # @return [::Google::Cloud::Sql::V1beta4::SqlInstancesExecuteSqlResponse]
3429
+ #
3430
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3431
+ #
3432
+ # @example Basic example
3433
+ # require "google/cloud/sql/v1beta4"
3434
+ #
3435
+ # # Create a client object. The client can be reused for multiple calls.
3436
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
3437
+ #
3438
+ # # Create a request. To set request fields, pass in keyword arguments.
3439
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesExecuteSqlRequest.new
3440
+ #
3441
+ # # Call the execute_sql method.
3442
+ # result = client.execute_sql request
3443
+ #
3444
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::SqlInstancesExecuteSqlResponse.
3445
+ # p result
3446
+ #
3447
+ def execute_sql request, options = nil
3448
+ raise ::ArgumentError, "request must be provided" if request.nil?
3449
+
3450
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesExecuteSqlRequest
3451
+
3452
+ # Converts hash and nil to an options object
3453
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3454
+
3455
+ # Customize the options with defaults
3456
+ call_metadata = @config.rpcs.execute_sql.metadata.to_h
3457
+
3458
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3459
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3460
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3461
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
3462
+ transports_version_send: [:rest]
3463
+
3464
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3465
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3466
+
3467
+ options.apply_defaults timeout: @config.rpcs.execute_sql.timeout,
3468
+ metadata: call_metadata,
3469
+ retry_policy: @config.rpcs.execute_sql.retry_policy
3470
+
3471
+ options.apply_defaults timeout: @config.timeout,
3472
+ metadata: @config.metadata,
3473
+ retry_policy: @config.retry_policy
3474
+
3475
+ @sql_instances_service_stub.execute_sql request, options do |result, operation|
3476
+ yield result, operation if block_given?
3477
+ end
3478
+ rescue ::Gapic::Rest::Error => e
3479
+ raise ::Google::Cloud::Error.from_error(e)
3480
+ end
3481
+
3482
+ ##
3483
+ # Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
3484
+ #
3485
+ # @overload acquire_ssrs_lease(request, options = nil)
3486
+ # Pass arguments to `acquire_ssrs_lease` via a request object, either of type
3487
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesAcquireSsrsLeaseRequest} or an equivalent Hash.
3488
+ #
3489
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesAcquireSsrsLeaseRequest, ::Hash]
3490
+ # A request object representing the call parameters. Required. To specify no
3491
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3492
+ # @param options [::Gapic::CallOptions, ::Hash]
3493
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3494
+ #
3495
+ # @overload acquire_ssrs_lease(instance: nil, project: nil, body: nil)
3496
+ # Pass arguments to `acquire_ssrs_lease` via keyword arguments. Note that at
3497
+ # least one keyword argument is required. To specify no parameters, or to keep all
3498
+ # the default parameter values, pass an empty Hash as a request object (see above).
3499
+ #
3500
+ # @param instance [::String]
3501
+ # Required. Cloud SQL instance ID. This doesn't include the project ID. It's
3502
+ # composed of lowercase letters, numbers, and hyphens, and it must start with
3503
+ # a letter. The total length must be 98 characters or less (Example:
3504
+ # instance-id).
3505
+ # @param project [::String]
3506
+ # Required. ID of the project that contains the instance (Example:
3507
+ # project-id).
3508
+ # @param body [::Google::Cloud::Sql::V1beta4::InstancesAcquireSsrsLeaseRequest, ::Hash]
3509
+ # The body for request to acquire an SSRS lease.
3510
+ # @yield [result, operation] Access the result along with the TransportOperation object
3511
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::SqlInstancesAcquireSsrsLeaseResponse]
3512
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3513
+ #
3514
+ # @return [::Google::Cloud::Sql::V1beta4::SqlInstancesAcquireSsrsLeaseResponse]
3515
+ #
3516
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3517
+ #
3518
+ # @example Basic example
3519
+ # require "google/cloud/sql/v1beta4"
3520
+ #
3521
+ # # Create a client object. The client can be reused for multiple calls.
3522
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
3523
+ #
3524
+ # # Create a request. To set request fields, pass in keyword arguments.
3525
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesAcquireSsrsLeaseRequest.new
3526
+ #
3527
+ # # Call the acquire_ssrs_lease method.
3528
+ # result = client.acquire_ssrs_lease request
3529
+ #
3530
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::SqlInstancesAcquireSsrsLeaseResponse.
3531
+ # p result
3532
+ #
3533
+ def acquire_ssrs_lease request, options = nil
3534
+ raise ::ArgumentError, "request must be provided" if request.nil?
3535
+
3536
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesAcquireSsrsLeaseRequest
3537
+
3538
+ # Converts hash and nil to an options object
3539
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3540
+
3541
+ # Customize the options with defaults
3542
+ call_metadata = @config.rpcs.acquire_ssrs_lease.metadata.to_h
3543
+
3544
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3545
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3546
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3547
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
3548
+ transports_version_send: [:rest]
3549
+
3550
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3551
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3552
+
3553
+ options.apply_defaults timeout: @config.rpcs.acquire_ssrs_lease.timeout,
3554
+ metadata: call_metadata,
3555
+ retry_policy: @config.rpcs.acquire_ssrs_lease.retry_policy
3556
+
3557
+ options.apply_defaults timeout: @config.timeout,
3558
+ metadata: @config.metadata,
3559
+ retry_policy: @config.retry_policy
3560
+
3561
+ @sql_instances_service_stub.acquire_ssrs_lease request, options do |result, operation|
3562
+ yield result, operation if block_given?
3563
+ end
3564
+ rescue ::Gapic::Rest::Error => e
3565
+ raise ::Google::Cloud::Error.from_error(e)
3566
+ end
3567
+
3568
+ ##
3569
+ # Release a lease for the setup of SQL Server Reporting Services (SSRS).
3570
+ #
3571
+ # @overload release_ssrs_lease(request, options = nil)
3572
+ # Pass arguments to `release_ssrs_lease` via a request object, either of type
3573
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesReleaseSsrsLeaseRequest} or an equivalent Hash.
3574
+ #
3575
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesReleaseSsrsLeaseRequest, ::Hash]
3576
+ # A request object representing the call parameters. Required. To specify no
3577
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3578
+ # @param options [::Gapic::CallOptions, ::Hash]
3579
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3580
+ #
3581
+ # @overload release_ssrs_lease(instance: nil, project: nil)
3582
+ # Pass arguments to `release_ssrs_lease` via keyword arguments. Note that at
3583
+ # least one keyword argument is required. To specify no parameters, or to keep all
3584
+ # the default parameter values, pass an empty Hash as a request object (see above).
3585
+ #
3586
+ # @param instance [::String]
3587
+ # Required. The Cloud SQL instance ID. This doesn't include the project ID.
3588
+ # It's composed of lowercase letters, numbers, and hyphens, and it must start
3589
+ # with a letter. The total length must be 98 characters or less (Example:
3590
+ # instance-id).
3591
+ # @param project [::String]
3592
+ # Required. The ID of the project that contains the instance (Example:
3593
+ # project-id).
3594
+ # @yield [result, operation] Access the result along with the TransportOperation object
3595
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::SqlInstancesReleaseSsrsLeaseResponse]
3596
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3597
+ #
3598
+ # @return [::Google::Cloud::Sql::V1beta4::SqlInstancesReleaseSsrsLeaseResponse]
3599
+ #
3600
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3601
+ #
3602
+ # @example Basic example
3603
+ # require "google/cloud/sql/v1beta4"
3604
+ #
3605
+ # # Create a client object. The client can be reused for multiple calls.
3606
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
3607
+ #
3608
+ # # Create a request. To set request fields, pass in keyword arguments.
3609
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesReleaseSsrsLeaseRequest.new
3610
+ #
3611
+ # # Call the release_ssrs_lease method.
3612
+ # result = client.release_ssrs_lease request
3613
+ #
3614
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::SqlInstancesReleaseSsrsLeaseResponse.
3615
+ # p result
3616
+ #
3617
+ def release_ssrs_lease request, options = nil
3618
+ raise ::ArgumentError, "request must be provided" if request.nil?
3619
+
3620
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesReleaseSsrsLeaseRequest
3621
+
3622
+ # Converts hash and nil to an options object
3623
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3624
+
3625
+ # Customize the options with defaults
3626
+ call_metadata = @config.rpcs.release_ssrs_lease.metadata.to_h
3627
+
3628
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3629
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3630
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3631
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
3632
+ transports_version_send: [:rest]
3633
+
3634
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3635
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3636
+
3637
+ options.apply_defaults timeout: @config.rpcs.release_ssrs_lease.timeout,
3638
+ metadata: call_metadata,
3639
+ retry_policy: @config.rpcs.release_ssrs_lease.retry_policy
3640
+
3641
+ options.apply_defaults timeout: @config.timeout,
3642
+ metadata: @config.metadata,
3643
+ retry_policy: @config.retry_policy
3644
+
3645
+ @sql_instances_service_stub.release_ssrs_lease request, options do |result, operation|
3646
+ yield result, operation if block_given?
3647
+ end
3648
+ rescue ::Gapic::Rest::Error => e
3649
+ raise ::Google::Cloud::Error.from_error(e)
3650
+ end
3651
+
3652
+ ##
3653
+ # Execute MVU Pre-checks
3654
+ #
3655
+ # @overload pre_check_major_version_upgrade(request, options = nil)
3656
+ # Pass arguments to `pre_check_major_version_upgrade` via a request object, either of type
3657
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesPreCheckMajorVersionUpgradeRequest} or an equivalent Hash.
3658
+ #
3659
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesPreCheckMajorVersionUpgradeRequest, ::Hash]
3660
+ # A request object representing the call parameters. Required. To specify no
3661
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3662
+ # @param options [::Gapic::CallOptions, ::Hash]
3663
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3664
+ #
3665
+ # @overload pre_check_major_version_upgrade(instance: nil, project: nil, body: nil)
3666
+ # Pass arguments to `pre_check_major_version_upgrade` via keyword arguments. Note that at
3667
+ # least one keyword argument is required. To specify no parameters, or to keep all
3668
+ # the default parameter values, pass an empty Hash as a request object (see above).
3669
+ #
3670
+ # @param instance [::String]
3671
+ # Required. Cloud SQL instance ID. This does not include the project ID.
3672
+ # @param project [::String]
3673
+ # Required. Project ID of the project that contains the instance.
3674
+ # @param body [::Google::Cloud::Sql::V1beta4::InstancesPreCheckMajorVersionUpgradeRequest, ::Hash]
3675
+ # Required. The context for request to perform the pre-check major version
3676
+ # upgrade operation.
3677
+ # @yield [result, operation] Access the result along with the TransportOperation object
3678
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
3679
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3680
+ #
3681
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
3682
+ #
3683
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3684
+ #
3685
+ # @example Basic example
3686
+ # require "google/cloud/sql/v1beta4"
3687
+ #
3688
+ # # Create a client object. The client can be reused for multiple calls.
3689
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
3690
+ #
3691
+ # # Create a request. To set request fields, pass in keyword arguments.
3692
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesPreCheckMajorVersionUpgradeRequest.new
3693
+ #
3694
+ # # Call the pre_check_major_version_upgrade method.
3695
+ # result = client.pre_check_major_version_upgrade request
3696
+ #
3697
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
3698
+ # p result
3699
+ #
3700
+ def pre_check_major_version_upgrade request, options = nil
3701
+ raise ::ArgumentError, "request must be provided" if request.nil?
3702
+
3703
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesPreCheckMajorVersionUpgradeRequest
3704
+
3705
+ # Converts hash and nil to an options object
3706
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3707
+
3708
+ # Customize the options with defaults
3709
+ call_metadata = @config.rpcs.pre_check_major_version_upgrade.metadata.to_h
3710
+
3711
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3712
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3713
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3714
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
3715
+ transports_version_send: [:rest]
3716
+
3717
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3718
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3719
+
3720
+ options.apply_defaults timeout: @config.rpcs.pre_check_major_version_upgrade.timeout,
3721
+ metadata: call_metadata,
3722
+ retry_policy: @config.rpcs.pre_check_major_version_upgrade.retry_policy
3723
+
3724
+ options.apply_defaults timeout: @config.timeout,
3725
+ metadata: @config.metadata,
3726
+ retry_policy: @config.retry_policy
3727
+
3728
+ @sql_instances_service_stub.pre_check_major_version_upgrade request, options do |result, operation|
3729
+ yield result, operation if block_given?
3730
+ end
3731
+ rescue ::Gapic::Rest::Error => e
3732
+ raise ::Google::Cloud::Error.from_error(e)
3733
+ end
3734
+
3735
+ ##
3736
+ # Point in time restore for an instance managed by Google Cloud Backup and
3737
+ # Disaster Recovery.
3738
+ #
3739
+ # @overload point_in_time_restore(request, options = nil)
3740
+ # Pass arguments to `point_in_time_restore` via a request object, either of type
3741
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesPointInTimeRestoreRequest} or an equivalent Hash.
3742
+ #
3743
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlInstancesPointInTimeRestoreRequest, ::Hash]
3744
+ # A request object representing the call parameters. Required. To specify no
3745
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3746
+ # @param options [::Gapic::CallOptions, ::Hash]
3747
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
3748
+ #
3749
+ # @overload point_in_time_restore(parent: nil, context: nil)
3750
+ # Pass arguments to `point_in_time_restore` via keyword arguments. Note that at
3751
+ # least one keyword argument is required. To specify no parameters, or to keep all
3752
+ # the default parameter values, pass an empty Hash as a request object (see above).
3753
+ #
3754
+ # @param parent [::String]
3755
+ # Required. The parent resource where you created this instance.
3756
+ # Format: projects/\\{project}
3757
+ # @param context [::Google::Cloud::Sql::V1beta4::PointInTimeRestoreContext, ::Hash]
3758
+ # Required. The context for request to perform a PITR on a Google Cloud
3759
+ # Backup and Disaster Recovery managed instance.
3760
+ # @yield [result, operation] Access the result along with the TransportOperation object
3761
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
3762
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
3763
+ #
3764
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
3765
+ #
3766
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
3767
+ #
3768
+ # @example Basic example
3769
+ # require "google/cloud/sql/v1beta4"
3770
+ #
3771
+ # # Create a client object. The client can be reused for multiple calls.
3772
+ # client = Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new
3773
+ #
3774
+ # # Create a request. To set request fields, pass in keyword arguments.
3775
+ # request = Google::Cloud::Sql::V1beta4::SqlInstancesPointInTimeRestoreRequest.new
3776
+ #
3777
+ # # Call the point_in_time_restore method.
3778
+ # result = client.point_in_time_restore request
3779
+ #
3780
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
3781
+ # p result
3782
+ #
3783
+ def point_in_time_restore request, options = nil
3784
+ raise ::ArgumentError, "request must be provided" if request.nil?
3785
+
3786
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlInstancesPointInTimeRestoreRequest
3787
+
3788
+ # Converts hash and nil to an options object
3789
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3790
+
3791
+ # Customize the options with defaults
3792
+ call_metadata = @config.rpcs.point_in_time_restore.metadata.to_h
3793
+
3794
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3795
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3796
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3797
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
3798
+ transports_version_send: [:rest]
3799
+
3800
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3801
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3802
+
3803
+ options.apply_defaults timeout: @config.rpcs.point_in_time_restore.timeout,
3804
+ metadata: call_metadata,
3805
+ retry_policy: @config.rpcs.point_in_time_restore.retry_policy
3806
+
3807
+ options.apply_defaults timeout: @config.timeout,
3808
+ metadata: @config.metadata,
3809
+ retry_policy: @config.retry_policy
3810
+
3811
+ @sql_instances_service_stub.point_in_time_restore request, options do |result, operation|
3812
+ yield result, operation if block_given?
3813
+ end
3814
+ rescue ::Gapic::Rest::Error => e
3815
+ raise ::Google::Cloud::Error.from_error(e)
3816
+ end
3817
+
3818
+ ##
3819
+ # Configuration class for the SqlInstancesService REST API.
3820
+ #
3821
+ # This class represents the configuration for SqlInstancesService REST,
3822
+ # providing control over timeouts, retry behavior, logging, transport
3823
+ # parameters, and other low-level controls. Certain parameters can also be
3824
+ # applied individually to specific RPCs. See
3825
+ # {::Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client::Configuration::Rpcs}
3826
+ # for a list of RPCs that can be configured independently.
3827
+ #
3828
+ # Configuration can be applied globally to all clients, or to a single client
3829
+ # on construction.
3830
+ #
3831
+ # @example
3832
+ #
3833
+ # # Modify the global config, setting the timeout for
3834
+ # # add_server_ca to 20 seconds,
3835
+ # # and all remaining timeouts to 10 seconds.
3836
+ # ::Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.configure do |config|
3837
+ # config.timeout = 10.0
3838
+ # config.rpcs.add_server_ca.timeout = 20.0
3839
+ # end
3840
+ #
3841
+ # # Apply the above configuration only to a new client.
3842
+ # client = ::Google::Cloud::Sql::V1beta4::SqlInstancesService::Rest::Client.new do |config|
3843
+ # config.timeout = 10.0
3844
+ # config.rpcs.add_server_ca.timeout = 20.0
3845
+ # end
3846
+ #
3847
+ # @!attribute [rw] endpoint
3848
+ # A custom service endpoint, as a hostname or hostname:port. The default is
3849
+ # nil, indicating to use the default endpoint in the current universe domain.
3850
+ # @return [::String,nil]
3851
+ # @!attribute [rw] credentials
3852
+ # Credentials to send with calls. You may provide any of the following types:
3853
+ # * (`String`) The path to a service account key file in JSON format
3854
+ # * (`Hash`) A service account key as a Hash
3855
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
3856
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
3857
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
3858
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
3859
+ # * (`nil`) indicating no credentials
3860
+ #
3861
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
3862
+ # external source for authentication to Google Cloud, you must validate it before
3863
+ # providing it to a Google API client library. Providing an unvalidated credential
3864
+ # configuration to Google APIs can compromise the security of your systems and data.
3865
+ # For more information, refer to [Validate credential configurations from external
3866
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
3867
+ # @return [::Object]
3868
+ # @!attribute [rw] scope
3869
+ # The OAuth scopes
3870
+ # @return [::Array<::String>]
3871
+ # @!attribute [rw] lib_name
3872
+ # The library name as recorded in instrumentation and logging
3873
+ # @return [::String]
3874
+ # @!attribute [rw] lib_version
3875
+ # The library version as recorded in instrumentation and logging
3876
+ # @return [::String]
3877
+ # @!attribute [rw] timeout
3878
+ # The call timeout in seconds.
3879
+ # @return [::Numeric]
3880
+ # @!attribute [rw] metadata
3881
+ # Additional headers to be sent with the call.
3882
+ # @return [::Hash{::Symbol=>::String}]
3883
+ # @!attribute [rw] retry_policy
3884
+ # The retry policy. The value is a hash with the following keys:
3885
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3886
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3887
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3888
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
3889
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3890
+ # trigger a retry.
3891
+ # @return [::Hash]
3892
+ # @!attribute [rw] quota_project
3893
+ # A separate project against which to charge quota.
3894
+ # @return [::String]
3895
+ # @!attribute [rw] universe_domain
3896
+ # The universe domain within which to make requests. This determines the
3897
+ # default endpoint URL. The default value of nil uses the environment
3898
+ # universe (usually the default "googleapis.com" universe).
3899
+ # @return [::String,nil]
3900
+ # @!attribute [rw] logger
3901
+ # A custom logger to use for request/response debug logging, or the value
3902
+ # `:default` (the default) to construct a default logger, or `nil` to
3903
+ # explicitly disable logging.
3904
+ # @return [::Logger,:default,nil]
3905
+ #
3906
+ class Configuration
3907
+ extend ::Gapic::Config
3908
+
3909
+ # @private
3910
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
3911
+ DEFAULT_ENDPOINT = "sqladmin.googleapis.com"
3912
+
3913
+ config_attr :endpoint, nil, ::String, nil
3914
+ config_attr :credentials, nil do |value|
3915
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
3916
+ allowed.any? { |klass| klass === value }
3917
+ end
3918
+ config_attr :scope, nil, ::String, ::Array, nil
3919
+ config_attr :lib_name, nil, ::String, nil
3920
+ config_attr :lib_version, nil, ::String, nil
3921
+ config_attr :timeout, nil, ::Numeric, nil
3922
+ config_attr :metadata, nil, ::Hash, nil
3923
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
3924
+ config_attr :quota_project, nil, ::String, nil
3925
+ config_attr :universe_domain, nil, ::String, nil
3926
+ config_attr :logger, :default, ::Logger, nil, :default
3927
+
3928
+ # @private
3929
+ def initialize parent_config = nil
3930
+ @parent_config = parent_config unless parent_config.nil?
3931
+
3932
+ yield self if block_given?
3933
+ end
3934
+
3935
+ ##
3936
+ # Configurations for individual RPCs
3937
+ # @return [Rpcs]
3938
+ #
3939
+ def rpcs
3940
+ @rpcs ||= begin
3941
+ parent_rpcs = nil
3942
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
3943
+ Rpcs.new parent_rpcs
3944
+ end
3945
+ end
3946
+
3947
+ ##
3948
+ # Configuration RPC class for the SqlInstancesService API.
3949
+ #
3950
+ # Includes fields providing the configuration for each RPC in this service.
3951
+ # Each configuration object is of type `Gapic::Config::Method` and includes
3952
+ # the following configuration fields:
3953
+ #
3954
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
3955
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
3956
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
3957
+ # include the following keys:
3958
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
3959
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
3960
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
3961
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
3962
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
3963
+ # trigger a retry.
3964
+ #
3965
+ class Rpcs
3966
+ ##
3967
+ # RPC-specific configuration for `add_server_ca`
3968
+ # @return [::Gapic::Config::Method]
3969
+ #
3970
+ attr_reader :add_server_ca
3971
+ ##
3972
+ # RPC-specific configuration for `add_server_certificate`
3973
+ # @return [::Gapic::Config::Method]
3974
+ #
3975
+ attr_reader :add_server_certificate
3976
+ ##
3977
+ # RPC-specific configuration for `add_entra_id_certificate`
3978
+ # @return [::Gapic::Config::Method]
3979
+ #
3980
+ attr_reader :add_entra_id_certificate
3981
+ ##
3982
+ # RPC-specific configuration for `call_clone`
3983
+ # @return [::Gapic::Config::Method]
3984
+ #
3985
+ attr_reader :call_clone
3986
+ ##
3987
+ # RPC-specific configuration for `delete`
3988
+ # @return [::Gapic::Config::Method]
3989
+ #
3990
+ attr_reader :delete
3991
+ ##
3992
+ # RPC-specific configuration for `demote_master`
3993
+ # @return [::Gapic::Config::Method]
3994
+ #
3995
+ attr_reader :demote_master
3996
+ ##
3997
+ # RPC-specific configuration for `demote`
3998
+ # @return [::Gapic::Config::Method]
3999
+ #
4000
+ attr_reader :demote
4001
+ ##
4002
+ # RPC-specific configuration for `export`
4003
+ # @return [::Gapic::Config::Method]
4004
+ #
4005
+ attr_reader :export
4006
+ ##
4007
+ # RPC-specific configuration for `failover`
4008
+ # @return [::Gapic::Config::Method]
4009
+ #
4010
+ attr_reader :failover
4011
+ ##
4012
+ # RPC-specific configuration for `reencrypt`
4013
+ # @return [::Gapic::Config::Method]
4014
+ #
4015
+ attr_reader :reencrypt
4016
+ ##
4017
+ # RPC-specific configuration for `get`
4018
+ # @return [::Gapic::Config::Method]
4019
+ #
4020
+ attr_reader :get
4021
+ ##
4022
+ # RPC-specific configuration for `import`
4023
+ # @return [::Gapic::Config::Method]
4024
+ #
4025
+ attr_reader :import
4026
+ ##
4027
+ # RPC-specific configuration for `insert`
4028
+ # @return [::Gapic::Config::Method]
4029
+ #
4030
+ attr_reader :insert
4031
+ ##
4032
+ # RPC-specific configuration for `list`
4033
+ # @return [::Gapic::Config::Method]
4034
+ #
4035
+ attr_reader :list
4036
+ ##
4037
+ # RPC-specific configuration for `list_server_cas`
4038
+ # @return [::Gapic::Config::Method]
4039
+ #
4040
+ attr_reader :list_server_cas
4041
+ ##
4042
+ # RPC-specific configuration for `list_server_certificates`
4043
+ # @return [::Gapic::Config::Method]
4044
+ #
4045
+ attr_reader :list_server_certificates
4046
+ ##
4047
+ # RPC-specific configuration for `list_entra_id_certificates`
4048
+ # @return [::Gapic::Config::Method]
4049
+ #
4050
+ attr_reader :list_entra_id_certificates
4051
+ ##
4052
+ # RPC-specific configuration for `patch`
4053
+ # @return [::Gapic::Config::Method]
4054
+ #
4055
+ attr_reader :patch
4056
+ ##
4057
+ # RPC-specific configuration for `promote_replica`
4058
+ # @return [::Gapic::Config::Method]
4059
+ #
4060
+ attr_reader :promote_replica
4061
+ ##
4062
+ # RPC-specific configuration for `switchover`
4063
+ # @return [::Gapic::Config::Method]
4064
+ #
4065
+ attr_reader :switchover
4066
+ ##
4067
+ # RPC-specific configuration for `reset_ssl_config`
4068
+ # @return [::Gapic::Config::Method]
4069
+ #
4070
+ attr_reader :reset_ssl_config
4071
+ ##
4072
+ # RPC-specific configuration for `restart`
4073
+ # @return [::Gapic::Config::Method]
4074
+ #
4075
+ attr_reader :restart
4076
+ ##
4077
+ # RPC-specific configuration for `restore_backup`
4078
+ # @return [::Gapic::Config::Method]
4079
+ #
4080
+ attr_reader :restore_backup
4081
+ ##
4082
+ # RPC-specific configuration for `rotate_server_ca`
4083
+ # @return [::Gapic::Config::Method]
4084
+ #
4085
+ attr_reader :rotate_server_ca
4086
+ ##
4087
+ # RPC-specific configuration for `rotate_server_certificate`
4088
+ # @return [::Gapic::Config::Method]
4089
+ #
4090
+ attr_reader :rotate_server_certificate
4091
+ ##
4092
+ # RPC-specific configuration for `rotate_entra_id_certificate`
4093
+ # @return [::Gapic::Config::Method]
4094
+ #
4095
+ attr_reader :rotate_entra_id_certificate
4096
+ ##
4097
+ # RPC-specific configuration for `start_replica`
4098
+ # @return [::Gapic::Config::Method]
4099
+ #
4100
+ attr_reader :start_replica
4101
+ ##
4102
+ # RPC-specific configuration for `stop_replica`
4103
+ # @return [::Gapic::Config::Method]
4104
+ #
4105
+ attr_reader :stop_replica
4106
+ ##
4107
+ # RPC-specific configuration for `truncate_log`
4108
+ # @return [::Gapic::Config::Method]
4109
+ #
4110
+ attr_reader :truncate_log
4111
+ ##
4112
+ # RPC-specific configuration for `update`
4113
+ # @return [::Gapic::Config::Method]
4114
+ #
4115
+ attr_reader :update
4116
+ ##
4117
+ # RPC-specific configuration for `create_ephemeral`
4118
+ # @return [::Gapic::Config::Method]
4119
+ #
4120
+ attr_reader :create_ephemeral
4121
+ ##
4122
+ # RPC-specific configuration for `reschedule_maintenance`
4123
+ # @return [::Gapic::Config::Method]
4124
+ #
4125
+ attr_reader :reschedule_maintenance
4126
+ ##
4127
+ # RPC-specific configuration for `verify_external_sync_settings`
4128
+ # @return [::Gapic::Config::Method]
4129
+ #
4130
+ attr_reader :verify_external_sync_settings
4131
+ ##
4132
+ # RPC-specific configuration for `start_external_sync`
4133
+ # @return [::Gapic::Config::Method]
4134
+ #
4135
+ attr_reader :start_external_sync
4136
+ ##
4137
+ # RPC-specific configuration for `perform_disk_shrink`
4138
+ # @return [::Gapic::Config::Method]
4139
+ #
4140
+ attr_reader :perform_disk_shrink
4141
+ ##
4142
+ # RPC-specific configuration for `get_disk_shrink_config`
4143
+ # @return [::Gapic::Config::Method]
4144
+ #
4145
+ attr_reader :get_disk_shrink_config
4146
+ ##
4147
+ # RPC-specific configuration for `reset_replica_size`
4148
+ # @return [::Gapic::Config::Method]
4149
+ #
4150
+ attr_reader :reset_replica_size
4151
+ ##
4152
+ # RPC-specific configuration for `get_latest_recovery_time`
4153
+ # @return [::Gapic::Config::Method]
4154
+ #
4155
+ attr_reader :get_latest_recovery_time
4156
+ ##
4157
+ # RPC-specific configuration for `execute_sql`
4158
+ # @return [::Gapic::Config::Method]
4159
+ #
4160
+ attr_reader :execute_sql
4161
+ ##
4162
+ # RPC-specific configuration for `acquire_ssrs_lease`
4163
+ # @return [::Gapic::Config::Method]
4164
+ #
4165
+ attr_reader :acquire_ssrs_lease
4166
+ ##
4167
+ # RPC-specific configuration for `release_ssrs_lease`
4168
+ # @return [::Gapic::Config::Method]
4169
+ #
4170
+ attr_reader :release_ssrs_lease
4171
+ ##
4172
+ # RPC-specific configuration for `pre_check_major_version_upgrade`
4173
+ # @return [::Gapic::Config::Method]
4174
+ #
4175
+ attr_reader :pre_check_major_version_upgrade
4176
+ ##
4177
+ # RPC-specific configuration for `point_in_time_restore`
4178
+ # @return [::Gapic::Config::Method]
4179
+ #
4180
+ attr_reader :point_in_time_restore
4181
+
4182
+ # @private
4183
+ def initialize parent_rpcs = nil
4184
+ add_server_ca_config = parent_rpcs.add_server_ca if parent_rpcs.respond_to? :add_server_ca
4185
+ @add_server_ca = ::Gapic::Config::Method.new add_server_ca_config
4186
+ add_server_certificate_config = parent_rpcs.add_server_certificate if parent_rpcs.respond_to? :add_server_certificate
4187
+ @add_server_certificate = ::Gapic::Config::Method.new add_server_certificate_config
4188
+ add_entra_id_certificate_config = parent_rpcs.add_entra_id_certificate if parent_rpcs.respond_to? :add_entra_id_certificate
4189
+ @add_entra_id_certificate = ::Gapic::Config::Method.new add_entra_id_certificate_config
4190
+ call_clone_config = parent_rpcs.call_clone if parent_rpcs.respond_to? :call_clone
4191
+ @call_clone = ::Gapic::Config::Method.new call_clone_config
4192
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
4193
+ @delete = ::Gapic::Config::Method.new delete_config
4194
+ demote_master_config = parent_rpcs.demote_master if parent_rpcs.respond_to? :demote_master
4195
+ @demote_master = ::Gapic::Config::Method.new demote_master_config
4196
+ demote_config = parent_rpcs.demote if parent_rpcs.respond_to? :demote
4197
+ @demote = ::Gapic::Config::Method.new demote_config
4198
+ export_config = parent_rpcs.export if parent_rpcs.respond_to? :export
4199
+ @export = ::Gapic::Config::Method.new export_config
4200
+ failover_config = parent_rpcs.failover if parent_rpcs.respond_to? :failover
4201
+ @failover = ::Gapic::Config::Method.new failover_config
4202
+ reencrypt_config = parent_rpcs.reencrypt if parent_rpcs.respond_to? :reencrypt
4203
+ @reencrypt = ::Gapic::Config::Method.new reencrypt_config
4204
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
4205
+ @get = ::Gapic::Config::Method.new get_config
4206
+ import_config = parent_rpcs.import if parent_rpcs.respond_to? :import
4207
+ @import = ::Gapic::Config::Method.new import_config
4208
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
4209
+ @insert = ::Gapic::Config::Method.new insert_config
4210
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
4211
+ @list = ::Gapic::Config::Method.new list_config
4212
+ list_server_cas_config = parent_rpcs.list_server_cas if parent_rpcs.respond_to? :list_server_cas
4213
+ @list_server_cas = ::Gapic::Config::Method.new list_server_cas_config
4214
+ list_server_certificates_config = parent_rpcs.list_server_certificates if parent_rpcs.respond_to? :list_server_certificates
4215
+ @list_server_certificates = ::Gapic::Config::Method.new list_server_certificates_config
4216
+ list_entra_id_certificates_config = parent_rpcs.list_entra_id_certificates if parent_rpcs.respond_to? :list_entra_id_certificates
4217
+ @list_entra_id_certificates = ::Gapic::Config::Method.new list_entra_id_certificates_config
4218
+ patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
4219
+ @patch = ::Gapic::Config::Method.new patch_config
4220
+ promote_replica_config = parent_rpcs.promote_replica if parent_rpcs.respond_to? :promote_replica
4221
+ @promote_replica = ::Gapic::Config::Method.new promote_replica_config
4222
+ switchover_config = parent_rpcs.switchover if parent_rpcs.respond_to? :switchover
4223
+ @switchover = ::Gapic::Config::Method.new switchover_config
4224
+ reset_ssl_config_config = parent_rpcs.reset_ssl_config if parent_rpcs.respond_to? :reset_ssl_config
4225
+ @reset_ssl_config = ::Gapic::Config::Method.new reset_ssl_config_config
4226
+ restart_config = parent_rpcs.restart if parent_rpcs.respond_to? :restart
4227
+ @restart = ::Gapic::Config::Method.new restart_config
4228
+ restore_backup_config = parent_rpcs.restore_backup if parent_rpcs.respond_to? :restore_backup
4229
+ @restore_backup = ::Gapic::Config::Method.new restore_backup_config
4230
+ rotate_server_ca_config = parent_rpcs.rotate_server_ca if parent_rpcs.respond_to? :rotate_server_ca
4231
+ @rotate_server_ca = ::Gapic::Config::Method.new rotate_server_ca_config
4232
+ rotate_server_certificate_config = parent_rpcs.rotate_server_certificate if parent_rpcs.respond_to? :rotate_server_certificate
4233
+ @rotate_server_certificate = ::Gapic::Config::Method.new rotate_server_certificate_config
4234
+ rotate_entra_id_certificate_config = parent_rpcs.rotate_entra_id_certificate if parent_rpcs.respond_to? :rotate_entra_id_certificate
4235
+ @rotate_entra_id_certificate = ::Gapic::Config::Method.new rotate_entra_id_certificate_config
4236
+ start_replica_config = parent_rpcs.start_replica if parent_rpcs.respond_to? :start_replica
4237
+ @start_replica = ::Gapic::Config::Method.new start_replica_config
4238
+ stop_replica_config = parent_rpcs.stop_replica if parent_rpcs.respond_to? :stop_replica
4239
+ @stop_replica = ::Gapic::Config::Method.new stop_replica_config
4240
+ truncate_log_config = parent_rpcs.truncate_log if parent_rpcs.respond_to? :truncate_log
4241
+ @truncate_log = ::Gapic::Config::Method.new truncate_log_config
4242
+ update_config = parent_rpcs.update if parent_rpcs.respond_to? :update
4243
+ @update = ::Gapic::Config::Method.new update_config
4244
+ create_ephemeral_config = parent_rpcs.create_ephemeral if parent_rpcs.respond_to? :create_ephemeral
4245
+ @create_ephemeral = ::Gapic::Config::Method.new create_ephemeral_config
4246
+ reschedule_maintenance_config = parent_rpcs.reschedule_maintenance if parent_rpcs.respond_to? :reschedule_maintenance
4247
+ @reschedule_maintenance = ::Gapic::Config::Method.new reschedule_maintenance_config
4248
+ verify_external_sync_settings_config = parent_rpcs.verify_external_sync_settings if parent_rpcs.respond_to? :verify_external_sync_settings
4249
+ @verify_external_sync_settings = ::Gapic::Config::Method.new verify_external_sync_settings_config
4250
+ start_external_sync_config = parent_rpcs.start_external_sync if parent_rpcs.respond_to? :start_external_sync
4251
+ @start_external_sync = ::Gapic::Config::Method.new start_external_sync_config
4252
+ perform_disk_shrink_config = parent_rpcs.perform_disk_shrink if parent_rpcs.respond_to? :perform_disk_shrink
4253
+ @perform_disk_shrink = ::Gapic::Config::Method.new perform_disk_shrink_config
4254
+ get_disk_shrink_config_config = parent_rpcs.get_disk_shrink_config if parent_rpcs.respond_to? :get_disk_shrink_config
4255
+ @get_disk_shrink_config = ::Gapic::Config::Method.new get_disk_shrink_config_config
4256
+ reset_replica_size_config = parent_rpcs.reset_replica_size if parent_rpcs.respond_to? :reset_replica_size
4257
+ @reset_replica_size = ::Gapic::Config::Method.new reset_replica_size_config
4258
+ get_latest_recovery_time_config = parent_rpcs.get_latest_recovery_time if parent_rpcs.respond_to? :get_latest_recovery_time
4259
+ @get_latest_recovery_time = ::Gapic::Config::Method.new get_latest_recovery_time_config
4260
+ execute_sql_config = parent_rpcs.execute_sql if parent_rpcs.respond_to? :execute_sql
4261
+ @execute_sql = ::Gapic::Config::Method.new execute_sql_config
4262
+ acquire_ssrs_lease_config = parent_rpcs.acquire_ssrs_lease if parent_rpcs.respond_to? :acquire_ssrs_lease
4263
+ @acquire_ssrs_lease = ::Gapic::Config::Method.new acquire_ssrs_lease_config
4264
+ release_ssrs_lease_config = parent_rpcs.release_ssrs_lease if parent_rpcs.respond_to? :release_ssrs_lease
4265
+ @release_ssrs_lease = ::Gapic::Config::Method.new release_ssrs_lease_config
4266
+ pre_check_major_version_upgrade_config = parent_rpcs.pre_check_major_version_upgrade if parent_rpcs.respond_to? :pre_check_major_version_upgrade
4267
+ @pre_check_major_version_upgrade = ::Gapic::Config::Method.new pre_check_major_version_upgrade_config
4268
+ point_in_time_restore_config = parent_rpcs.point_in_time_restore if parent_rpcs.respond_to? :point_in_time_restore
4269
+ @point_in_time_restore = ::Gapic::Config::Method.new point_in_time_restore_config
4270
+
4271
+ yield self if block_given?
4272
+ end
4273
+ end
4274
+ end
4275
+ end
4276
+ end
4277
+ end
4278
+ end
4279
+ end
4280
+ end
4281
+ end