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