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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +146 -8
  5. data/lib/google/cloud/sql/v1/cloud_sql_available_database_versions_pb.rb +25 -0
  6. data/lib/google/cloud/sql/v1/cloud_sql_available_database_versions_services_pb.rb +29 -0
  7. data/lib/google/cloud/sql/v1/cloud_sql_backup_runs_pb.rb +35 -0
  8. data/lib/google/cloud/sql/v1/cloud_sql_backup_runs_services_pb.rb +53 -0
  9. data/lib/google/cloud/sql/v1/cloud_sql_backups_pb.rb +41 -0
  10. data/lib/google/cloud/sql/v1/cloud_sql_backups_services_pb.rb +54 -0
  11. data/lib/google/cloud/sql/v1/cloud_sql_connect_pb.rb +34 -0
  12. data/lib/google/cloud/sql/v1/cloud_sql_connect_services_pb.rb +50 -0
  13. data/lib/google/cloud/sql/v1/cloud_sql_databases_pb.rb +30 -0
  14. data/lib/google/cloud/sql/v1/cloud_sql_databases_services_pb.rb +61 -0
  15. data/lib/google/cloud/sql/v1/cloud_sql_events_pb.rb +25 -0
  16. data/lib/google/cloud/sql/v1/cloud_sql_events_services_pb.rb +29 -0
  17. data/lib/google/cloud/sql/v1/cloud_sql_feature_eligibility_pb.rb +24 -0
  18. data/lib/google/cloud/sql/v1/cloud_sql_feature_eligibility_services_pb.rb +29 -0
  19. data/lib/google/cloud/sql/v1/cloud_sql_flags_pb.rb +31 -0
  20. data/lib/google/cloud/sql/v1/cloud_sql_flags_services_pb.rb +45 -0
  21. data/lib/google/cloud/sql/v1/cloud_sql_iam_policies_pb.rb +23 -0
  22. data/lib/google/cloud/sql/v1/cloud_sql_iam_policies_services_pb.rb +29 -0
  23. data/lib/google/cloud/sql/v1/cloud_sql_instance_names_pb.rb +24 -0
  24. data/lib/google/cloud/sql/v1/cloud_sql_instance_names_services_pb.rb +29 -0
  25. data/lib/google/cloud/sql/v1/cloud_sql_instances_pb.rb +146 -0
  26. data/lib/google/cloud/sql/v1/cloud_sql_instances_services_pb.rb +184 -0
  27. data/lib/google/cloud/sql/v1/cloud_sql_operations_pb.rb +30 -0
  28. data/lib/google/cloud/sql/v1/cloud_sql_operations_services_pb.rb +50 -0
  29. data/lib/google/cloud/sql/v1/cloud_sql_regions_pb.rb +25 -0
  30. data/lib/google/cloud/sql/v1/cloud_sql_regions_services_pb.rb +29 -0
  31. data/lib/google/cloud/sql/v1/cloud_sql_resources_pb.rb +119 -0
  32. data/lib/google/cloud/sql/v1/cloud_sql_ssl_certs_pb.rb +31 -0
  33. data/lib/google/cloud/sql/v1/cloud_sql_ssl_certs_services_pb.rb +56 -0
  34. data/lib/google/cloud/sql/v1/cloud_sql_tiers_pb.rb +26 -0
  35. data/lib/google/cloud/sql/v1/cloud_sql_tiers_services_pb.rb +47 -0
  36. data/lib/google/cloud/sql/v1/cloud_sql_users_pb.rb +41 -0
  37. data/lib/google/cloud/sql/v1/cloud_sql_users_services_pb.rb +53 -0
  38. data/lib/google/cloud/sql/v1/rest.rb +46 -0
  39. data/lib/google/cloud/sql/v1/sql_backup_runs_service/client.rb +809 -0
  40. data/lib/google/cloud/sql/v1/sql_backup_runs_service/credentials.rb +48 -0
  41. data/lib/google/cloud/sql/v1/sql_backup_runs_service/rest/client.rb +720 -0
  42. data/lib/google/cloud/sql/v1/sql_backup_runs_service/rest/service_stub.rb +332 -0
  43. data/lib/google/cloud/sql/v1/sql_backup_runs_service/rest.rb +51 -0
  44. data/lib/google/cloud/sql/v1/sql_backup_runs_service.rb +54 -0
  45. data/lib/google/cloud/sql/v1/sql_backups_service/client.rb +896 -0
  46. data/lib/google/cloud/sql/v1/sql_backups_service/credentials.rb +48 -0
  47. data/lib/google/cloud/sql/v1/sql_backups_service/paths.rb +64 -0
  48. data/lib/google/cloud/sql/v1/sql_backups_service/rest/client.rb +818 -0
  49. data/lib/google/cloud/sql/v1/sql_backups_service/rest/service_stub.rb +388 -0
  50. data/lib/google/cloud/sql/v1/sql_backups_service/rest.rb +50 -0
  51. data/lib/google/cloud/sql/v1/sql_backups_service.rb +53 -0
  52. data/lib/google/cloud/sql/v1/sql_connect_service/client.rb +607 -0
  53. data/lib/google/cloud/sql/v1/sql_connect_service/credentials.rb +48 -0
  54. data/lib/google/cloud/sql/v1/sql_connect_service/rest/client.rb +544 -0
  55. data/lib/google/cloud/sql/v1/sql_connect_service/rest/service_stub.rb +206 -0
  56. data/lib/google/cloud/sql/v1/sql_connect_service/rest.rb +51 -0
  57. data/lib/google/cloud/sql/v1/sql_connect_service.rb +54 -0
  58. data/lib/google/cloud/sql/v1/sql_databases_service/client.rb +1011 -0
  59. data/lib/google/cloud/sql/v1/sql_databases_service/credentials.rb +48 -0
  60. data/lib/google/cloud/sql/v1/sql_databases_service/rest/client.rb +896 -0
  61. data/lib/google/cloud/sql/v1/sql_databases_service/rest/service_stub.rb +460 -0
  62. data/lib/google/cloud/sql/v1/sql_databases_service/rest.rb +51 -0
  63. data/lib/google/cloud/sql/v1/sql_databases_service.rb +54 -0
  64. data/lib/google/cloud/sql/v1/sql_flags_service/client.rb +488 -0
  65. data/lib/google/cloud/sql/v1/sql_flags_service/credentials.rb +48 -0
  66. data/lib/google/cloud/sql/v1/sql_flags_service/rest/client.rb +446 -0
  67. data/lib/google/cloud/sql/v1/sql_flags_service/rest/service_stub.rb +140 -0
  68. data/lib/google/cloud/sql/v1/sql_flags_service/rest.rb +51 -0
  69. data/lib/google/cloud/sql/v1/sql_flags_service.rb +54 -0
  70. data/lib/google/cloud/sql/v1/sql_instances_service/client.rb +4738 -0
  71. data/lib/google/cloud/sql/v1/sql_instances_service/credentials.rb +48 -0
  72. data/lib/google/cloud/sql/v1/sql_instances_service/paths.rb +95 -0
  73. data/lib/google/cloud/sql/v1/sql_instances_service/rest/client.rb +4274 -0
  74. data/lib/google/cloud/sql/v1/sql_instances_service/rest/service_stub.rb +2769 -0
  75. data/lib/google/cloud/sql/v1/sql_instances_service/rest.rb +50 -0
  76. data/lib/google/cloud/sql/v1/sql_instances_service.rb +53 -0
  77. data/lib/google/cloud/sql/v1/sql_operations_service/client.rb +694 -0
  78. data/lib/google/cloud/sql/v1/sql_operations_service/credentials.rb +48 -0
  79. data/lib/google/cloud/sql/v1/sql_operations_service/rest/client.rb +624 -0
  80. data/lib/google/cloud/sql/v1/sql_operations_service/rest/service_stub.rb +266 -0
  81. data/lib/google/cloud/sql/v1/sql_operations_service/rest.rb +51 -0
  82. data/lib/google/cloud/sql/v1/sql_operations_service.rb +54 -0
  83. data/lib/google/cloud/sql/v1/sql_ssl_certs_service/client.rb +804 -0
  84. data/lib/google/cloud/sql/v1/sql_ssl_certs_service/credentials.rb +48 -0
  85. data/lib/google/cloud/sql/v1/sql_ssl_certs_service/rest/client.rb +715 -0
  86. data/lib/google/cloud/sql/v1/sql_ssl_certs_service/rest/service_stub.rb +332 -0
  87. data/lib/google/cloud/sql/v1/sql_ssl_certs_service/rest.rb +51 -0
  88. data/lib/google/cloud/sql/v1/sql_ssl_certs_service.rb +54 -0
  89. data/lib/google/cloud/sql/v1/sql_tiers_service/client.rb +494 -0
  90. data/lib/google/cloud/sql/v1/sql_tiers_service/credentials.rb +48 -0
  91. data/lib/google/cloud/sql/v1/sql_tiers_service/rest/client.rb +444 -0
  92. data/lib/google/cloud/sql/v1/sql_tiers_service/rest/service_stub.rb +142 -0
  93. data/lib/google/cloud/sql/v1/sql_tiers_service/rest.rb +51 -0
  94. data/lib/google/cloud/sql/v1/sql_tiers_service.rb +54 -0
  95. data/lib/google/cloud/sql/v1/sql_users_service/client.rb +909 -0
  96. data/lib/google/cloud/sql/v1/sql_users_service/credentials.rb +48 -0
  97. data/lib/google/cloud/sql/v1/sql_users_service/rest/client.rb +813 -0
  98. data/lib/google/cloud/sql/v1/sql_users_service/rest/service_stub.rb +394 -0
  99. data/lib/google/cloud/sql/v1/sql_users_service/rest.rb +51 -0
  100. data/lib/google/cloud/sql/v1/sql_users_service.rb +54 -0
  101. data/lib/google/cloud/sql/v1/version.rb +8 -3
  102. data/lib/google/cloud/sql/v1.rb +60 -0
  103. data/lib/google-cloud-sql-v1.rb +21 -0
  104. data/proto_docs/README.md +4 -0
  105. data/proto_docs/google/api/client.rb +593 -0
  106. data/proto_docs/google/api/field_behavior.rb +85 -0
  107. data/proto_docs/google/api/field_info.rb +88 -0
  108. data/proto_docs/google/api/launch_stage.rb +71 -0
  109. data/proto_docs/google/api/resource.rb +227 -0
  110. data/proto_docs/google/cloud/sql/v1/cloud_sql_backup_runs.rb +245 -0
  111. data/proto_docs/google/cloud/sql/v1/cloud_sql_backups.rb +259 -0
  112. data/proto_docs/google/cloud/sql/v1/cloud_sql_connect.rb +190 -0
  113. data/proto_docs/google/cloud/sql/v1/cloud_sql_databases.rb +111 -0
  114. data/proto_docs/google/cloud/sql/v1/cloud_sql_flags.rb +154 -0
  115. data/proto_docs/google/cloud/sql/v1/cloud_sql_instances.rb +2357 -0
  116. data/proto_docs/google/cloud/sql/v1/cloud_sql_operations.rb +85 -0
  117. data/proto_docs/google/cloud/sql/v1/cloud_sql_resources.rb +2522 -0
  118. data/proto_docs/google/cloud/sql/v1/cloud_sql_ssl_certs.rb +120 -0
  119. data/proto_docs/google/cloud/sql/v1/cloud_sql_tiers.rb +69 -0
  120. data/proto_docs/google/cloud/sql/v1/cloud_sql_users.rb +291 -0
  121. data/proto_docs/google/protobuf/any.rb +145 -0
  122. data/proto_docs/google/protobuf/duration.rb +98 -0
  123. data/proto_docs/google/protobuf/empty.rb +34 -0
  124. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  125. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  126. data/proto_docs/google/protobuf/wrappers.rb +148 -0
  127. data/proto_docs/google/rpc/status.rb +48 -0
  128. data/proto_docs/google/type/interval.rb +45 -0
  129. metadata +176 -14
@@ -0,0 +1,4738 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/sql/v1/cloud_sql_instances_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Sql
26
+ module V1
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::V1::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::V1::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", "V1"]
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::V1::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::V1::SqlInstancesService::Client.new
116
+ #
117
+ # # Create a client using a custom configuration
118
+ # client = ::Google::Cloud::Sql::V1::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/v1/cloud_sql_instances_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::V1::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
+ # Adds 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::V1::SqlInstancesAddServerCaRequest} or an equivalent Hash.
214
+ #
215
+ # @param request [::Google::Cloud::Sql::V1::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::V1::Operation]
233
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
234
+ #
235
+ # @return [::Google::Cloud::Sql::V1::Operation]
236
+ #
237
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
238
+ #
239
+ # @example Basic example
240
+ # require "google/cloud/sql/v1"
241
+ #
242
+ # # Create a client object. The client can be reused for multiple calls.
243
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
244
+ #
245
+ # # Create a request. To set request fields, pass in keyword arguments.
246
+ # request = Google::Cloud::Sql::V1::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::V1::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::V1::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::V1::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::V1::SqlInstancesAddServerCertificateRequest} or an equivalent Hash.
310
+ #
311
+ # @param request [::Google::Cloud::Sql::V1::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
+ # Cloud SQL instance ID. This does not include the project ID.
324
+ # @param project [::String]
325
+ # 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::V1::Operation]
329
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
330
+ #
331
+ # @return [::Google::Cloud::Sql::V1::Operation]
332
+ #
333
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
334
+ #
335
+ # @example Basic example
336
+ # require "google/cloud/sql/v1"
337
+ #
338
+ # # Create a client object. The client can be reused for multiple calls.
339
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
340
+ #
341
+ # # Create a request. To set request fields, pass in keyword arguments.
342
+ # request = Google::Cloud::Sql::V1::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::V1::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::V1::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::V1::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::V1::SqlInstancesAddEntraIdCertificateRequest} or an equivalent Hash.
402
+ #
403
+ # @param request [::Google::Cloud::Sql::V1::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::V1::Operation]
421
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
422
+ #
423
+ # @return [::Google::Cloud::Sql::V1::Operation]
424
+ #
425
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
426
+ #
427
+ # @example Basic example
428
+ # require "google/cloud/sql/v1"
429
+ #
430
+ # # Create a client object. The client can be reused for multiple calls.
431
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
432
+ #
433
+ # # Create a request. To set request fields, pass in keyword arguments.
434
+ # request = Google::Cloud::Sql::V1::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::V1::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::V1::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::V1::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::V1::SqlInstancesCloneRequest} or an equivalent Hash.
493
+ #
494
+ # @param request [::Google::Cloud::Sql::V1::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
+ # Required. The ID of the Cloud SQL instance to be cloned (source). This does
507
+ # not include the project ID.
508
+ # @param project [::String]
509
+ # Required. Project ID of the source Cloud SQL instance.
510
+ # @param body [::Google::Cloud::Sql::V1::InstancesCloneRequest, ::Hash]
511
+ #
512
+ # @yield [response, operation] Access the result along with the RPC operation
513
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
514
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
515
+ #
516
+ # @return [::Google::Cloud::Sql::V1::Operation]
517
+ #
518
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
519
+ #
520
+ # @example Basic example
521
+ # require "google/cloud/sql/v1"
522
+ #
523
+ # # Create a client object. The client can be reused for multiple calls.
524
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
525
+ #
526
+ # # Create a request. To set request fields, pass in keyword arguments.
527
+ # request = Google::Cloud::Sql::V1::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::V1::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::V1::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::V1::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::V1::SqlInstancesDeleteRequest} or an equivalent Hash.
585
+ #
586
+ # @param request [::Google::Cloud::Sql::V1::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::V1::Operation]
617
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
618
+ #
619
+ # @return [::Google::Cloud::Sql::V1::Operation]
620
+ #
621
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
622
+ #
623
+ # @example Basic example
624
+ # require "google/cloud/sql/v1"
625
+ #
626
+ # # Create a client object. The client can be reused for multiple calls.
627
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
628
+ #
629
+ # # Create a request. To set request fields, pass in keyword arguments.
630
+ # request = Google::Cloud::Sql::V1::SqlInstancesDeleteRequest.new
631
+ #
632
+ # # Call the delete method.
633
+ # result = client.delete request
634
+ #
635
+ # # The returned object is of type Google::Cloud::Sql::V1::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::V1::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::V1::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::V1::SqlInstancesDemoteMasterRequest} or an equivalent Hash.
689
+ #
690
+ # @param request [::Google::Cloud::Sql::V1::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::V1::InstancesDemoteMasterRequest, ::Hash]
706
+ #
707
+ # @yield [response, operation] Access the result along with the RPC operation
708
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
709
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
710
+ #
711
+ # @return [::Google::Cloud::Sql::V1::Operation]
712
+ #
713
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
714
+ #
715
+ # @example Basic example
716
+ # require "google/cloud/sql/v1"
717
+ #
718
+ # # Create a client object. The client can be reused for multiple calls.
719
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
720
+ #
721
+ # # Create a request. To set request fields, pass in keyword arguments.
722
+ # request = Google::Cloud::Sql::V1::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::V1::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::V1::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::V1::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::V1::SqlInstancesDemoteRequest} or an equivalent Hash.
781
+ #
782
+ # @param request [::Google::Cloud::Sql::V1::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. Cloud SQL instance name.
795
+ # @param project [::String]
796
+ # Required. ID of the project that contains the instance.
797
+ # @param body [::Google::Cloud::Sql::V1::InstancesDemoteRequest, ::Hash]
798
+ # Required. The request body.
799
+ #
800
+ # @yield [response, operation] Access the result along with the RPC operation
801
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
802
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
803
+ #
804
+ # @return [::Google::Cloud::Sql::V1::Operation]
805
+ #
806
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
807
+ #
808
+ # @example Basic example
809
+ # require "google/cloud/sql/v1"
810
+ #
811
+ # # Create a client object. The client can be reused for multiple calls.
812
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
813
+ #
814
+ # # Create a request. To set request fields, pass in keyword arguments.
815
+ # request = Google::Cloud::Sql::V1::SqlInstancesDemoteRequest.new
816
+ #
817
+ # # Call the demote method.
818
+ # result = client.demote request
819
+ #
820
+ # # The returned object is of type Google::Cloud::Sql::V1::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::V1::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::V1::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::V1::SqlInstancesExportRequest} or an equivalent Hash.
874
+ #
875
+ # @param request [::Google::Cloud::Sql::V1::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
+ # Cloud SQL instance ID. This does not 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::V1::InstancesExportRequest, ::Hash]
891
+ #
892
+ # @yield [response, operation] Access the result along with the RPC operation
893
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
894
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
895
+ #
896
+ # @return [::Google::Cloud::Sql::V1::Operation]
897
+ #
898
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
899
+ #
900
+ # @example Basic example
901
+ # require "google/cloud/sql/v1"
902
+ #
903
+ # # Create a client object. The client can be reused for multiple calls.
904
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
905
+ #
906
+ # # Create a request. To set request fields, pass in keyword arguments.
907
+ # request = Google::Cloud::Sql::V1::SqlInstancesExportRequest.new
908
+ #
909
+ # # Call the export method.
910
+ # result = client.export request
911
+ #
912
+ # # The returned object is of type Google::Cloud::Sql::V1::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::V1::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::V1::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::V1::SqlInstancesFailoverRequest} or an equivalent Hash.
972
+ #
973
+ # @param request [::Google::Cloud::Sql::V1::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::V1::InstancesFailoverRequest, ::Hash]
989
+ #
990
+ # @yield [response, operation] Access the result along with the RPC operation
991
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
992
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
993
+ #
994
+ # @return [::Google::Cloud::Sql::V1::Operation]
995
+ #
996
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
997
+ #
998
+ # @example Basic example
999
+ # require "google/cloud/sql/v1"
1000
+ #
1001
+ # # Create a client object. The client can be reused for multiple calls.
1002
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
1003
+ #
1004
+ # # Create a request. To set request fields, pass in keyword arguments.
1005
+ # request = Google::Cloud::Sql::V1::SqlInstancesFailoverRequest.new
1006
+ #
1007
+ # # Call the failover method.
1008
+ # result = client.failover request
1009
+ #
1010
+ # # The returned object is of type Google::Cloud::Sql::V1::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::V1::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::V1::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::V1::SqlInstancesReencryptRequest} or an equivalent Hash.
1063
+ #
1064
+ # @param request [::Google::Cloud::Sql::V1::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::V1::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::V1::Operation]
1084
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1085
+ #
1086
+ # @return [::Google::Cloud::Sql::V1::Operation]
1087
+ #
1088
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1089
+ #
1090
+ # @example Basic example
1091
+ # require "google/cloud/sql/v1"
1092
+ #
1093
+ # # Create a client object. The client can be reused for multiple calls.
1094
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
1095
+ #
1096
+ # # Create a request. To set request fields, pass in keyword arguments.
1097
+ # request = Google::Cloud::Sql::V1::SqlInstancesReencryptRequest.new
1098
+ #
1099
+ # # Call the reencrypt method.
1100
+ # result = client.reencrypt request
1101
+ #
1102
+ # # The returned object is of type Google::Cloud::Sql::V1::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::V1::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::V1::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::V1::SqlInstancesGetRequest} or an equivalent Hash.
1155
+ #
1156
+ # @param request [::Google::Cloud::Sql::V1::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
+ # Required. Database instance ID. This does not include the project ID.
1169
+ # @param project [::String]
1170
+ # Required. 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::V1::DatabaseInstance]
1174
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1175
+ #
1176
+ # @return [::Google::Cloud::Sql::V1::DatabaseInstance]
1177
+ #
1178
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1179
+ #
1180
+ # @example Basic example
1181
+ # require "google/cloud/sql/v1"
1182
+ #
1183
+ # # Create a client object. The client can be reused for multiple calls.
1184
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
1185
+ #
1186
+ # # Create a request. To set request fields, pass in keyword arguments.
1187
+ # request = Google::Cloud::Sql::V1::SqlInstancesGetRequest.new
1188
+ #
1189
+ # # Call the get method.
1190
+ # result = client.get request
1191
+ #
1192
+ # # The returned object is of type Google::Cloud::Sql::V1::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::V1::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::V1::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::V1::SqlInstancesImportRequest} or an equivalent Hash.
1246
+ #
1247
+ # @param request [::Google::Cloud::Sql::V1::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::V1::InstancesImportRequest, ::Hash]
1263
+ #
1264
+ # @yield [response, operation] Access the result along with the RPC operation
1265
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
1266
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1267
+ #
1268
+ # @return [::Google::Cloud::Sql::V1::Operation]
1269
+ #
1270
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1271
+ #
1272
+ # @example Basic example
1273
+ # require "google/cloud/sql/v1"
1274
+ #
1275
+ # # Create a client object. The client can be reused for multiple calls.
1276
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
1277
+ #
1278
+ # # Create a request. To set request fields, pass in keyword arguments.
1279
+ # request = Google::Cloud::Sql::V1::SqlInstancesImportRequest.new
1280
+ #
1281
+ # # Call the import method.
1282
+ # result = client.import request
1283
+ #
1284
+ # # The returned object is of type Google::Cloud::Sql::V1::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::V1::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::V1::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::V1::SqlInstancesInsertRequest} or an equivalent Hash.
1337
+ #
1338
+ # @param request [::Google::Cloud::Sql::V1::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::V1::DatabaseInstance, ::Hash]
1353
+ #
1354
+ # @yield [response, operation] Access the result along with the RPC operation
1355
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
1356
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1357
+ #
1358
+ # @return [::Google::Cloud::Sql::V1::Operation]
1359
+ #
1360
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1361
+ #
1362
+ # @example Basic example
1363
+ # require "google/cloud/sql/v1"
1364
+ #
1365
+ # # Create a client object. The client can be reused for multiple calls.
1366
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
1367
+ #
1368
+ # # Create a request. To set request fields, pass in keyword arguments.
1369
+ # request = Google::Cloud::Sql::V1::SqlInstancesInsertRequest.new
1370
+ #
1371
+ # # Call the insert method.
1372
+ # result = client.insert request
1373
+ #
1374
+ # # The returned object is of type Google::Cloud::Sql::V1::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::V1::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::V1::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::V1::SqlInstancesListRequest} or an equivalent Hash.
1424
+ #
1425
+ # @param request [::Google::Cloud::Sql::V1::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::V1::InstancesListResponse]
1459
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1460
+ #
1461
+ # @return [::Google::Cloud::Sql::V1::InstancesListResponse]
1462
+ #
1463
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1464
+ #
1465
+ # @example Basic example
1466
+ # require "google/cloud/sql/v1"
1467
+ #
1468
+ # # Create a client object. The client can be reused for multiple calls.
1469
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
1470
+ #
1471
+ # # Create a request. To set request fields, pass in keyword arguments.
1472
+ # request = Google::Cloud::Sql::V1::SqlInstancesListRequest.new
1473
+ #
1474
+ # # Call the list method.
1475
+ # result = client.list request
1476
+ #
1477
+ # # The returned object is of type Google::Cloud::Sql::V1::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::V1::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::V1::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::V1::SqlInstancesListServerCasRequest} or an equivalent Hash.
1531
+ #
1532
+ # @param request [::Google::Cloud::Sql::V1::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::V1::InstancesListServerCasResponse]
1550
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1551
+ #
1552
+ # @return [::Google::Cloud::Sql::V1::InstancesListServerCasResponse]
1553
+ #
1554
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1555
+ #
1556
+ # @example Basic example
1557
+ # require "google/cloud/sql/v1"
1558
+ #
1559
+ # # Create a client object. The client can be reused for multiple calls.
1560
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
1561
+ #
1562
+ # # Create a request. To set request fields, pass in keyword arguments.
1563
+ # request = Google::Cloud::Sql::V1::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::V1::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::V1::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::V1::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::V1::SqlInstancesListServerCertificatesRequest} or an equivalent Hash.
1626
+ #
1627
+ # @param request [::Google::Cloud::Sql::V1::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::V1::InstancesListServerCertificatesResponse]
1645
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1646
+ #
1647
+ # @return [::Google::Cloud::Sql::V1::InstancesListServerCertificatesResponse]
1648
+ #
1649
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1650
+ #
1651
+ # @example Basic example
1652
+ # require "google/cloud/sql/v1"
1653
+ #
1654
+ # # Create a client object. The client can be reused for multiple calls.
1655
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
1656
+ #
1657
+ # # Create a request. To set request fields, pass in keyword arguments.
1658
+ # request = Google::Cloud::Sql::V1::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::V1::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::V1::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::V1::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::V1::SqlInstancesListEntraIdCertificatesRequest} or an equivalent Hash.
1719
+ #
1720
+ # @param request [::Google::Cloud::Sql::V1::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::V1::InstancesListEntraIdCertificatesResponse]
1738
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1739
+ #
1740
+ # @return [::Google::Cloud::Sql::V1::InstancesListEntraIdCertificatesResponse]
1741
+ #
1742
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1743
+ #
1744
+ # @example Basic example
1745
+ # require "google/cloud/sql/v1"
1746
+ #
1747
+ # # Create a client object. The client can be reused for multiple calls.
1748
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
1749
+ #
1750
+ # # Create a request. To set request fields, pass in keyword arguments.
1751
+ # request = Google::Cloud::Sql::V1::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::V1::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::V1::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::V1::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::V1::SqlInstancesPatchRequest} or an equivalent Hash.
1810
+ #
1811
+ # @param request [::Google::Cloud::Sql::V1::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, 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 body [::Google::Cloud::Sql::V1::DatabaseInstance, ::Hash]
1827
+ #
1828
+ # @yield [response, operation] Access the result along with the RPC operation
1829
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
1830
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1831
+ #
1832
+ # @return [::Google::Cloud::Sql::V1::Operation]
1833
+ #
1834
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1835
+ #
1836
+ # @example Basic example
1837
+ # require "google/cloud/sql/v1"
1838
+ #
1839
+ # # Create a client object. The client can be reused for multiple calls.
1840
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
1841
+ #
1842
+ # # Create a request. To set request fields, pass in keyword arguments.
1843
+ # request = Google::Cloud::Sql::V1::SqlInstancesPatchRequest.new
1844
+ #
1845
+ # # Call the patch method.
1846
+ # result = client.patch request
1847
+ #
1848
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
1849
+ # p result
1850
+ #
1851
+ def patch request, options = nil
1852
+ raise ::ArgumentError, "request must be provided" if request.nil?
1853
+
1854
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesPatchRequest
1855
+
1856
+ # Converts hash and nil to an options object
1857
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1858
+
1859
+ # Customize the options with defaults
1860
+ metadata = @config.rpcs.patch.metadata.to_h
1861
+
1862
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1863
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1864
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1865
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
1866
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1867
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1868
+
1869
+ header_params = {}
1870
+ if request.project
1871
+ header_params["project"] = request.project
1872
+ end
1873
+ if request.instance
1874
+ header_params["instance"] = request.instance
1875
+ end
1876
+
1877
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1878
+ metadata[:"x-goog-request-params"] ||= request_params_header
1879
+
1880
+ options.apply_defaults timeout: @config.rpcs.patch.timeout,
1881
+ metadata: metadata,
1882
+ retry_policy: @config.rpcs.patch.retry_policy
1883
+
1884
+ options.apply_defaults timeout: @config.timeout,
1885
+ metadata: @config.metadata,
1886
+ retry_policy: @config.retry_policy
1887
+
1888
+ @sql_instances_service_stub.call_rpc :patch, request, options: options do |response, operation|
1889
+ yield response, operation if block_given?
1890
+ end
1891
+ rescue ::GRPC::BadStatus => e
1892
+ raise ::Google::Cloud::Error.from_error(e)
1893
+ end
1894
+
1895
+ ##
1896
+ # Promotes the read replica instance to be an independent Cloud SQL
1897
+ # primary instance.
1898
+ # Using this operation might cause your instance to restart.
1899
+ #
1900
+ # @overload promote_replica(request, options = nil)
1901
+ # Pass arguments to `promote_replica` via a request object, either of type
1902
+ # {::Google::Cloud::Sql::V1::SqlInstancesPromoteReplicaRequest} or an equivalent Hash.
1903
+ #
1904
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesPromoteReplicaRequest, ::Hash]
1905
+ # A request object representing the call parameters. Required. To specify no
1906
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1907
+ # @param options [::Gapic::CallOptions, ::Hash]
1908
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1909
+ #
1910
+ # @overload promote_replica(instance: nil, project: nil, failover: nil)
1911
+ # Pass arguments to `promote_replica` via keyword arguments. Note that at
1912
+ # least one keyword argument is required. To specify no parameters, or to keep all
1913
+ # the default parameter values, pass an empty Hash as a request object (see above).
1914
+ #
1915
+ # @param instance [::String]
1916
+ # Cloud SQL read replica instance name.
1917
+ # @param project [::String]
1918
+ # ID of the project that contains the read replica.
1919
+ # @param failover [::Boolean]
1920
+ # Set to true to invoke a replica failover to the DR
1921
+ # replica. As part of replica failover, the promote operation attempts
1922
+ # to add the original primary instance as a replica of the promoted
1923
+ # DR replica when the original primary instance comes back online.
1924
+ # If set to false or not specified, then the original primary
1925
+ # instance becomes an independent Cloud SQL primary instance.
1926
+ #
1927
+ # @yield [response, operation] Access the result along with the RPC operation
1928
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
1929
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1930
+ #
1931
+ # @return [::Google::Cloud::Sql::V1::Operation]
1932
+ #
1933
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1934
+ #
1935
+ # @example Basic example
1936
+ # require "google/cloud/sql/v1"
1937
+ #
1938
+ # # Create a client object. The client can be reused for multiple calls.
1939
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
1940
+ #
1941
+ # # Create a request. To set request fields, pass in keyword arguments.
1942
+ # request = Google::Cloud::Sql::V1::SqlInstancesPromoteReplicaRequest.new
1943
+ #
1944
+ # # Call the promote_replica method.
1945
+ # result = client.promote_replica request
1946
+ #
1947
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
1948
+ # p result
1949
+ #
1950
+ def promote_replica request, options = nil
1951
+ raise ::ArgumentError, "request must be provided" if request.nil?
1952
+
1953
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesPromoteReplicaRequest
1954
+
1955
+ # Converts hash and nil to an options object
1956
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1957
+
1958
+ # Customize the options with defaults
1959
+ metadata = @config.rpcs.promote_replica.metadata.to_h
1960
+
1961
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1962
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1963
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1964
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
1965
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1966
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1967
+
1968
+ header_params = {}
1969
+ if request.project
1970
+ header_params["project"] = request.project
1971
+ end
1972
+ if request.instance
1973
+ header_params["instance"] = request.instance
1974
+ end
1975
+
1976
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1977
+ metadata[:"x-goog-request-params"] ||= request_params_header
1978
+
1979
+ options.apply_defaults timeout: @config.rpcs.promote_replica.timeout,
1980
+ metadata: metadata,
1981
+ retry_policy: @config.rpcs.promote_replica.retry_policy
1982
+
1983
+ options.apply_defaults timeout: @config.timeout,
1984
+ metadata: @config.metadata,
1985
+ retry_policy: @config.retry_policy
1986
+
1987
+ @sql_instances_service_stub.call_rpc :promote_replica, request, options: options do |response, operation|
1988
+ yield response, operation if block_given?
1989
+ end
1990
+ rescue ::GRPC::BadStatus => e
1991
+ raise ::Google::Cloud::Error.from_error(e)
1992
+ end
1993
+
1994
+ ##
1995
+ # Switches over from the primary instance to the DR replica
1996
+ # instance.
1997
+ #
1998
+ # @overload switchover(request, options = nil)
1999
+ # Pass arguments to `switchover` via a request object, either of type
2000
+ # {::Google::Cloud::Sql::V1::SqlInstancesSwitchoverRequest} or an equivalent Hash.
2001
+ #
2002
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesSwitchoverRequest, ::Hash]
2003
+ # A request object representing the call parameters. Required. To specify no
2004
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2005
+ # @param options [::Gapic::CallOptions, ::Hash]
2006
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2007
+ #
2008
+ # @overload switchover(instance: nil, project: nil, db_timeout: nil)
2009
+ # Pass arguments to `switchover` via keyword arguments. Note that at
2010
+ # least one keyword argument is required. To specify no parameters, or to keep all
2011
+ # the default parameter values, pass an empty Hash as a request object (see above).
2012
+ #
2013
+ # @param instance [::String]
2014
+ # Cloud SQL read replica instance name.
2015
+ # @param project [::String]
2016
+ # ID of the project that contains the replica.
2017
+ # @param db_timeout [::Google::Protobuf::Duration, ::Hash]
2018
+ # Optional. (MySQL and PostgreSQL only) Cloud SQL instance operations
2019
+ # timeout, which is a sum of all database operations. Default value is 10
2020
+ # minutes and can be modified to a maximum value of 24 hours.
2021
+ #
2022
+ # @yield [response, operation] Access the result along with the RPC operation
2023
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
2024
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2025
+ #
2026
+ # @return [::Google::Cloud::Sql::V1::Operation]
2027
+ #
2028
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2029
+ #
2030
+ # @example Basic example
2031
+ # require "google/cloud/sql/v1"
2032
+ #
2033
+ # # Create a client object. The client can be reused for multiple calls.
2034
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
2035
+ #
2036
+ # # Create a request. To set request fields, pass in keyword arguments.
2037
+ # request = Google::Cloud::Sql::V1::SqlInstancesSwitchoverRequest.new
2038
+ #
2039
+ # # Call the switchover method.
2040
+ # result = client.switchover request
2041
+ #
2042
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2043
+ # p result
2044
+ #
2045
+ def switchover request, options = nil
2046
+ raise ::ArgumentError, "request must be provided" if request.nil?
2047
+
2048
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesSwitchoverRequest
2049
+
2050
+ # Converts hash and nil to an options object
2051
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2052
+
2053
+ # Customize the options with defaults
2054
+ metadata = @config.rpcs.switchover.metadata.to_h
2055
+
2056
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2057
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2058
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2059
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
2060
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2061
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2062
+
2063
+ header_params = {}
2064
+ if request.project
2065
+ header_params["project"] = request.project
2066
+ end
2067
+ if request.instance
2068
+ header_params["instance"] = request.instance
2069
+ end
2070
+
2071
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2072
+ metadata[:"x-goog-request-params"] ||= request_params_header
2073
+
2074
+ options.apply_defaults timeout: @config.rpcs.switchover.timeout,
2075
+ metadata: metadata,
2076
+ retry_policy: @config.rpcs.switchover.retry_policy
2077
+
2078
+ options.apply_defaults timeout: @config.timeout,
2079
+ metadata: @config.metadata,
2080
+ retry_policy: @config.retry_policy
2081
+
2082
+ @sql_instances_service_stub.call_rpc :switchover, request, options: options do |response, operation|
2083
+ yield response, operation if block_given?
2084
+ end
2085
+ rescue ::GRPC::BadStatus => e
2086
+ raise ::Google::Cloud::Error.from_error(e)
2087
+ end
2088
+
2089
+ ##
2090
+ # Deletes all client certificates and generates a new server SSL certificate
2091
+ # for the instance.
2092
+ #
2093
+ # @overload reset_ssl_config(request, options = nil)
2094
+ # Pass arguments to `reset_ssl_config` via a request object, either of type
2095
+ # {::Google::Cloud::Sql::V1::SqlInstancesResetSslConfigRequest} or an equivalent Hash.
2096
+ #
2097
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesResetSslConfigRequest, ::Hash]
2098
+ # A request object representing the call parameters. Required. To specify no
2099
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2100
+ # @param options [::Gapic::CallOptions, ::Hash]
2101
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2102
+ #
2103
+ # @overload reset_ssl_config(instance: nil, project: nil, mode: nil)
2104
+ # Pass arguments to `reset_ssl_config` via keyword arguments. Note that at
2105
+ # least one keyword argument is required. To specify no parameters, or to keep all
2106
+ # the default parameter values, pass an empty Hash as a request object (see above).
2107
+ #
2108
+ # @param instance [::String]
2109
+ # Cloud SQL instance ID. This does not include the project ID.
2110
+ # @param project [::String]
2111
+ # Project ID of the project that contains the instance.
2112
+ # @param mode [::Google::Cloud::Sql::V1::SqlInstancesResetSslConfigRequest::ResetSslMode]
2113
+ # Optional. Reset SSL mode to use.
2114
+ #
2115
+ # @yield [response, operation] Access the result along with the RPC operation
2116
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
2117
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2118
+ #
2119
+ # @return [::Google::Cloud::Sql::V1::Operation]
2120
+ #
2121
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2122
+ #
2123
+ # @example Basic example
2124
+ # require "google/cloud/sql/v1"
2125
+ #
2126
+ # # Create a client object. The client can be reused for multiple calls.
2127
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
2128
+ #
2129
+ # # Create a request. To set request fields, pass in keyword arguments.
2130
+ # request = Google::Cloud::Sql::V1::SqlInstancesResetSslConfigRequest.new
2131
+ #
2132
+ # # Call the reset_ssl_config method.
2133
+ # result = client.reset_ssl_config request
2134
+ #
2135
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2136
+ # p result
2137
+ #
2138
+ def reset_ssl_config request, options = nil
2139
+ raise ::ArgumentError, "request must be provided" if request.nil?
2140
+
2141
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesResetSslConfigRequest
2142
+
2143
+ # Converts hash and nil to an options object
2144
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2145
+
2146
+ # Customize the options with defaults
2147
+ metadata = @config.rpcs.reset_ssl_config.metadata.to_h
2148
+
2149
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2150
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2151
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2152
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
2153
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2154
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2155
+
2156
+ header_params = {}
2157
+ if request.project
2158
+ header_params["project"] = request.project
2159
+ end
2160
+ if request.instance
2161
+ header_params["instance"] = request.instance
2162
+ end
2163
+
2164
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2165
+ metadata[:"x-goog-request-params"] ||= request_params_header
2166
+
2167
+ options.apply_defaults timeout: @config.rpcs.reset_ssl_config.timeout,
2168
+ metadata: metadata,
2169
+ retry_policy: @config.rpcs.reset_ssl_config.retry_policy
2170
+
2171
+ options.apply_defaults timeout: @config.timeout,
2172
+ metadata: @config.metadata,
2173
+ retry_policy: @config.retry_policy
2174
+
2175
+ @sql_instances_service_stub.call_rpc :reset_ssl_config, request, options: options do |response, operation|
2176
+ yield response, operation if block_given?
2177
+ end
2178
+ rescue ::GRPC::BadStatus => e
2179
+ raise ::Google::Cloud::Error.from_error(e)
2180
+ end
2181
+
2182
+ ##
2183
+ # Restarts a Cloud SQL instance.
2184
+ #
2185
+ # @overload restart(request, options = nil)
2186
+ # Pass arguments to `restart` via a request object, either of type
2187
+ # {::Google::Cloud::Sql::V1::SqlInstancesRestartRequest} or an equivalent Hash.
2188
+ #
2189
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesRestartRequest, ::Hash]
2190
+ # A request object representing the call parameters. Required. To specify no
2191
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2192
+ # @param options [::Gapic::CallOptions, ::Hash]
2193
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2194
+ #
2195
+ # @overload restart(instance: nil, project: nil)
2196
+ # Pass arguments to `restart` via keyword arguments. Note that at
2197
+ # least one keyword argument is required. To specify no parameters, or to keep all
2198
+ # the default parameter values, pass an empty Hash as a request object (see above).
2199
+ #
2200
+ # @param instance [::String]
2201
+ # Cloud SQL instance ID. This does not include the project ID.
2202
+ # @param project [::String]
2203
+ # Project ID of the project that contains the instance to be restarted.
2204
+ #
2205
+ # @yield [response, operation] Access the result along with the RPC operation
2206
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
2207
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2208
+ #
2209
+ # @return [::Google::Cloud::Sql::V1::Operation]
2210
+ #
2211
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2212
+ #
2213
+ # @example Basic example
2214
+ # require "google/cloud/sql/v1"
2215
+ #
2216
+ # # Create a client object. The client can be reused for multiple calls.
2217
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
2218
+ #
2219
+ # # Create a request. To set request fields, pass in keyword arguments.
2220
+ # request = Google::Cloud::Sql::V1::SqlInstancesRestartRequest.new
2221
+ #
2222
+ # # Call the restart method.
2223
+ # result = client.restart request
2224
+ #
2225
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2226
+ # p result
2227
+ #
2228
+ def restart request, options = nil
2229
+ raise ::ArgumentError, "request must be provided" if request.nil?
2230
+
2231
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesRestartRequest
2232
+
2233
+ # Converts hash and nil to an options object
2234
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2235
+
2236
+ # Customize the options with defaults
2237
+ metadata = @config.rpcs.restart.metadata.to_h
2238
+
2239
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2240
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2241
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2242
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
2243
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2244
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2245
+
2246
+ header_params = {}
2247
+ if request.project
2248
+ header_params["project"] = request.project
2249
+ end
2250
+ if request.instance
2251
+ header_params["instance"] = request.instance
2252
+ end
2253
+
2254
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2255
+ metadata[:"x-goog-request-params"] ||= request_params_header
2256
+
2257
+ options.apply_defaults timeout: @config.rpcs.restart.timeout,
2258
+ metadata: metadata,
2259
+ retry_policy: @config.rpcs.restart.retry_policy
2260
+
2261
+ options.apply_defaults timeout: @config.timeout,
2262
+ metadata: @config.metadata,
2263
+ retry_policy: @config.retry_policy
2264
+
2265
+ @sql_instances_service_stub.call_rpc :restart, request, options: options do |response, operation|
2266
+ yield response, operation if block_given?
2267
+ end
2268
+ rescue ::GRPC::BadStatus => e
2269
+ raise ::Google::Cloud::Error.from_error(e)
2270
+ end
2271
+
2272
+ ##
2273
+ # Restores a backup of a Cloud SQL instance. Using this operation might cause
2274
+ # your instance to restart.
2275
+ #
2276
+ # @overload restore_backup(request, options = nil)
2277
+ # Pass arguments to `restore_backup` via a request object, either of type
2278
+ # {::Google::Cloud::Sql::V1::SqlInstancesRestoreBackupRequest} or an equivalent Hash.
2279
+ #
2280
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesRestoreBackupRequest, ::Hash]
2281
+ # A request object representing the call parameters. Required. To specify no
2282
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2283
+ # @param options [::Gapic::CallOptions, ::Hash]
2284
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2285
+ #
2286
+ # @overload restore_backup(instance: nil, project: nil, body: nil)
2287
+ # Pass arguments to `restore_backup` via keyword arguments. Note that at
2288
+ # least one keyword argument is required. To specify no parameters, or to keep all
2289
+ # the default parameter values, pass an empty Hash as a request object (see above).
2290
+ #
2291
+ # @param instance [::String]
2292
+ # Cloud SQL instance ID. This does not include the project ID.
2293
+ # @param project [::String]
2294
+ # Project ID of the project that contains the instance.
2295
+ # @param body [::Google::Cloud::Sql::V1::InstancesRestoreBackupRequest, ::Hash]
2296
+ #
2297
+ # @yield [response, operation] Access the result along with the RPC operation
2298
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
2299
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2300
+ #
2301
+ # @return [::Google::Cloud::Sql::V1::Operation]
2302
+ #
2303
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2304
+ #
2305
+ # @example Basic example
2306
+ # require "google/cloud/sql/v1"
2307
+ #
2308
+ # # Create a client object. The client can be reused for multiple calls.
2309
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
2310
+ #
2311
+ # # Create a request. To set request fields, pass in keyword arguments.
2312
+ # request = Google::Cloud::Sql::V1::SqlInstancesRestoreBackupRequest.new
2313
+ #
2314
+ # # Call the restore_backup method.
2315
+ # result = client.restore_backup request
2316
+ #
2317
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2318
+ # p result
2319
+ #
2320
+ def restore_backup request, options = nil
2321
+ raise ::ArgumentError, "request must be provided" if request.nil?
2322
+
2323
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesRestoreBackupRequest
2324
+
2325
+ # Converts hash and nil to an options object
2326
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2327
+
2328
+ # Customize the options with defaults
2329
+ metadata = @config.rpcs.restore_backup.metadata.to_h
2330
+
2331
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2332
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2333
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2334
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
2335
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2336
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2337
+
2338
+ header_params = {}
2339
+ if request.project
2340
+ header_params["project"] = request.project
2341
+ end
2342
+ if request.instance
2343
+ header_params["instance"] = request.instance
2344
+ end
2345
+
2346
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2347
+ metadata[:"x-goog-request-params"] ||= request_params_header
2348
+
2349
+ options.apply_defaults timeout: @config.rpcs.restore_backup.timeout,
2350
+ metadata: metadata,
2351
+ retry_policy: @config.rpcs.restore_backup.retry_policy
2352
+
2353
+ options.apply_defaults timeout: @config.timeout,
2354
+ metadata: @config.metadata,
2355
+ retry_policy: @config.retry_policy
2356
+
2357
+ @sql_instances_service_stub.call_rpc :restore_backup, request, options: options do |response, operation|
2358
+ yield response, operation if block_given?
2359
+ end
2360
+ rescue ::GRPC::BadStatus => e
2361
+ raise ::Google::Cloud::Error.from_error(e)
2362
+ end
2363
+
2364
+ ##
2365
+ # Rotates the server certificate to one signed by the Certificate Authority
2366
+ # (CA) version previously added with the addServerCA method. For instances
2367
+ # that have enabled Certificate Authority Service (CAS) based server CA,
2368
+ # use RotateServerCertificate to rotate the server certificate.
2369
+ #
2370
+ # @overload rotate_server_ca(request, options = nil)
2371
+ # Pass arguments to `rotate_server_ca` via a request object, either of type
2372
+ # {::Google::Cloud::Sql::V1::SqlInstancesRotateServerCaRequest} or an equivalent Hash.
2373
+ #
2374
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesRotateServerCaRequest, ::Hash]
2375
+ # A request object representing the call parameters. Required. To specify no
2376
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2377
+ # @param options [::Gapic::CallOptions, ::Hash]
2378
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2379
+ #
2380
+ # @overload rotate_server_ca(instance: nil, project: nil, body: nil)
2381
+ # Pass arguments to `rotate_server_ca` via keyword arguments. Note that at
2382
+ # least one keyword argument is required. To specify no parameters, or to keep all
2383
+ # the default parameter values, pass an empty Hash as a request object (see above).
2384
+ #
2385
+ # @param instance [::String]
2386
+ # Cloud SQL instance ID. This does not include the project ID.
2387
+ # @param project [::String]
2388
+ # Project ID of the project that contains the instance.
2389
+ # @param body [::Google::Cloud::Sql::V1::InstancesRotateServerCaRequest, ::Hash]
2390
+ #
2391
+ # @yield [response, operation] Access the result along with the RPC operation
2392
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
2393
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2394
+ #
2395
+ # @return [::Google::Cloud::Sql::V1::Operation]
2396
+ #
2397
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2398
+ #
2399
+ # @example Basic example
2400
+ # require "google/cloud/sql/v1"
2401
+ #
2402
+ # # Create a client object. The client can be reused for multiple calls.
2403
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
2404
+ #
2405
+ # # Create a request. To set request fields, pass in keyword arguments.
2406
+ # request = Google::Cloud::Sql::V1::SqlInstancesRotateServerCaRequest.new
2407
+ #
2408
+ # # Call the rotate_server_ca method.
2409
+ # result = client.rotate_server_ca request
2410
+ #
2411
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2412
+ # p result
2413
+ #
2414
+ def rotate_server_ca request, options = nil
2415
+ raise ::ArgumentError, "request must be provided" if request.nil?
2416
+
2417
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesRotateServerCaRequest
2418
+
2419
+ # Converts hash and nil to an options object
2420
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2421
+
2422
+ # Customize the options with defaults
2423
+ metadata = @config.rpcs.rotate_server_ca.metadata.to_h
2424
+
2425
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2426
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2427
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2428
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
2429
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2430
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2431
+
2432
+ header_params = {}
2433
+ if request.project
2434
+ header_params["project"] = request.project
2435
+ end
2436
+ if request.instance
2437
+ header_params["instance"] = request.instance
2438
+ end
2439
+
2440
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2441
+ metadata[:"x-goog-request-params"] ||= request_params_header
2442
+
2443
+ options.apply_defaults timeout: @config.rpcs.rotate_server_ca.timeout,
2444
+ metadata: metadata,
2445
+ retry_policy: @config.rpcs.rotate_server_ca.retry_policy
2446
+
2447
+ options.apply_defaults timeout: @config.timeout,
2448
+ metadata: @config.metadata,
2449
+ retry_policy: @config.retry_policy
2450
+
2451
+ @sql_instances_service_stub.call_rpc :rotate_server_ca, request, options: options do |response, operation|
2452
+ yield response, operation if block_given?
2453
+ end
2454
+ rescue ::GRPC::BadStatus => e
2455
+ raise ::Google::Cloud::Error.from_error(e)
2456
+ end
2457
+
2458
+ ##
2459
+ # Rotates the server certificate version to one previously added with the
2460
+ # addServerCertificate method. For instances not using Certificate Authority
2461
+ # Service (CAS) server CA, use RotateServerCa instead.
2462
+ #
2463
+ # @overload rotate_server_certificate(request, options = nil)
2464
+ # Pass arguments to `rotate_server_certificate` via a request object, either of type
2465
+ # {::Google::Cloud::Sql::V1::SqlInstancesRotateServerCertificateRequest} or an equivalent Hash.
2466
+ #
2467
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesRotateServerCertificateRequest, ::Hash]
2468
+ # A request object representing the call parameters. Required. To specify no
2469
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2470
+ # @param options [::Gapic::CallOptions, ::Hash]
2471
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2472
+ #
2473
+ # @overload rotate_server_certificate(instance: nil, project: nil, body: nil)
2474
+ # Pass arguments to `rotate_server_certificate` via keyword arguments. Note that at
2475
+ # least one keyword argument is required. To specify no parameters, or to keep all
2476
+ # the default parameter values, pass an empty Hash as a request object (see above).
2477
+ #
2478
+ # @param instance [::String]
2479
+ # Required. Cloud SQL instance ID. This does not include the project ID.
2480
+ # @param project [::String]
2481
+ # Required. Project ID of the project that contains the instance.
2482
+ # @param body [::Google::Cloud::Sql::V1::InstancesRotateServerCertificateRequest, ::Hash]
2483
+ # Optional. Rotate server certificate request body.
2484
+ #
2485
+ # @yield [response, operation] Access the result along with the RPC operation
2486
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
2487
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2488
+ #
2489
+ # @return [::Google::Cloud::Sql::V1::Operation]
2490
+ #
2491
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2492
+ #
2493
+ # @example Basic example
2494
+ # require "google/cloud/sql/v1"
2495
+ #
2496
+ # # Create a client object. The client can be reused for multiple calls.
2497
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
2498
+ #
2499
+ # # Create a request. To set request fields, pass in keyword arguments.
2500
+ # request = Google::Cloud::Sql::V1::SqlInstancesRotateServerCertificateRequest.new
2501
+ #
2502
+ # # Call the rotate_server_certificate method.
2503
+ # result = client.rotate_server_certificate request
2504
+ #
2505
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2506
+ # p result
2507
+ #
2508
+ def rotate_server_certificate request, options = nil
2509
+ raise ::ArgumentError, "request must be provided" if request.nil?
2510
+
2511
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesRotateServerCertificateRequest
2512
+
2513
+ # Converts hash and nil to an options object
2514
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2515
+
2516
+ # Customize the options with defaults
2517
+ metadata = @config.rpcs.rotate_server_certificate.metadata.to_h
2518
+
2519
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2520
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2521
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2522
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
2523
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2524
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2525
+
2526
+ header_params = {}
2527
+ if request.project
2528
+ header_params["project"] = request.project
2529
+ end
2530
+ if request.instance
2531
+ header_params["instance"] = request.instance
2532
+ end
2533
+
2534
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2535
+ metadata[:"x-goog-request-params"] ||= request_params_header
2536
+
2537
+ options.apply_defaults timeout: @config.rpcs.rotate_server_certificate.timeout,
2538
+ metadata: metadata,
2539
+ retry_policy: @config.rpcs.rotate_server_certificate.retry_policy
2540
+
2541
+ options.apply_defaults timeout: @config.timeout,
2542
+ metadata: @config.metadata,
2543
+ retry_policy: @config.retry_policy
2544
+
2545
+ @sql_instances_service_stub.call_rpc :rotate_server_certificate, request, options: options do |response, operation|
2546
+ yield response, operation if block_given?
2547
+ end
2548
+ rescue ::GRPC::BadStatus => e
2549
+ raise ::Google::Cloud::Error.from_error(e)
2550
+ end
2551
+
2552
+ ##
2553
+ # Rotates the server certificate version to one previously added with the
2554
+ # addEntraIdCertificate method.
2555
+ #
2556
+ # @overload rotate_entra_id_certificate(request, options = nil)
2557
+ # Pass arguments to `rotate_entra_id_certificate` via a request object, either of type
2558
+ # {::Google::Cloud::Sql::V1::SqlInstancesRotateEntraIdCertificateRequest} or an equivalent Hash.
2559
+ #
2560
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesRotateEntraIdCertificateRequest, ::Hash]
2561
+ # A request object representing the call parameters. Required. To specify no
2562
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2563
+ # @param options [::Gapic::CallOptions, ::Hash]
2564
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2565
+ #
2566
+ # @overload rotate_entra_id_certificate(instance: nil, project: nil, body: nil)
2567
+ # Pass arguments to `rotate_entra_id_certificate` via keyword arguments. Note that at
2568
+ # least one keyword argument is required. To specify no parameters, or to keep all
2569
+ # the default parameter values, pass an empty Hash as a request object (see above).
2570
+ #
2571
+ # @param instance [::String]
2572
+ # Required. Cloud SQL instance ID. This does not include the project ID.
2573
+ # @param project [::String]
2574
+ # Required. Project ID of the project that contains the instance.
2575
+ # @param body [::Google::Cloud::Sql::V1::InstancesRotateEntraIdCertificateRequest, ::Hash]
2576
+ # Optional. Rotate Entra ID certificate request body.
2577
+ #
2578
+ # @yield [response, operation] Access the result along with the RPC operation
2579
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
2580
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2581
+ #
2582
+ # @return [::Google::Cloud::Sql::V1::Operation]
2583
+ #
2584
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2585
+ #
2586
+ # @example Basic example
2587
+ # require "google/cloud/sql/v1"
2588
+ #
2589
+ # # Create a client object. The client can be reused for multiple calls.
2590
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
2591
+ #
2592
+ # # Create a request. To set request fields, pass in keyword arguments.
2593
+ # request = Google::Cloud::Sql::V1::SqlInstancesRotateEntraIdCertificateRequest.new
2594
+ #
2595
+ # # Call the rotate_entra_id_certificate method.
2596
+ # result = client.rotate_entra_id_certificate request
2597
+ #
2598
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2599
+ # p result
2600
+ #
2601
+ def rotate_entra_id_certificate request, options = nil
2602
+ raise ::ArgumentError, "request must be provided" if request.nil?
2603
+
2604
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesRotateEntraIdCertificateRequest
2605
+
2606
+ # Converts hash and nil to an options object
2607
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2608
+
2609
+ # Customize the options with defaults
2610
+ metadata = @config.rpcs.rotate_entra_id_certificate.metadata.to_h
2611
+
2612
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2613
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2614
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2615
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
2616
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2617
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2618
+
2619
+ header_params = {}
2620
+ if request.project
2621
+ header_params["project"] = request.project
2622
+ end
2623
+ if request.instance
2624
+ header_params["instance"] = request.instance
2625
+ end
2626
+
2627
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2628
+ metadata[:"x-goog-request-params"] ||= request_params_header
2629
+
2630
+ options.apply_defaults timeout: @config.rpcs.rotate_entra_id_certificate.timeout,
2631
+ metadata: metadata,
2632
+ retry_policy: @config.rpcs.rotate_entra_id_certificate.retry_policy
2633
+
2634
+ options.apply_defaults timeout: @config.timeout,
2635
+ metadata: @config.metadata,
2636
+ retry_policy: @config.retry_policy
2637
+
2638
+ @sql_instances_service_stub.call_rpc :rotate_entra_id_certificate, request, options: options do |response, operation|
2639
+ yield response, operation if block_given?
2640
+ end
2641
+ rescue ::GRPC::BadStatus => e
2642
+ raise ::Google::Cloud::Error.from_error(e)
2643
+ end
2644
+
2645
+ ##
2646
+ # Starts the replication in the read replica instance.
2647
+ #
2648
+ # @overload start_replica(request, options = nil)
2649
+ # Pass arguments to `start_replica` via a request object, either of type
2650
+ # {::Google::Cloud::Sql::V1::SqlInstancesStartReplicaRequest} or an equivalent Hash.
2651
+ #
2652
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesStartReplicaRequest, ::Hash]
2653
+ # A request object representing the call parameters. Required. To specify no
2654
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2655
+ # @param options [::Gapic::CallOptions, ::Hash]
2656
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2657
+ #
2658
+ # @overload start_replica(instance: nil, project: nil)
2659
+ # Pass arguments to `start_replica` via keyword arguments. Note that at
2660
+ # least one keyword argument is required. To specify no parameters, or to keep all
2661
+ # the default parameter values, pass an empty Hash as a request object (see above).
2662
+ #
2663
+ # @param instance [::String]
2664
+ # Cloud SQL read replica instance name.
2665
+ # @param project [::String]
2666
+ # ID of the project that contains the read replica.
2667
+ #
2668
+ # @yield [response, operation] Access the result along with the RPC operation
2669
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
2670
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2671
+ #
2672
+ # @return [::Google::Cloud::Sql::V1::Operation]
2673
+ #
2674
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2675
+ #
2676
+ # @example Basic example
2677
+ # require "google/cloud/sql/v1"
2678
+ #
2679
+ # # Create a client object. The client can be reused for multiple calls.
2680
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
2681
+ #
2682
+ # # Create a request. To set request fields, pass in keyword arguments.
2683
+ # request = Google::Cloud::Sql::V1::SqlInstancesStartReplicaRequest.new
2684
+ #
2685
+ # # Call the start_replica method.
2686
+ # result = client.start_replica request
2687
+ #
2688
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2689
+ # p result
2690
+ #
2691
+ def start_replica request, options = nil
2692
+ raise ::ArgumentError, "request must be provided" if request.nil?
2693
+
2694
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesStartReplicaRequest
2695
+
2696
+ # Converts hash and nil to an options object
2697
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2698
+
2699
+ # Customize the options with defaults
2700
+ metadata = @config.rpcs.start_replica.metadata.to_h
2701
+
2702
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2703
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2704
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2705
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
2706
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2707
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2708
+
2709
+ header_params = {}
2710
+ if request.project
2711
+ header_params["project"] = request.project
2712
+ end
2713
+ if request.instance
2714
+ header_params["instance"] = request.instance
2715
+ end
2716
+
2717
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2718
+ metadata[:"x-goog-request-params"] ||= request_params_header
2719
+
2720
+ options.apply_defaults timeout: @config.rpcs.start_replica.timeout,
2721
+ metadata: metadata,
2722
+ retry_policy: @config.rpcs.start_replica.retry_policy
2723
+
2724
+ options.apply_defaults timeout: @config.timeout,
2725
+ metadata: @config.metadata,
2726
+ retry_policy: @config.retry_policy
2727
+
2728
+ @sql_instances_service_stub.call_rpc :start_replica, request, options: options do |response, operation|
2729
+ yield response, operation if block_given?
2730
+ end
2731
+ rescue ::GRPC::BadStatus => e
2732
+ raise ::Google::Cloud::Error.from_error(e)
2733
+ end
2734
+
2735
+ ##
2736
+ # Stops the replication in the read replica instance.
2737
+ #
2738
+ # @overload stop_replica(request, options = nil)
2739
+ # Pass arguments to `stop_replica` via a request object, either of type
2740
+ # {::Google::Cloud::Sql::V1::SqlInstancesStopReplicaRequest} or an equivalent Hash.
2741
+ #
2742
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesStopReplicaRequest, ::Hash]
2743
+ # A request object representing the call parameters. Required. To specify no
2744
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2745
+ # @param options [::Gapic::CallOptions, ::Hash]
2746
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2747
+ #
2748
+ # @overload stop_replica(instance: nil, project: nil)
2749
+ # Pass arguments to `stop_replica` via keyword arguments. Note that at
2750
+ # least one keyword argument is required. To specify no parameters, or to keep all
2751
+ # the default parameter values, pass an empty Hash as a request object (see above).
2752
+ #
2753
+ # @param instance [::String]
2754
+ # Cloud SQL read replica instance name.
2755
+ # @param project [::String]
2756
+ # ID of the project that contains the read replica.
2757
+ #
2758
+ # @yield [response, operation] Access the result along with the RPC operation
2759
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
2760
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2761
+ #
2762
+ # @return [::Google::Cloud::Sql::V1::Operation]
2763
+ #
2764
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2765
+ #
2766
+ # @example Basic example
2767
+ # require "google/cloud/sql/v1"
2768
+ #
2769
+ # # Create a client object. The client can be reused for multiple calls.
2770
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
2771
+ #
2772
+ # # Create a request. To set request fields, pass in keyword arguments.
2773
+ # request = Google::Cloud::Sql::V1::SqlInstancesStopReplicaRequest.new
2774
+ #
2775
+ # # Call the stop_replica method.
2776
+ # result = client.stop_replica request
2777
+ #
2778
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2779
+ # p result
2780
+ #
2781
+ def stop_replica request, options = nil
2782
+ raise ::ArgumentError, "request must be provided" if request.nil?
2783
+
2784
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesStopReplicaRequest
2785
+
2786
+ # Converts hash and nil to an options object
2787
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2788
+
2789
+ # Customize the options with defaults
2790
+ metadata = @config.rpcs.stop_replica.metadata.to_h
2791
+
2792
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2793
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2794
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2795
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
2796
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2797
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2798
+
2799
+ header_params = {}
2800
+ if request.project
2801
+ header_params["project"] = request.project
2802
+ end
2803
+ if request.instance
2804
+ header_params["instance"] = request.instance
2805
+ end
2806
+
2807
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2808
+ metadata[:"x-goog-request-params"] ||= request_params_header
2809
+
2810
+ options.apply_defaults timeout: @config.rpcs.stop_replica.timeout,
2811
+ metadata: metadata,
2812
+ retry_policy: @config.rpcs.stop_replica.retry_policy
2813
+
2814
+ options.apply_defaults timeout: @config.timeout,
2815
+ metadata: @config.metadata,
2816
+ retry_policy: @config.retry_policy
2817
+
2818
+ @sql_instances_service_stub.call_rpc :stop_replica, request, options: options do |response, operation|
2819
+ yield response, operation if block_given?
2820
+ end
2821
+ rescue ::GRPC::BadStatus => e
2822
+ raise ::Google::Cloud::Error.from_error(e)
2823
+ end
2824
+
2825
+ ##
2826
+ # Truncate MySQL general and slow query log tables
2827
+ # MySQL only.
2828
+ #
2829
+ # @overload truncate_log(request, options = nil)
2830
+ # Pass arguments to `truncate_log` via a request object, either of type
2831
+ # {::Google::Cloud::Sql::V1::SqlInstancesTruncateLogRequest} or an equivalent Hash.
2832
+ #
2833
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesTruncateLogRequest, ::Hash]
2834
+ # A request object representing the call parameters. Required. To specify no
2835
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2836
+ # @param options [::Gapic::CallOptions, ::Hash]
2837
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2838
+ #
2839
+ # @overload truncate_log(instance: nil, project: nil, body: nil)
2840
+ # Pass arguments to `truncate_log` via keyword arguments. Note that at
2841
+ # least one keyword argument is required. To specify no parameters, or to keep all
2842
+ # the default parameter values, pass an empty Hash as a request object (see above).
2843
+ #
2844
+ # @param instance [::String]
2845
+ # Cloud SQL instance ID. This does not include the project ID.
2846
+ # @param project [::String]
2847
+ # Project ID of the Cloud SQL project.
2848
+ # @param body [::Google::Cloud::Sql::V1::InstancesTruncateLogRequest, ::Hash]
2849
+ #
2850
+ # @yield [response, operation] Access the result along with the RPC operation
2851
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
2852
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2853
+ #
2854
+ # @return [::Google::Cloud::Sql::V1::Operation]
2855
+ #
2856
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2857
+ #
2858
+ # @example Basic example
2859
+ # require "google/cloud/sql/v1"
2860
+ #
2861
+ # # Create a client object. The client can be reused for multiple calls.
2862
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
2863
+ #
2864
+ # # Create a request. To set request fields, pass in keyword arguments.
2865
+ # request = Google::Cloud::Sql::V1::SqlInstancesTruncateLogRequest.new
2866
+ #
2867
+ # # Call the truncate_log method.
2868
+ # result = client.truncate_log request
2869
+ #
2870
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2871
+ # p result
2872
+ #
2873
+ def truncate_log request, options = nil
2874
+ raise ::ArgumentError, "request must be provided" if request.nil?
2875
+
2876
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesTruncateLogRequest
2877
+
2878
+ # Converts hash and nil to an options object
2879
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2880
+
2881
+ # Customize the options with defaults
2882
+ metadata = @config.rpcs.truncate_log.metadata.to_h
2883
+
2884
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2885
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2886
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2887
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
2888
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2889
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2890
+
2891
+ header_params = {}
2892
+ if request.project
2893
+ header_params["project"] = request.project
2894
+ end
2895
+ if request.instance
2896
+ header_params["instance"] = request.instance
2897
+ end
2898
+
2899
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2900
+ metadata[:"x-goog-request-params"] ||= request_params_header
2901
+
2902
+ options.apply_defaults timeout: @config.rpcs.truncate_log.timeout,
2903
+ metadata: metadata,
2904
+ retry_policy: @config.rpcs.truncate_log.retry_policy
2905
+
2906
+ options.apply_defaults timeout: @config.timeout,
2907
+ metadata: @config.metadata,
2908
+ retry_policy: @config.retry_policy
2909
+
2910
+ @sql_instances_service_stub.call_rpc :truncate_log, request, options: options do |response, operation|
2911
+ yield response, operation if block_given?
2912
+ end
2913
+ rescue ::GRPC::BadStatus => e
2914
+ raise ::Google::Cloud::Error.from_error(e)
2915
+ end
2916
+
2917
+ ##
2918
+ # Updates settings of a Cloud SQL instance. Using this operation might cause
2919
+ # your instance to restart.
2920
+ #
2921
+ # @overload update(request, options = nil)
2922
+ # Pass arguments to `update` via a request object, either of type
2923
+ # {::Google::Cloud::Sql::V1::SqlInstancesUpdateRequest} or an equivalent Hash.
2924
+ #
2925
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesUpdateRequest, ::Hash]
2926
+ # A request object representing the call parameters. Required. To specify no
2927
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
2928
+ # @param options [::Gapic::CallOptions, ::Hash]
2929
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
2930
+ #
2931
+ # @overload update(instance: nil, project: nil, body: nil)
2932
+ # Pass arguments to `update` via keyword arguments. Note that at
2933
+ # least one keyword argument is required. To specify no parameters, or to keep all
2934
+ # the default parameter values, pass an empty Hash as a request object (see above).
2935
+ #
2936
+ # @param instance [::String]
2937
+ # Cloud SQL instance ID. This does not include the project ID.
2938
+ # @param project [::String]
2939
+ # Project ID of the project that contains the instance.
2940
+ # @param body [::Google::Cloud::Sql::V1::DatabaseInstance, ::Hash]
2941
+ #
2942
+ # @yield [response, operation] Access the result along with the RPC operation
2943
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
2944
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
2945
+ #
2946
+ # @return [::Google::Cloud::Sql::V1::Operation]
2947
+ #
2948
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
2949
+ #
2950
+ # @example Basic example
2951
+ # require "google/cloud/sql/v1"
2952
+ #
2953
+ # # Create a client object. The client can be reused for multiple calls.
2954
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
2955
+ #
2956
+ # # Create a request. To set request fields, pass in keyword arguments.
2957
+ # request = Google::Cloud::Sql::V1::SqlInstancesUpdateRequest.new
2958
+ #
2959
+ # # Call the update method.
2960
+ # result = client.update request
2961
+ #
2962
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
2963
+ # p result
2964
+ #
2965
+ def update request, options = nil
2966
+ raise ::ArgumentError, "request must be provided" if request.nil?
2967
+
2968
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesUpdateRequest
2969
+
2970
+ # Converts hash and nil to an options object
2971
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
2972
+
2973
+ # Customize the options with defaults
2974
+ metadata = @config.rpcs.update.metadata.to_h
2975
+
2976
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
2977
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
2978
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
2979
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
2980
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
2981
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
2982
+
2983
+ header_params = {}
2984
+ if request.project
2985
+ header_params["project"] = request.project
2986
+ end
2987
+ if request.instance
2988
+ header_params["instance"] = request.instance
2989
+ end
2990
+
2991
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
2992
+ metadata[:"x-goog-request-params"] ||= request_params_header
2993
+
2994
+ options.apply_defaults timeout: @config.rpcs.update.timeout,
2995
+ metadata: metadata,
2996
+ retry_policy: @config.rpcs.update.retry_policy
2997
+
2998
+ options.apply_defaults timeout: @config.timeout,
2999
+ metadata: @config.metadata,
3000
+ retry_policy: @config.retry_policy
3001
+
3002
+ @sql_instances_service_stub.call_rpc :update, request, options: options do |response, operation|
3003
+ yield response, operation if block_given?
3004
+ end
3005
+ rescue ::GRPC::BadStatus => e
3006
+ raise ::Google::Cloud::Error.from_error(e)
3007
+ end
3008
+
3009
+ ##
3010
+ # Generates a short-lived X509 certificate containing the provided public key
3011
+ # and signed by a private key specific to the target instance. Users may use
3012
+ # the certificate to authenticate as themselves when connecting to the
3013
+ # database.
3014
+ #
3015
+ # @overload create_ephemeral(request, options = nil)
3016
+ # Pass arguments to `create_ephemeral` via a request object, either of type
3017
+ # {::Google::Cloud::Sql::V1::SqlInstancesCreateEphemeralCertRequest} or an equivalent Hash.
3018
+ #
3019
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesCreateEphemeralCertRequest, ::Hash]
3020
+ # A request object representing the call parameters. Required. To specify no
3021
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3022
+ # @param options [::Gapic::CallOptions, ::Hash]
3023
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3024
+ #
3025
+ # @overload create_ephemeral(instance: nil, project: nil, body: nil)
3026
+ # Pass arguments to `create_ephemeral` via keyword arguments. Note that at
3027
+ # least one keyword argument is required. To specify no parameters, or to keep all
3028
+ # the default parameter values, pass an empty Hash as a request object (see above).
3029
+ #
3030
+ # @param instance [::String]
3031
+ # Cloud SQL instance ID. This does not include the project ID.
3032
+ # @param project [::String]
3033
+ # Project ID of the Cloud SQL project.
3034
+ # @param body [::Google::Cloud::Sql::V1::SslCertsCreateEphemeralRequest, ::Hash]
3035
+ #
3036
+ # @yield [response, operation] Access the result along with the RPC operation
3037
+ # @yieldparam response [::Google::Cloud::Sql::V1::SslCert]
3038
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3039
+ #
3040
+ # @return [::Google::Cloud::Sql::V1::SslCert]
3041
+ #
3042
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3043
+ #
3044
+ # @example Basic example
3045
+ # require "google/cloud/sql/v1"
3046
+ #
3047
+ # # Create a client object. The client can be reused for multiple calls.
3048
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
3049
+ #
3050
+ # # Create a request. To set request fields, pass in keyword arguments.
3051
+ # request = Google::Cloud::Sql::V1::SqlInstancesCreateEphemeralCertRequest.new
3052
+ #
3053
+ # # Call the create_ephemeral method.
3054
+ # result = client.create_ephemeral request
3055
+ #
3056
+ # # The returned object is of type Google::Cloud::Sql::V1::SslCert.
3057
+ # p result
3058
+ #
3059
+ def create_ephemeral request, options = nil
3060
+ raise ::ArgumentError, "request must be provided" if request.nil?
3061
+
3062
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesCreateEphemeralCertRequest
3063
+
3064
+ # Converts hash and nil to an options object
3065
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3066
+
3067
+ # Customize the options with defaults
3068
+ metadata = @config.rpcs.create_ephemeral.metadata.to_h
3069
+
3070
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3071
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3072
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3073
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
3074
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3075
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3076
+
3077
+ header_params = {}
3078
+ if request.project
3079
+ header_params["project"] = request.project
3080
+ end
3081
+ if request.instance
3082
+ header_params["instance"] = request.instance
3083
+ end
3084
+
3085
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3086
+ metadata[:"x-goog-request-params"] ||= request_params_header
3087
+
3088
+ options.apply_defaults timeout: @config.rpcs.create_ephemeral.timeout,
3089
+ metadata: metadata,
3090
+ retry_policy: @config.rpcs.create_ephemeral.retry_policy
3091
+
3092
+ options.apply_defaults timeout: @config.timeout,
3093
+ metadata: @config.metadata,
3094
+ retry_policy: @config.retry_policy
3095
+
3096
+ @sql_instances_service_stub.call_rpc :create_ephemeral, request, options: options do |response, operation|
3097
+ yield response, operation if block_given?
3098
+ end
3099
+ rescue ::GRPC::BadStatus => e
3100
+ raise ::Google::Cloud::Error.from_error(e)
3101
+ end
3102
+
3103
+ ##
3104
+ # Reschedules the maintenance on the given instance.
3105
+ #
3106
+ # @overload reschedule_maintenance(request, options = nil)
3107
+ # Pass arguments to `reschedule_maintenance` via a request object, either of type
3108
+ # {::Google::Cloud::Sql::V1::SqlInstancesRescheduleMaintenanceRequest} or an equivalent Hash.
3109
+ #
3110
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesRescheduleMaintenanceRequest, ::Hash]
3111
+ # A request object representing the call parameters. Required. To specify no
3112
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3113
+ # @param options [::Gapic::CallOptions, ::Hash]
3114
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3115
+ #
3116
+ # @overload reschedule_maintenance(instance: nil, project: nil, body: nil)
3117
+ # Pass arguments to `reschedule_maintenance` via keyword arguments. Note that at
3118
+ # least one keyword argument is required. To specify no parameters, or to keep all
3119
+ # the default parameter values, pass an empty Hash as a request object (see above).
3120
+ #
3121
+ # @param instance [::String]
3122
+ # Cloud SQL instance ID. This does not include the project ID.
3123
+ # @param project [::String]
3124
+ # ID of the project that contains the instance.
3125
+ # @param body [::Google::Cloud::Sql::V1::SqlInstancesRescheduleMaintenanceRequestBody, ::Hash]
3126
+ #
3127
+ # @yield [response, operation] Access the result along with the RPC operation
3128
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
3129
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3130
+ #
3131
+ # @return [::Google::Cloud::Sql::V1::Operation]
3132
+ #
3133
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3134
+ #
3135
+ # @example Basic example
3136
+ # require "google/cloud/sql/v1"
3137
+ #
3138
+ # # Create a client object. The client can be reused for multiple calls.
3139
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
3140
+ #
3141
+ # # Create a request. To set request fields, pass in keyword arguments.
3142
+ # request = Google::Cloud::Sql::V1::SqlInstancesRescheduleMaintenanceRequest.new
3143
+ #
3144
+ # # Call the reschedule_maintenance method.
3145
+ # result = client.reschedule_maintenance request
3146
+ #
3147
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
3148
+ # p result
3149
+ #
3150
+ def reschedule_maintenance request, options = nil
3151
+ raise ::ArgumentError, "request must be provided" if request.nil?
3152
+
3153
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesRescheduleMaintenanceRequest
3154
+
3155
+ # Converts hash and nil to an options object
3156
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3157
+
3158
+ # Customize the options with defaults
3159
+ metadata = @config.rpcs.reschedule_maintenance.metadata.to_h
3160
+
3161
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3162
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3163
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3164
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
3165
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3166
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3167
+
3168
+ header_params = {}
3169
+ if request.project
3170
+ header_params["project"] = request.project
3171
+ end
3172
+ if request.instance
3173
+ header_params["instance"] = request.instance
3174
+ end
3175
+
3176
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3177
+ metadata[:"x-goog-request-params"] ||= request_params_header
3178
+
3179
+ options.apply_defaults timeout: @config.rpcs.reschedule_maintenance.timeout,
3180
+ metadata: metadata,
3181
+ retry_policy: @config.rpcs.reschedule_maintenance.retry_policy
3182
+
3183
+ options.apply_defaults timeout: @config.timeout,
3184
+ metadata: @config.metadata,
3185
+ retry_policy: @config.retry_policy
3186
+
3187
+ @sql_instances_service_stub.call_rpc :reschedule_maintenance, request, options: options do |response, operation|
3188
+ yield response, operation if block_given?
3189
+ end
3190
+ rescue ::GRPC::BadStatus => e
3191
+ raise ::Google::Cloud::Error.from_error(e)
3192
+ end
3193
+
3194
+ ##
3195
+ # Verify External primary instance external sync settings.
3196
+ #
3197
+ # @overload verify_external_sync_settings(request, options = nil)
3198
+ # Pass arguments to `verify_external_sync_settings` via a request object, either of type
3199
+ # {::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest} or an equivalent Hash.
3200
+ #
3201
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest, ::Hash]
3202
+ # A request object representing the call parameters. Required. To specify no
3203
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3204
+ # @param options [::Gapic::CallOptions, ::Hash]
3205
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3206
+ #
3207
+ # @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)
3208
+ # Pass arguments to `verify_external_sync_settings` via keyword arguments. Note that at
3209
+ # least one keyword argument is required. To specify no parameters, or to keep all
3210
+ # the default parameter values, pass an empty Hash as a request object (see above).
3211
+ #
3212
+ # @param instance [::String]
3213
+ # Cloud SQL instance ID. This does not include the project ID.
3214
+ # @param project [::String]
3215
+ # Project ID of the project that contains the instance.
3216
+ # @param verify_connection_only [::Boolean]
3217
+ # Flag to enable verifying connection only
3218
+ # @param sync_mode [::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest::ExternalSyncMode]
3219
+ # External sync mode
3220
+ # @param verify_replication_only [::Boolean]
3221
+ # Optional. Flag to verify settings required by replication setup only
3222
+ # @param mysql_sync_config [::Google::Cloud::Sql::V1::MySqlSyncConfig, ::Hash]
3223
+ # Optional. MySQL-specific settings for start external sync.
3224
+ # @param migration_type [::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest::MigrationType]
3225
+ # Optional. MigrationType configures the migration to use physical files or
3226
+ # logical dump files. If not set, then the logical dump file configuration is
3227
+ # used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
3228
+ # @param sync_parallel_level [::Google::Cloud::Sql::V1::ExternalSyncParallelLevel]
3229
+ # Optional. Parallel level for initial data sync. Only applicable for
3230
+ # PostgreSQL.
3231
+ # @param selected_objects [::Array<::Google::Cloud::Sql::V1::ExternalSyncSelectedObject, ::Hash>]
3232
+ # Optional. Migrate only the specified objects from the source instance. If
3233
+ # this field is empty, then migrate all objects.
3234
+ #
3235
+ # @yield [response, operation] Access the result along with the RPC operation
3236
+ # @yieldparam response [::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsResponse]
3237
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3238
+ #
3239
+ # @return [::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsResponse]
3240
+ #
3241
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3242
+ #
3243
+ # @example Basic example
3244
+ # require "google/cloud/sql/v1"
3245
+ #
3246
+ # # Create a client object. The client can be reused for multiple calls.
3247
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
3248
+ #
3249
+ # # Create a request. To set request fields, pass in keyword arguments.
3250
+ # request = Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest.new
3251
+ #
3252
+ # # Call the verify_external_sync_settings method.
3253
+ # result = client.verify_external_sync_settings request
3254
+ #
3255
+ # # The returned object is of type Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsResponse.
3256
+ # p result
3257
+ #
3258
+ def verify_external_sync_settings request, options = nil
3259
+ raise ::ArgumentError, "request must be provided" if request.nil?
3260
+
3261
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest
3262
+
3263
+ # Converts hash and nil to an options object
3264
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3265
+
3266
+ # Customize the options with defaults
3267
+ metadata = @config.rpcs.verify_external_sync_settings.metadata.to_h
3268
+
3269
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3270
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3271
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3272
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
3273
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3274
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3275
+
3276
+ header_params = {}
3277
+ if request.project
3278
+ header_params["project"] = request.project
3279
+ end
3280
+ if request.instance
3281
+ header_params["instance"] = request.instance
3282
+ end
3283
+
3284
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3285
+ metadata[:"x-goog-request-params"] ||= request_params_header
3286
+
3287
+ options.apply_defaults timeout: @config.rpcs.verify_external_sync_settings.timeout,
3288
+ metadata: metadata,
3289
+ retry_policy: @config.rpcs.verify_external_sync_settings.retry_policy
3290
+
3291
+ options.apply_defaults timeout: @config.timeout,
3292
+ metadata: @config.metadata,
3293
+ retry_policy: @config.retry_policy
3294
+
3295
+ @sql_instances_service_stub.call_rpc :verify_external_sync_settings, request, options: options do |response, operation|
3296
+ yield response, operation if block_given?
3297
+ end
3298
+ rescue ::GRPC::BadStatus => e
3299
+ raise ::Google::Cloud::Error.from_error(e)
3300
+ end
3301
+
3302
+ ##
3303
+ # Start External primary instance migration.
3304
+ #
3305
+ # @overload start_external_sync(request, options = nil)
3306
+ # Pass arguments to `start_external_sync` via a request object, either of type
3307
+ # {::Google::Cloud::Sql::V1::SqlInstancesStartExternalSyncRequest} or an equivalent Hash.
3308
+ #
3309
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesStartExternalSyncRequest, ::Hash]
3310
+ # A request object representing the call parameters. Required. To specify no
3311
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3312
+ # @param options [::Gapic::CallOptions, ::Hash]
3313
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3314
+ #
3315
+ # @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)
3316
+ # Pass arguments to `start_external_sync` via keyword arguments. Note that at
3317
+ # least one keyword argument is required. To specify no parameters, or to keep all
3318
+ # the default parameter values, pass an empty Hash as a request object (see above).
3319
+ #
3320
+ # @param instance [::String]
3321
+ # Cloud SQL instance ID. This does not include the project ID.
3322
+ # @param project [::String]
3323
+ # ID of the project that contains the instance.
3324
+ # @param sync_mode [::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest::ExternalSyncMode]
3325
+ # External sync mode.
3326
+ # @param skip_verification [::Boolean]
3327
+ # Whether to skip the verification step (VESS).
3328
+ # @param mysql_sync_config [::Google::Cloud::Sql::V1::MySqlSyncConfig, ::Hash]
3329
+ # MySQL-specific settings for start external sync.
3330
+ # @param sync_parallel_level [::Google::Cloud::Sql::V1::ExternalSyncParallelLevel]
3331
+ # Optional. Parallel level for initial data sync. Currently only applicable
3332
+ # for MySQL.
3333
+ # @param migration_type [::Google::Cloud::Sql::V1::SqlInstancesVerifyExternalSyncSettingsRequest::MigrationType]
3334
+ # Optional. MigrationType configures the migration to use physical files or
3335
+ # logical dump files. If not set, then the logical dump file configuration is
3336
+ # used. Valid values are `LOGICAL` or `PHYSICAL`. Only applicable to MySQL.
3337
+ # @param replica_overwrite_enabled [::Boolean]
3338
+ # Optional. MySQL only. True if end-user has confirmed that this SES call
3339
+ # will wipe replica databases overlapping with the proposed selected_objects.
3340
+ # If this field is not set and there are both overlapping and additional
3341
+ # databases proposed, an error will be returned.
3342
+ #
3343
+ # @yield [response, operation] Access the result along with the RPC operation
3344
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
3345
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3346
+ #
3347
+ # @return [::Google::Cloud::Sql::V1::Operation]
3348
+ #
3349
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3350
+ #
3351
+ # @example Basic example
3352
+ # require "google/cloud/sql/v1"
3353
+ #
3354
+ # # Create a client object. The client can be reused for multiple calls.
3355
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
3356
+ #
3357
+ # # Create a request. To set request fields, pass in keyword arguments.
3358
+ # request = Google::Cloud::Sql::V1::SqlInstancesStartExternalSyncRequest.new
3359
+ #
3360
+ # # Call the start_external_sync method.
3361
+ # result = client.start_external_sync request
3362
+ #
3363
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
3364
+ # p result
3365
+ #
3366
+ def start_external_sync request, options = nil
3367
+ raise ::ArgumentError, "request must be provided" if request.nil?
3368
+
3369
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesStartExternalSyncRequest
3370
+
3371
+ # Converts hash and nil to an options object
3372
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3373
+
3374
+ # Customize the options with defaults
3375
+ metadata = @config.rpcs.start_external_sync.metadata.to_h
3376
+
3377
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3378
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3379
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3380
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
3381
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3382
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3383
+
3384
+ header_params = {}
3385
+ if request.project
3386
+ header_params["project"] = request.project
3387
+ end
3388
+ if request.instance
3389
+ header_params["instance"] = request.instance
3390
+ end
3391
+
3392
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3393
+ metadata[:"x-goog-request-params"] ||= request_params_header
3394
+
3395
+ options.apply_defaults timeout: @config.rpcs.start_external_sync.timeout,
3396
+ metadata: metadata,
3397
+ retry_policy: @config.rpcs.start_external_sync.retry_policy
3398
+
3399
+ options.apply_defaults timeout: @config.timeout,
3400
+ metadata: @config.metadata,
3401
+ retry_policy: @config.retry_policy
3402
+
3403
+ @sql_instances_service_stub.call_rpc :start_external_sync, request, options: options do |response, operation|
3404
+ yield response, operation if block_given?
3405
+ end
3406
+ rescue ::GRPC::BadStatus => e
3407
+ raise ::Google::Cloud::Error.from_error(e)
3408
+ end
3409
+
3410
+ ##
3411
+ # Perform Disk Shrink on primary instance.
3412
+ #
3413
+ # @overload perform_disk_shrink(request, options = nil)
3414
+ # Pass arguments to `perform_disk_shrink` via a request object, either of type
3415
+ # {::Google::Cloud::Sql::V1::SqlInstancesPerformDiskShrinkRequest} or an equivalent Hash.
3416
+ #
3417
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesPerformDiskShrinkRequest, ::Hash]
3418
+ # A request object representing the call parameters. Required. To specify no
3419
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3420
+ # @param options [::Gapic::CallOptions, ::Hash]
3421
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3422
+ #
3423
+ # @overload perform_disk_shrink(instance: nil, project: nil, body: nil)
3424
+ # Pass arguments to `perform_disk_shrink` via keyword arguments. Note that at
3425
+ # least one keyword argument is required. To specify no parameters, or to keep all
3426
+ # the default parameter values, pass an empty Hash as a request object (see above).
3427
+ #
3428
+ # @param instance [::String]
3429
+ # Cloud SQL instance ID. This does not include the project ID.
3430
+ # @param project [::String]
3431
+ # Project ID of the project that contains the instance.
3432
+ # @param body [::Google::Cloud::Sql::V1::PerformDiskShrinkContext, ::Hash]
3433
+ # Perform disk shrink context.
3434
+ #
3435
+ # @yield [response, operation] Access the result along with the RPC operation
3436
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
3437
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3438
+ #
3439
+ # @return [::Google::Cloud::Sql::V1::Operation]
3440
+ #
3441
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3442
+ #
3443
+ # @example Basic example
3444
+ # require "google/cloud/sql/v1"
3445
+ #
3446
+ # # Create a client object. The client can be reused for multiple calls.
3447
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
3448
+ #
3449
+ # # Create a request. To set request fields, pass in keyword arguments.
3450
+ # request = Google::Cloud::Sql::V1::SqlInstancesPerformDiskShrinkRequest.new
3451
+ #
3452
+ # # Call the perform_disk_shrink method.
3453
+ # result = client.perform_disk_shrink request
3454
+ #
3455
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
3456
+ # p result
3457
+ #
3458
+ def perform_disk_shrink request, options = nil
3459
+ raise ::ArgumentError, "request must be provided" if request.nil?
3460
+
3461
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesPerformDiskShrinkRequest
3462
+
3463
+ # Converts hash and nil to an options object
3464
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3465
+
3466
+ # Customize the options with defaults
3467
+ metadata = @config.rpcs.perform_disk_shrink.metadata.to_h
3468
+
3469
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3470
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3471
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3472
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
3473
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3474
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3475
+
3476
+ header_params = {}
3477
+ if request.project
3478
+ header_params["project"] = request.project
3479
+ end
3480
+ if request.instance
3481
+ header_params["instance"] = request.instance
3482
+ end
3483
+
3484
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3485
+ metadata[:"x-goog-request-params"] ||= request_params_header
3486
+
3487
+ options.apply_defaults timeout: @config.rpcs.perform_disk_shrink.timeout,
3488
+ metadata: metadata,
3489
+ retry_policy: @config.rpcs.perform_disk_shrink.retry_policy
3490
+
3491
+ options.apply_defaults timeout: @config.timeout,
3492
+ metadata: @config.metadata,
3493
+ retry_policy: @config.retry_policy
3494
+
3495
+ @sql_instances_service_stub.call_rpc :perform_disk_shrink, request, options: options do |response, operation|
3496
+ yield response, operation if block_given?
3497
+ end
3498
+ rescue ::GRPC::BadStatus => e
3499
+ raise ::Google::Cloud::Error.from_error(e)
3500
+ end
3501
+
3502
+ ##
3503
+ # Get Disk Shrink Config for a given instance.
3504
+ #
3505
+ # @overload get_disk_shrink_config(request, options = nil)
3506
+ # Pass arguments to `get_disk_shrink_config` via a request object, either of type
3507
+ # {::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigRequest} or an equivalent Hash.
3508
+ #
3509
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigRequest, ::Hash]
3510
+ # A request object representing the call parameters. Required. To specify no
3511
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3512
+ # @param options [::Gapic::CallOptions, ::Hash]
3513
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3514
+ #
3515
+ # @overload get_disk_shrink_config(instance: nil, project: nil)
3516
+ # Pass arguments to `get_disk_shrink_config` via keyword arguments. Note that at
3517
+ # least one keyword argument is required. To specify no parameters, or to keep all
3518
+ # the default parameter values, pass an empty Hash as a request object (see above).
3519
+ #
3520
+ # @param instance [::String]
3521
+ # Cloud SQL instance ID. This does not include the project ID.
3522
+ # @param project [::String]
3523
+ # Project ID of the project that contains the instance.
3524
+ #
3525
+ # @yield [response, operation] Access the result along with the RPC operation
3526
+ # @yieldparam response [::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigResponse]
3527
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3528
+ #
3529
+ # @return [::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigResponse]
3530
+ #
3531
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3532
+ #
3533
+ # @example Basic example
3534
+ # require "google/cloud/sql/v1"
3535
+ #
3536
+ # # Create a client object. The client can be reused for multiple calls.
3537
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
3538
+ #
3539
+ # # Create a request. To set request fields, pass in keyword arguments.
3540
+ # request = Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigRequest.new
3541
+ #
3542
+ # # Call the get_disk_shrink_config method.
3543
+ # result = client.get_disk_shrink_config request
3544
+ #
3545
+ # # The returned object is of type Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigResponse.
3546
+ # p result
3547
+ #
3548
+ def get_disk_shrink_config request, options = nil
3549
+ raise ::ArgumentError, "request must be provided" if request.nil?
3550
+
3551
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesGetDiskShrinkConfigRequest
3552
+
3553
+ # Converts hash and nil to an options object
3554
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3555
+
3556
+ # Customize the options with defaults
3557
+ metadata = @config.rpcs.get_disk_shrink_config.metadata.to_h
3558
+
3559
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3560
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3561
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3562
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
3563
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3564
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3565
+
3566
+ header_params = {}
3567
+ if request.project
3568
+ header_params["project"] = request.project
3569
+ end
3570
+ if request.instance
3571
+ header_params["instance"] = request.instance
3572
+ end
3573
+
3574
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3575
+ metadata[:"x-goog-request-params"] ||= request_params_header
3576
+
3577
+ options.apply_defaults timeout: @config.rpcs.get_disk_shrink_config.timeout,
3578
+ metadata: metadata,
3579
+ retry_policy: @config.rpcs.get_disk_shrink_config.retry_policy
3580
+
3581
+ options.apply_defaults timeout: @config.timeout,
3582
+ metadata: @config.metadata,
3583
+ retry_policy: @config.retry_policy
3584
+
3585
+ @sql_instances_service_stub.call_rpc :get_disk_shrink_config, request, options: options do |response, operation|
3586
+ yield response, operation if block_given?
3587
+ end
3588
+ rescue ::GRPC::BadStatus => e
3589
+ raise ::Google::Cloud::Error.from_error(e)
3590
+ end
3591
+
3592
+ ##
3593
+ # Reset Replica Size to primary instance disk size.
3594
+ #
3595
+ # @overload reset_replica_size(request, options = nil)
3596
+ # Pass arguments to `reset_replica_size` via a request object, either of type
3597
+ # {::Google::Cloud::Sql::V1::SqlInstancesResetReplicaSizeRequest} or an equivalent Hash.
3598
+ #
3599
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesResetReplicaSizeRequest, ::Hash]
3600
+ # A request object representing the call parameters. Required. To specify no
3601
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3602
+ # @param options [::Gapic::CallOptions, ::Hash]
3603
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3604
+ #
3605
+ # @overload reset_replica_size(instance: nil, project: nil)
3606
+ # Pass arguments to `reset_replica_size` via keyword arguments. Note that at
3607
+ # least one keyword argument is required. To specify no parameters, or to keep all
3608
+ # the default parameter values, pass an empty Hash as a request object (see above).
3609
+ #
3610
+ # @param instance [::String]
3611
+ # Cloud SQL read replica instance name.
3612
+ # @param project [::String]
3613
+ # ID of the project that contains the read replica.
3614
+ #
3615
+ # @yield [response, operation] Access the result along with the RPC operation
3616
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
3617
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3618
+ #
3619
+ # @return [::Google::Cloud::Sql::V1::Operation]
3620
+ #
3621
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3622
+ #
3623
+ # @example Basic example
3624
+ # require "google/cloud/sql/v1"
3625
+ #
3626
+ # # Create a client object. The client can be reused for multiple calls.
3627
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
3628
+ #
3629
+ # # Create a request. To set request fields, pass in keyword arguments.
3630
+ # request = Google::Cloud::Sql::V1::SqlInstancesResetReplicaSizeRequest.new
3631
+ #
3632
+ # # Call the reset_replica_size method.
3633
+ # result = client.reset_replica_size request
3634
+ #
3635
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
3636
+ # p result
3637
+ #
3638
+ def reset_replica_size request, options = nil
3639
+ raise ::ArgumentError, "request must be provided" if request.nil?
3640
+
3641
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesResetReplicaSizeRequest
3642
+
3643
+ # Converts hash and nil to an options object
3644
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3645
+
3646
+ # Customize the options with defaults
3647
+ metadata = @config.rpcs.reset_replica_size.metadata.to_h
3648
+
3649
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3650
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3651
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3652
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
3653
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3654
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3655
+
3656
+ header_params = {}
3657
+ if request.project
3658
+ header_params["project"] = request.project
3659
+ end
3660
+ if request.instance
3661
+ header_params["instance"] = request.instance
3662
+ end
3663
+
3664
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3665
+ metadata[:"x-goog-request-params"] ||= request_params_header
3666
+
3667
+ options.apply_defaults timeout: @config.rpcs.reset_replica_size.timeout,
3668
+ metadata: metadata,
3669
+ retry_policy: @config.rpcs.reset_replica_size.retry_policy
3670
+
3671
+ options.apply_defaults timeout: @config.timeout,
3672
+ metadata: @config.metadata,
3673
+ retry_policy: @config.retry_policy
3674
+
3675
+ @sql_instances_service_stub.call_rpc :reset_replica_size, request, options: options do |response, operation|
3676
+ yield response, operation if block_given?
3677
+ end
3678
+ rescue ::GRPC::BadStatus => e
3679
+ raise ::Google::Cloud::Error.from_error(e)
3680
+ end
3681
+
3682
+ ##
3683
+ # Get Latest Recovery Time for a given instance.
3684
+ #
3685
+ # @overload get_latest_recovery_time(request, options = nil)
3686
+ # Pass arguments to `get_latest_recovery_time` via a request object, either of type
3687
+ # {::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeRequest} or an equivalent Hash.
3688
+ #
3689
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeRequest, ::Hash]
3690
+ # A request object representing the call parameters. Required. To specify no
3691
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3692
+ # @param options [::Gapic::CallOptions, ::Hash]
3693
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3694
+ #
3695
+ # @overload get_latest_recovery_time(instance: nil, project: nil, source_instance_deletion_time: nil)
3696
+ # Pass arguments to `get_latest_recovery_time` via keyword arguments. Note that at
3697
+ # least one keyword argument is required. To specify no parameters, or to keep all
3698
+ # the default parameter values, pass an empty Hash as a request object (see above).
3699
+ #
3700
+ # @param instance [::String]
3701
+ # Cloud SQL instance ID. This does not include the project ID.
3702
+ # @param project [::String]
3703
+ # Project ID of the project that contains the instance.
3704
+ # @param source_instance_deletion_time [::Google::Protobuf::Timestamp, ::Hash]
3705
+ # The timestamp used to identify the time when the source instance is
3706
+ # deleted. If this instance is deleted, then you must set the timestamp.
3707
+ #
3708
+ # @yield [response, operation] Access the result along with the RPC operation
3709
+ # @yieldparam response [::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeResponse]
3710
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3711
+ #
3712
+ # @return [::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeResponse]
3713
+ #
3714
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3715
+ #
3716
+ # @example Basic example
3717
+ # require "google/cloud/sql/v1"
3718
+ #
3719
+ # # Create a client object. The client can be reused for multiple calls.
3720
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
3721
+ #
3722
+ # # Create a request. To set request fields, pass in keyword arguments.
3723
+ # request = Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeRequest.new
3724
+ #
3725
+ # # Call the get_latest_recovery_time method.
3726
+ # result = client.get_latest_recovery_time request
3727
+ #
3728
+ # # The returned object is of type Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeResponse.
3729
+ # p result
3730
+ #
3731
+ def get_latest_recovery_time request, options = nil
3732
+ raise ::ArgumentError, "request must be provided" if request.nil?
3733
+
3734
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesGetLatestRecoveryTimeRequest
3735
+
3736
+ # Converts hash and nil to an options object
3737
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3738
+
3739
+ # Customize the options with defaults
3740
+ metadata = @config.rpcs.get_latest_recovery_time.metadata.to_h
3741
+
3742
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3743
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3744
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3745
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
3746
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3747
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3748
+
3749
+ header_params = {}
3750
+ if request.project
3751
+ header_params["project"] = request.project
3752
+ end
3753
+ if request.instance
3754
+ header_params["instance"] = request.instance
3755
+ end
3756
+
3757
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3758
+ metadata[:"x-goog-request-params"] ||= request_params_header
3759
+
3760
+ options.apply_defaults timeout: @config.rpcs.get_latest_recovery_time.timeout,
3761
+ metadata: metadata,
3762
+ retry_policy: @config.rpcs.get_latest_recovery_time.retry_policy
3763
+
3764
+ options.apply_defaults timeout: @config.timeout,
3765
+ metadata: @config.metadata,
3766
+ retry_policy: @config.retry_policy
3767
+
3768
+ @sql_instances_service_stub.call_rpc :get_latest_recovery_time, request, options: options do |response, operation|
3769
+ yield response, operation if block_given?
3770
+ end
3771
+ rescue ::GRPC::BadStatus => e
3772
+ raise ::Google::Cloud::Error.from_error(e)
3773
+ end
3774
+
3775
+ ##
3776
+ # Execute SQL statements.
3777
+ #
3778
+ # @overload execute_sql(request, options = nil)
3779
+ # Pass arguments to `execute_sql` via a request object, either of type
3780
+ # {::Google::Cloud::Sql::V1::SqlInstancesExecuteSqlRequest} or an equivalent Hash.
3781
+ #
3782
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesExecuteSqlRequest, ::Hash]
3783
+ # A request object representing the call parameters. Required. To specify no
3784
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3785
+ # @param options [::Gapic::CallOptions, ::Hash]
3786
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3787
+ #
3788
+ # @overload execute_sql(instance: nil, project: nil, body: nil)
3789
+ # Pass arguments to `execute_sql` via keyword arguments. Note that at
3790
+ # least one keyword argument is required. To specify no parameters, or to keep all
3791
+ # the default parameter values, pass an empty Hash as a request object (see above).
3792
+ #
3793
+ # @param instance [::String]
3794
+ # Required. Database instance ID. This does not include the project ID.
3795
+ # @param project [::String]
3796
+ # Required. Project ID of the project that contains the instance.
3797
+ # @param body [::Google::Cloud::Sql::V1::ExecuteSqlPayload, ::Hash]
3798
+ # The request body.
3799
+ #
3800
+ # @yield [response, operation] Access the result along with the RPC operation
3801
+ # @yieldparam response [::Google::Cloud::Sql::V1::SqlInstancesExecuteSqlResponse]
3802
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3803
+ #
3804
+ # @return [::Google::Cloud::Sql::V1::SqlInstancesExecuteSqlResponse]
3805
+ #
3806
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3807
+ #
3808
+ # @example Basic example
3809
+ # require "google/cloud/sql/v1"
3810
+ #
3811
+ # # Create a client object. The client can be reused for multiple calls.
3812
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
3813
+ #
3814
+ # # Create a request. To set request fields, pass in keyword arguments.
3815
+ # request = Google::Cloud::Sql::V1::SqlInstancesExecuteSqlRequest.new
3816
+ #
3817
+ # # Call the execute_sql method.
3818
+ # result = client.execute_sql request
3819
+ #
3820
+ # # The returned object is of type Google::Cloud::Sql::V1::SqlInstancesExecuteSqlResponse.
3821
+ # p result
3822
+ #
3823
+ def execute_sql request, options = nil
3824
+ raise ::ArgumentError, "request must be provided" if request.nil?
3825
+
3826
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesExecuteSqlRequest
3827
+
3828
+ # Converts hash and nil to an options object
3829
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3830
+
3831
+ # Customize the options with defaults
3832
+ metadata = @config.rpcs.execute_sql.metadata.to_h
3833
+
3834
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3835
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3836
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3837
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
3838
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3839
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3840
+
3841
+ header_params = {}
3842
+ if request.project
3843
+ header_params["project"] = request.project
3844
+ end
3845
+ if request.instance
3846
+ header_params["instance"] = request.instance
3847
+ end
3848
+
3849
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3850
+ metadata[:"x-goog-request-params"] ||= request_params_header
3851
+
3852
+ options.apply_defaults timeout: @config.rpcs.execute_sql.timeout,
3853
+ metadata: metadata,
3854
+ retry_policy: @config.rpcs.execute_sql.retry_policy
3855
+
3856
+ options.apply_defaults timeout: @config.timeout,
3857
+ metadata: @config.metadata,
3858
+ retry_policy: @config.retry_policy
3859
+
3860
+ @sql_instances_service_stub.call_rpc :execute_sql, request, options: options do |response, operation|
3861
+ yield response, operation if block_given?
3862
+ end
3863
+ rescue ::GRPC::BadStatus => e
3864
+ raise ::Google::Cloud::Error.from_error(e)
3865
+ end
3866
+
3867
+ ##
3868
+ # Acquire a lease for the setup of SQL Server Reporting Services (SSRS).
3869
+ #
3870
+ # @overload acquire_ssrs_lease(request, options = nil)
3871
+ # Pass arguments to `acquire_ssrs_lease` via a request object, either of type
3872
+ # {::Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseRequest} or an equivalent Hash.
3873
+ #
3874
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseRequest, ::Hash]
3875
+ # A request object representing the call parameters. Required. To specify no
3876
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3877
+ # @param options [::Gapic::CallOptions, ::Hash]
3878
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3879
+ #
3880
+ # @overload acquire_ssrs_lease(instance: nil, project: nil, body: nil)
3881
+ # Pass arguments to `acquire_ssrs_lease` via keyword arguments. Note that at
3882
+ # least one keyword argument is required. To specify no parameters, or to keep all
3883
+ # the default parameter values, pass an empty Hash as a request object (see above).
3884
+ #
3885
+ # @param instance [::String]
3886
+ # Required. Cloud SQL instance ID. This doesn't include the project ID. It's
3887
+ # composed of lowercase letters, numbers, and hyphens, and it must start with
3888
+ # a letter. The total length must be 98 characters or less (Example:
3889
+ # instance-id).
3890
+ # @param project [::String]
3891
+ # Required. Project ID of the project that contains the instance (Example:
3892
+ # project-id).
3893
+ # @param body [::Google::Cloud::Sql::V1::InstancesAcquireSsrsLeaseRequest, ::Hash]
3894
+ # Required. The request body.
3895
+ #
3896
+ # @yield [response, operation] Access the result along with the RPC operation
3897
+ # @yieldparam response [::Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseResponse]
3898
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3899
+ #
3900
+ # @return [::Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseResponse]
3901
+ #
3902
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3903
+ #
3904
+ # @example Basic example
3905
+ # require "google/cloud/sql/v1"
3906
+ #
3907
+ # # Create a client object. The client can be reused for multiple calls.
3908
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
3909
+ #
3910
+ # # Create a request. To set request fields, pass in keyword arguments.
3911
+ # request = Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseRequest.new
3912
+ #
3913
+ # # Call the acquire_ssrs_lease method.
3914
+ # result = client.acquire_ssrs_lease request
3915
+ #
3916
+ # # The returned object is of type Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseResponse.
3917
+ # p result
3918
+ #
3919
+ def acquire_ssrs_lease request, options = nil
3920
+ raise ::ArgumentError, "request must be provided" if request.nil?
3921
+
3922
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesAcquireSsrsLeaseRequest
3923
+
3924
+ # Converts hash and nil to an options object
3925
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
3926
+
3927
+ # Customize the options with defaults
3928
+ metadata = @config.rpcs.acquire_ssrs_lease.metadata.to_h
3929
+
3930
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
3931
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
3932
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
3933
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
3934
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
3935
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
3936
+
3937
+ header_params = {}
3938
+ if request.project
3939
+ header_params["project"] = request.project
3940
+ end
3941
+ if request.instance
3942
+ header_params["instance"] = request.instance
3943
+ end
3944
+
3945
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
3946
+ metadata[:"x-goog-request-params"] ||= request_params_header
3947
+
3948
+ options.apply_defaults timeout: @config.rpcs.acquire_ssrs_lease.timeout,
3949
+ metadata: metadata,
3950
+ retry_policy: @config.rpcs.acquire_ssrs_lease.retry_policy
3951
+
3952
+ options.apply_defaults timeout: @config.timeout,
3953
+ metadata: @config.metadata,
3954
+ retry_policy: @config.retry_policy
3955
+
3956
+ @sql_instances_service_stub.call_rpc :acquire_ssrs_lease, request, options: options do |response, operation|
3957
+ yield response, operation if block_given?
3958
+ end
3959
+ rescue ::GRPC::BadStatus => e
3960
+ raise ::Google::Cloud::Error.from_error(e)
3961
+ end
3962
+
3963
+ ##
3964
+ # Release a lease for the setup of SQL Server Reporting Services (SSRS).
3965
+ #
3966
+ # @overload release_ssrs_lease(request, options = nil)
3967
+ # Pass arguments to `release_ssrs_lease` via a request object, either of type
3968
+ # {::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseRequest} or an equivalent Hash.
3969
+ #
3970
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseRequest, ::Hash]
3971
+ # A request object representing the call parameters. Required. To specify no
3972
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3973
+ # @param options [::Gapic::CallOptions, ::Hash]
3974
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3975
+ #
3976
+ # @overload release_ssrs_lease(instance: nil, project: nil)
3977
+ # Pass arguments to `release_ssrs_lease` via keyword arguments. Note that at
3978
+ # least one keyword argument is required. To specify no parameters, or to keep all
3979
+ # the default parameter values, pass an empty Hash as a request object (see above).
3980
+ #
3981
+ # @param instance [::String]
3982
+ # Required. The Cloud SQL instance ID. This doesn't include the project ID.
3983
+ # The instance ID contains lowercase letters, numbers, and hyphens, and it
3984
+ # must start with a letter. This ID can have a maximum length of 98
3985
+ # characters.
3986
+ # @param project [::String]
3987
+ # Required. The project ID that contains the instance.
3988
+ #
3989
+ # @yield [response, operation] Access the result along with the RPC operation
3990
+ # @yieldparam response [::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseResponse]
3991
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3992
+ #
3993
+ # @return [::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseResponse]
3994
+ #
3995
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3996
+ #
3997
+ # @example Basic example
3998
+ # require "google/cloud/sql/v1"
3999
+ #
4000
+ # # Create a client object. The client can be reused for multiple calls.
4001
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
4002
+ #
4003
+ # # Create a request. To set request fields, pass in keyword arguments.
4004
+ # request = Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseRequest.new
4005
+ #
4006
+ # # Call the release_ssrs_lease method.
4007
+ # result = client.release_ssrs_lease request
4008
+ #
4009
+ # # The returned object is of type Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseResponse.
4010
+ # p result
4011
+ #
4012
+ def release_ssrs_lease request, options = nil
4013
+ raise ::ArgumentError, "request must be provided" if request.nil?
4014
+
4015
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesReleaseSsrsLeaseRequest
4016
+
4017
+ # Converts hash and nil to an options object
4018
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
4019
+
4020
+ # Customize the options with defaults
4021
+ metadata = @config.rpcs.release_ssrs_lease.metadata.to_h
4022
+
4023
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
4024
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
4025
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
4026
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
4027
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
4028
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
4029
+
4030
+ header_params = {}
4031
+ if request.project
4032
+ header_params["project"] = request.project
4033
+ end
4034
+ if request.instance
4035
+ header_params["instance"] = request.instance
4036
+ end
4037
+
4038
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
4039
+ metadata[:"x-goog-request-params"] ||= request_params_header
4040
+
4041
+ options.apply_defaults timeout: @config.rpcs.release_ssrs_lease.timeout,
4042
+ metadata: metadata,
4043
+ retry_policy: @config.rpcs.release_ssrs_lease.retry_policy
4044
+
4045
+ options.apply_defaults timeout: @config.timeout,
4046
+ metadata: @config.metadata,
4047
+ retry_policy: @config.retry_policy
4048
+
4049
+ @sql_instances_service_stub.call_rpc :release_ssrs_lease, request, options: options do |response, operation|
4050
+ yield response, operation if block_given?
4051
+ end
4052
+ rescue ::GRPC::BadStatus => e
4053
+ raise ::Google::Cloud::Error.from_error(e)
4054
+ end
4055
+
4056
+ ##
4057
+ # Execute MVU Pre-checks
4058
+ #
4059
+ # @overload pre_check_major_version_upgrade(request, options = nil)
4060
+ # Pass arguments to `pre_check_major_version_upgrade` via a request object, either of type
4061
+ # {::Google::Cloud::Sql::V1::SqlInstancesPreCheckMajorVersionUpgradeRequest} or an equivalent Hash.
4062
+ #
4063
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesPreCheckMajorVersionUpgradeRequest, ::Hash]
4064
+ # A request object representing the call parameters. Required. To specify no
4065
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
4066
+ # @param options [::Gapic::CallOptions, ::Hash]
4067
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
4068
+ #
4069
+ # @overload pre_check_major_version_upgrade(instance: nil, project: nil, body: nil)
4070
+ # Pass arguments to `pre_check_major_version_upgrade` via keyword arguments. Note that at
4071
+ # least one keyword argument is required. To specify no parameters, or to keep all
4072
+ # the default parameter values, pass an empty Hash as a request object (see above).
4073
+ #
4074
+ # @param instance [::String]
4075
+ # Required. Cloud SQL instance ID. This does not include the project ID.
4076
+ # @param project [::String]
4077
+ # Required. Project ID of the project that contains the instance.
4078
+ # @param body [::Google::Cloud::Sql::V1::InstancesPreCheckMajorVersionUpgradeRequest, ::Hash]
4079
+ # Required. The context for request to perform the pre-check major version
4080
+ # upgrade operation.
4081
+ #
4082
+ # @yield [response, operation] Access the result along with the RPC operation
4083
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
4084
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
4085
+ #
4086
+ # @return [::Google::Cloud::Sql::V1::Operation]
4087
+ #
4088
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
4089
+ #
4090
+ # @example Basic example
4091
+ # require "google/cloud/sql/v1"
4092
+ #
4093
+ # # Create a client object. The client can be reused for multiple calls.
4094
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
4095
+ #
4096
+ # # Create a request. To set request fields, pass in keyword arguments.
4097
+ # request = Google::Cloud::Sql::V1::SqlInstancesPreCheckMajorVersionUpgradeRequest.new
4098
+ #
4099
+ # # Call the pre_check_major_version_upgrade method.
4100
+ # result = client.pre_check_major_version_upgrade request
4101
+ #
4102
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
4103
+ # p result
4104
+ #
4105
+ def pre_check_major_version_upgrade request, options = nil
4106
+ raise ::ArgumentError, "request must be provided" if request.nil?
4107
+
4108
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesPreCheckMajorVersionUpgradeRequest
4109
+
4110
+ # Converts hash and nil to an options object
4111
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
4112
+
4113
+ # Customize the options with defaults
4114
+ metadata = @config.rpcs.pre_check_major_version_upgrade.metadata.to_h
4115
+
4116
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
4117
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
4118
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
4119
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
4120
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
4121
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
4122
+
4123
+ header_params = {}
4124
+ if request.project
4125
+ header_params["project"] = request.project
4126
+ end
4127
+ if request.instance
4128
+ header_params["instance"] = request.instance
4129
+ end
4130
+
4131
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
4132
+ metadata[:"x-goog-request-params"] ||= request_params_header
4133
+
4134
+ options.apply_defaults timeout: @config.rpcs.pre_check_major_version_upgrade.timeout,
4135
+ metadata: metadata,
4136
+ retry_policy: @config.rpcs.pre_check_major_version_upgrade.retry_policy
4137
+
4138
+ options.apply_defaults timeout: @config.timeout,
4139
+ metadata: @config.metadata,
4140
+ retry_policy: @config.retry_policy
4141
+
4142
+ @sql_instances_service_stub.call_rpc :pre_check_major_version_upgrade, request, options: options do |response, operation|
4143
+ yield response, operation if block_given?
4144
+ end
4145
+ rescue ::GRPC::BadStatus => e
4146
+ raise ::Google::Cloud::Error.from_error(e)
4147
+ end
4148
+
4149
+ ##
4150
+ # Point in time restore for an instance managed by Google Cloud Backup and
4151
+ # Disaster Recovery.
4152
+ #
4153
+ # @overload point_in_time_restore(request, options = nil)
4154
+ # Pass arguments to `point_in_time_restore` via a request object, either of type
4155
+ # {::Google::Cloud::Sql::V1::SqlInstancesPointInTimeRestoreRequest} or an equivalent Hash.
4156
+ #
4157
+ # @param request [::Google::Cloud::Sql::V1::SqlInstancesPointInTimeRestoreRequest, ::Hash]
4158
+ # A request object representing the call parameters. Required. To specify no
4159
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
4160
+ # @param options [::Gapic::CallOptions, ::Hash]
4161
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
4162
+ #
4163
+ # @overload point_in_time_restore(parent: nil, context: nil)
4164
+ # Pass arguments to `point_in_time_restore` via keyword arguments. Note that at
4165
+ # least one keyword argument is required. To specify no parameters, or to keep all
4166
+ # the default parameter values, pass an empty Hash as a request object (see above).
4167
+ #
4168
+ # @param parent [::String]
4169
+ # Required. The parent resource where you created this instance.
4170
+ # Format: projects/\\{project}
4171
+ # @param context [::Google::Cloud::Sql::V1::PointInTimeRestoreContext, ::Hash]
4172
+ # Required. The context for request to perform a PITR on a Google Cloud
4173
+ # Backup and Disaster Recovery managed instance.
4174
+ #
4175
+ # @yield [response, operation] Access the result along with the RPC operation
4176
+ # @yieldparam response [::Google::Cloud::Sql::V1::Operation]
4177
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
4178
+ #
4179
+ # @return [::Google::Cloud::Sql::V1::Operation]
4180
+ #
4181
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
4182
+ #
4183
+ # @example Basic example
4184
+ # require "google/cloud/sql/v1"
4185
+ #
4186
+ # # Create a client object. The client can be reused for multiple calls.
4187
+ # client = Google::Cloud::Sql::V1::SqlInstancesService::Client.new
4188
+ #
4189
+ # # Create a request. To set request fields, pass in keyword arguments.
4190
+ # request = Google::Cloud::Sql::V1::SqlInstancesPointInTimeRestoreRequest.new
4191
+ #
4192
+ # # Call the point_in_time_restore method.
4193
+ # result = client.point_in_time_restore request
4194
+ #
4195
+ # # The returned object is of type Google::Cloud::Sql::V1::Operation.
4196
+ # p result
4197
+ #
4198
+ def point_in_time_restore request, options = nil
4199
+ raise ::ArgumentError, "request must be provided" if request.nil?
4200
+
4201
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1::SqlInstancesPointInTimeRestoreRequest
4202
+
4203
+ # Converts hash and nil to an options object
4204
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
4205
+
4206
+ # Customize the options with defaults
4207
+ metadata = @config.rpcs.point_in_time_restore.metadata.to_h
4208
+
4209
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
4210
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
4211
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
4212
+ gapic_version: ::Google::Cloud::Sql::V1::VERSION
4213
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
4214
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
4215
+
4216
+ header_params = {}
4217
+ if request.parent
4218
+ header_params["parent"] = request.parent
4219
+ end
4220
+
4221
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
4222
+ metadata[:"x-goog-request-params"] ||= request_params_header
4223
+
4224
+ options.apply_defaults timeout: @config.rpcs.point_in_time_restore.timeout,
4225
+ metadata: metadata,
4226
+ retry_policy: @config.rpcs.point_in_time_restore.retry_policy
4227
+
4228
+ options.apply_defaults timeout: @config.timeout,
4229
+ metadata: @config.metadata,
4230
+ retry_policy: @config.retry_policy
4231
+
4232
+ @sql_instances_service_stub.call_rpc :point_in_time_restore, request, options: options do |response, operation|
4233
+ yield response, operation if block_given?
4234
+ end
4235
+ rescue ::GRPC::BadStatus => e
4236
+ raise ::Google::Cloud::Error.from_error(e)
4237
+ end
4238
+
4239
+ ##
4240
+ # Configuration class for the SqlInstancesService API.
4241
+ #
4242
+ # This class represents the configuration for SqlInstancesService,
4243
+ # providing control over timeouts, retry behavior, logging, transport
4244
+ # parameters, and other low-level controls. Certain parameters can also be
4245
+ # applied individually to specific RPCs. See
4246
+ # {::Google::Cloud::Sql::V1::SqlInstancesService::Client::Configuration::Rpcs}
4247
+ # for a list of RPCs that can be configured independently.
4248
+ #
4249
+ # Configuration can be applied globally to all clients, or to a single client
4250
+ # on construction.
4251
+ #
4252
+ # @example
4253
+ #
4254
+ # # Modify the global config, setting the timeout for
4255
+ # # add_server_ca to 20 seconds,
4256
+ # # and all remaining timeouts to 10 seconds.
4257
+ # ::Google::Cloud::Sql::V1::SqlInstancesService::Client.configure do |config|
4258
+ # config.timeout = 10.0
4259
+ # config.rpcs.add_server_ca.timeout = 20.0
4260
+ # end
4261
+ #
4262
+ # # Apply the above configuration only to a new client.
4263
+ # client = ::Google::Cloud::Sql::V1::SqlInstancesService::Client.new do |config|
4264
+ # config.timeout = 10.0
4265
+ # config.rpcs.add_server_ca.timeout = 20.0
4266
+ # end
4267
+ #
4268
+ # @!attribute [rw] endpoint
4269
+ # A custom service endpoint, as a hostname or hostname:port. The default is
4270
+ # nil, indicating to use the default endpoint in the current universe domain.
4271
+ # @return [::String,nil]
4272
+ # @!attribute [rw] credentials
4273
+ # Credentials to send with calls. You may provide any of the following types:
4274
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
4275
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
4276
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
4277
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
4278
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
4279
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
4280
+ # * (`nil`) indicating no credentials
4281
+ #
4282
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
4283
+ # is deprecated. Providing an unvalidated credential configuration to
4284
+ # Google APIs can compromise the security of your systems and data.
4285
+ #
4286
+ # @example
4287
+ #
4288
+ # # The recommended way to provide credentials is to use the `make_creds` method
4289
+ # # on the appropriate credentials class for your environment.
4290
+ #
4291
+ # require "googleauth"
4292
+ #
4293
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
4294
+ # json_key_io: ::File.open("/path/to/keyfile.json")
4295
+ # )
4296
+ #
4297
+ # client = ::Google::Cloud::Sql::V1::SqlInstancesService::Client.new do |config|
4298
+ # config.credentials = credentials
4299
+ # end
4300
+ #
4301
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
4302
+ # external source for authentication to Google Cloud, you must validate it before
4303
+ # providing it to a Google API client library. Providing an unvalidated credential
4304
+ # configuration to Google APIs can compromise the security of your systems and data.
4305
+ # For more information, refer to [Validate credential configurations from external
4306
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
4307
+ # @return [::Object]
4308
+ # @!attribute [rw] scope
4309
+ # The OAuth scopes
4310
+ # @return [::Array<::String>]
4311
+ # @!attribute [rw] lib_name
4312
+ # The library name as recorded in instrumentation and logging
4313
+ # @return [::String]
4314
+ # @!attribute [rw] lib_version
4315
+ # The library version as recorded in instrumentation and logging
4316
+ # @return [::String]
4317
+ # @!attribute [rw] channel_args
4318
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
4319
+ # `GRPC::Core::Channel` object is provided as the credential.
4320
+ # @return [::Hash]
4321
+ # @!attribute [rw] interceptors
4322
+ # An array of interceptors that are run before calls are executed.
4323
+ # @return [::Array<::GRPC::ClientInterceptor>]
4324
+ # @!attribute [rw] timeout
4325
+ # The call timeout in seconds.
4326
+ # @return [::Numeric]
4327
+ # @!attribute [rw] metadata
4328
+ # Additional gRPC headers to be sent with the call.
4329
+ # @return [::Hash{::Symbol=>::String}]
4330
+ # @!attribute [rw] retry_policy
4331
+ # The retry policy. The value is a hash with the following keys:
4332
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
4333
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
4334
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
4335
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
4336
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
4337
+ # trigger a retry.
4338
+ # @return [::Hash]
4339
+ # @!attribute [rw] quota_project
4340
+ # A separate project against which to charge quota.
4341
+ # @return [::String]
4342
+ # @!attribute [rw] universe_domain
4343
+ # The universe domain within which to make requests. This determines the
4344
+ # default endpoint URL. The default value of nil uses the environment
4345
+ # universe (usually the default "googleapis.com" universe).
4346
+ # @return [::String,nil]
4347
+ # @!attribute [rw] logger
4348
+ # A custom logger to use for request/response debug logging, or the value
4349
+ # `:default` (the default) to construct a default logger, or `nil` to
4350
+ # explicitly disable logging.
4351
+ # @return [::Logger,:default,nil]
4352
+ #
4353
+ class Configuration
4354
+ extend ::Gapic::Config
4355
+
4356
+ # @private
4357
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
4358
+ DEFAULT_ENDPOINT = "sqladmin.googleapis.com"
4359
+
4360
+ config_attr :endpoint, nil, ::String, nil
4361
+ config_attr :credentials, nil do |value|
4362
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
4363
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
4364
+ allowed.any? { |klass| klass === value }
4365
+ end
4366
+ config_attr :scope, nil, ::String, ::Array, nil
4367
+ config_attr :lib_name, nil, ::String, nil
4368
+ config_attr :lib_version, nil, ::String, nil
4369
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
4370
+ config_attr :interceptors, nil, ::Array, nil
4371
+ config_attr :timeout, nil, ::Numeric, nil
4372
+ config_attr :metadata, nil, ::Hash, nil
4373
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
4374
+ config_attr :quota_project, nil, ::String, nil
4375
+ config_attr :universe_domain, nil, ::String, nil
4376
+ config_attr :logger, :default, ::Logger, nil, :default
4377
+
4378
+ # @private
4379
+ def initialize parent_config = nil
4380
+ @parent_config = parent_config unless parent_config.nil?
4381
+
4382
+ yield self if block_given?
4383
+ end
4384
+
4385
+ ##
4386
+ # Configurations for individual RPCs
4387
+ # @return [Rpcs]
4388
+ #
4389
+ def rpcs
4390
+ @rpcs ||= begin
4391
+ parent_rpcs = nil
4392
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
4393
+ Rpcs.new parent_rpcs
4394
+ end
4395
+ end
4396
+
4397
+ ##
4398
+ # Configuration for the channel pool
4399
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
4400
+ #
4401
+ def channel_pool
4402
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
4403
+ end
4404
+
4405
+ ##
4406
+ # Configuration RPC class for the SqlInstancesService API.
4407
+ #
4408
+ # Includes fields providing the configuration for each RPC in this service.
4409
+ # Each configuration object is of type `Gapic::Config::Method` and includes
4410
+ # the following configuration fields:
4411
+ #
4412
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
4413
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
4414
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
4415
+ # include the following keys:
4416
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
4417
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
4418
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
4419
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
4420
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
4421
+ # trigger a retry.
4422
+ #
4423
+ class Rpcs
4424
+ ##
4425
+ # RPC-specific configuration for `add_server_ca`
4426
+ # @return [::Gapic::Config::Method]
4427
+ #
4428
+ attr_reader :add_server_ca
4429
+ ##
4430
+ # RPC-specific configuration for `add_server_certificate`
4431
+ # @return [::Gapic::Config::Method]
4432
+ #
4433
+ attr_reader :add_server_certificate
4434
+ ##
4435
+ # RPC-specific configuration for `add_entra_id_certificate`
4436
+ # @return [::Gapic::Config::Method]
4437
+ #
4438
+ attr_reader :add_entra_id_certificate
4439
+ ##
4440
+ # RPC-specific configuration for `call_clone`
4441
+ # @return [::Gapic::Config::Method]
4442
+ #
4443
+ attr_reader :call_clone
4444
+ ##
4445
+ # RPC-specific configuration for `delete`
4446
+ # @return [::Gapic::Config::Method]
4447
+ #
4448
+ attr_reader :delete
4449
+ ##
4450
+ # RPC-specific configuration for `demote_master`
4451
+ # @return [::Gapic::Config::Method]
4452
+ #
4453
+ attr_reader :demote_master
4454
+ ##
4455
+ # RPC-specific configuration for `demote`
4456
+ # @return [::Gapic::Config::Method]
4457
+ #
4458
+ attr_reader :demote
4459
+ ##
4460
+ # RPC-specific configuration for `export`
4461
+ # @return [::Gapic::Config::Method]
4462
+ #
4463
+ attr_reader :export
4464
+ ##
4465
+ # RPC-specific configuration for `failover`
4466
+ # @return [::Gapic::Config::Method]
4467
+ #
4468
+ attr_reader :failover
4469
+ ##
4470
+ # RPC-specific configuration for `reencrypt`
4471
+ # @return [::Gapic::Config::Method]
4472
+ #
4473
+ attr_reader :reencrypt
4474
+ ##
4475
+ # RPC-specific configuration for `get`
4476
+ # @return [::Gapic::Config::Method]
4477
+ #
4478
+ attr_reader :get
4479
+ ##
4480
+ # RPC-specific configuration for `import`
4481
+ # @return [::Gapic::Config::Method]
4482
+ #
4483
+ attr_reader :import
4484
+ ##
4485
+ # RPC-specific configuration for `insert`
4486
+ # @return [::Gapic::Config::Method]
4487
+ #
4488
+ attr_reader :insert
4489
+ ##
4490
+ # RPC-specific configuration for `list`
4491
+ # @return [::Gapic::Config::Method]
4492
+ #
4493
+ attr_reader :list
4494
+ ##
4495
+ # RPC-specific configuration for `list_server_cas`
4496
+ # @return [::Gapic::Config::Method]
4497
+ #
4498
+ attr_reader :list_server_cas
4499
+ ##
4500
+ # RPC-specific configuration for `list_server_certificates`
4501
+ # @return [::Gapic::Config::Method]
4502
+ #
4503
+ attr_reader :list_server_certificates
4504
+ ##
4505
+ # RPC-specific configuration for `list_entra_id_certificates`
4506
+ # @return [::Gapic::Config::Method]
4507
+ #
4508
+ attr_reader :list_entra_id_certificates
4509
+ ##
4510
+ # RPC-specific configuration for `patch`
4511
+ # @return [::Gapic::Config::Method]
4512
+ #
4513
+ attr_reader :patch
4514
+ ##
4515
+ # RPC-specific configuration for `promote_replica`
4516
+ # @return [::Gapic::Config::Method]
4517
+ #
4518
+ attr_reader :promote_replica
4519
+ ##
4520
+ # RPC-specific configuration for `switchover`
4521
+ # @return [::Gapic::Config::Method]
4522
+ #
4523
+ attr_reader :switchover
4524
+ ##
4525
+ # RPC-specific configuration for `reset_ssl_config`
4526
+ # @return [::Gapic::Config::Method]
4527
+ #
4528
+ attr_reader :reset_ssl_config
4529
+ ##
4530
+ # RPC-specific configuration for `restart`
4531
+ # @return [::Gapic::Config::Method]
4532
+ #
4533
+ attr_reader :restart
4534
+ ##
4535
+ # RPC-specific configuration for `restore_backup`
4536
+ # @return [::Gapic::Config::Method]
4537
+ #
4538
+ attr_reader :restore_backup
4539
+ ##
4540
+ # RPC-specific configuration for `rotate_server_ca`
4541
+ # @return [::Gapic::Config::Method]
4542
+ #
4543
+ attr_reader :rotate_server_ca
4544
+ ##
4545
+ # RPC-specific configuration for `rotate_server_certificate`
4546
+ # @return [::Gapic::Config::Method]
4547
+ #
4548
+ attr_reader :rotate_server_certificate
4549
+ ##
4550
+ # RPC-specific configuration for `rotate_entra_id_certificate`
4551
+ # @return [::Gapic::Config::Method]
4552
+ #
4553
+ attr_reader :rotate_entra_id_certificate
4554
+ ##
4555
+ # RPC-specific configuration for `start_replica`
4556
+ # @return [::Gapic::Config::Method]
4557
+ #
4558
+ attr_reader :start_replica
4559
+ ##
4560
+ # RPC-specific configuration for `stop_replica`
4561
+ # @return [::Gapic::Config::Method]
4562
+ #
4563
+ attr_reader :stop_replica
4564
+ ##
4565
+ # RPC-specific configuration for `truncate_log`
4566
+ # @return [::Gapic::Config::Method]
4567
+ #
4568
+ attr_reader :truncate_log
4569
+ ##
4570
+ # RPC-specific configuration for `update`
4571
+ # @return [::Gapic::Config::Method]
4572
+ #
4573
+ attr_reader :update
4574
+ ##
4575
+ # RPC-specific configuration for `create_ephemeral`
4576
+ # @return [::Gapic::Config::Method]
4577
+ #
4578
+ attr_reader :create_ephemeral
4579
+ ##
4580
+ # RPC-specific configuration for `reschedule_maintenance`
4581
+ # @return [::Gapic::Config::Method]
4582
+ #
4583
+ attr_reader :reschedule_maintenance
4584
+ ##
4585
+ # RPC-specific configuration for `verify_external_sync_settings`
4586
+ # @return [::Gapic::Config::Method]
4587
+ #
4588
+ attr_reader :verify_external_sync_settings
4589
+ ##
4590
+ # RPC-specific configuration for `start_external_sync`
4591
+ # @return [::Gapic::Config::Method]
4592
+ #
4593
+ attr_reader :start_external_sync
4594
+ ##
4595
+ # RPC-specific configuration for `perform_disk_shrink`
4596
+ # @return [::Gapic::Config::Method]
4597
+ #
4598
+ attr_reader :perform_disk_shrink
4599
+ ##
4600
+ # RPC-specific configuration for `get_disk_shrink_config`
4601
+ # @return [::Gapic::Config::Method]
4602
+ #
4603
+ attr_reader :get_disk_shrink_config
4604
+ ##
4605
+ # RPC-specific configuration for `reset_replica_size`
4606
+ # @return [::Gapic::Config::Method]
4607
+ #
4608
+ attr_reader :reset_replica_size
4609
+ ##
4610
+ # RPC-specific configuration for `get_latest_recovery_time`
4611
+ # @return [::Gapic::Config::Method]
4612
+ #
4613
+ attr_reader :get_latest_recovery_time
4614
+ ##
4615
+ # RPC-specific configuration for `execute_sql`
4616
+ # @return [::Gapic::Config::Method]
4617
+ #
4618
+ attr_reader :execute_sql
4619
+ ##
4620
+ # RPC-specific configuration for `acquire_ssrs_lease`
4621
+ # @return [::Gapic::Config::Method]
4622
+ #
4623
+ attr_reader :acquire_ssrs_lease
4624
+ ##
4625
+ # RPC-specific configuration for `release_ssrs_lease`
4626
+ # @return [::Gapic::Config::Method]
4627
+ #
4628
+ attr_reader :release_ssrs_lease
4629
+ ##
4630
+ # RPC-specific configuration for `pre_check_major_version_upgrade`
4631
+ # @return [::Gapic::Config::Method]
4632
+ #
4633
+ attr_reader :pre_check_major_version_upgrade
4634
+ ##
4635
+ # RPC-specific configuration for `point_in_time_restore`
4636
+ # @return [::Gapic::Config::Method]
4637
+ #
4638
+ attr_reader :point_in_time_restore
4639
+
4640
+ # @private
4641
+ def initialize parent_rpcs = nil
4642
+ add_server_ca_config = parent_rpcs.add_server_ca if parent_rpcs.respond_to? :add_server_ca
4643
+ @add_server_ca = ::Gapic::Config::Method.new add_server_ca_config
4644
+ add_server_certificate_config = parent_rpcs.add_server_certificate if parent_rpcs.respond_to? :add_server_certificate
4645
+ @add_server_certificate = ::Gapic::Config::Method.new add_server_certificate_config
4646
+ add_entra_id_certificate_config = parent_rpcs.add_entra_id_certificate if parent_rpcs.respond_to? :add_entra_id_certificate
4647
+ @add_entra_id_certificate = ::Gapic::Config::Method.new add_entra_id_certificate_config
4648
+ call_clone_config = parent_rpcs.call_clone if parent_rpcs.respond_to? :call_clone
4649
+ @call_clone = ::Gapic::Config::Method.new call_clone_config
4650
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
4651
+ @delete = ::Gapic::Config::Method.new delete_config
4652
+ demote_master_config = parent_rpcs.demote_master if parent_rpcs.respond_to? :demote_master
4653
+ @demote_master = ::Gapic::Config::Method.new demote_master_config
4654
+ demote_config = parent_rpcs.demote if parent_rpcs.respond_to? :demote
4655
+ @demote = ::Gapic::Config::Method.new demote_config
4656
+ export_config = parent_rpcs.export if parent_rpcs.respond_to? :export
4657
+ @export = ::Gapic::Config::Method.new export_config
4658
+ failover_config = parent_rpcs.failover if parent_rpcs.respond_to? :failover
4659
+ @failover = ::Gapic::Config::Method.new failover_config
4660
+ reencrypt_config = parent_rpcs.reencrypt if parent_rpcs.respond_to? :reencrypt
4661
+ @reencrypt = ::Gapic::Config::Method.new reencrypt_config
4662
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
4663
+ @get = ::Gapic::Config::Method.new get_config
4664
+ import_config = parent_rpcs.import if parent_rpcs.respond_to? :import
4665
+ @import = ::Gapic::Config::Method.new import_config
4666
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
4667
+ @insert = ::Gapic::Config::Method.new insert_config
4668
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
4669
+ @list = ::Gapic::Config::Method.new list_config
4670
+ list_server_cas_config = parent_rpcs.list_server_cas if parent_rpcs.respond_to? :list_server_cas
4671
+ @list_server_cas = ::Gapic::Config::Method.new list_server_cas_config
4672
+ list_server_certificates_config = parent_rpcs.list_server_certificates if parent_rpcs.respond_to? :list_server_certificates
4673
+ @list_server_certificates = ::Gapic::Config::Method.new list_server_certificates_config
4674
+ list_entra_id_certificates_config = parent_rpcs.list_entra_id_certificates if parent_rpcs.respond_to? :list_entra_id_certificates
4675
+ @list_entra_id_certificates = ::Gapic::Config::Method.new list_entra_id_certificates_config
4676
+ patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
4677
+ @patch = ::Gapic::Config::Method.new patch_config
4678
+ promote_replica_config = parent_rpcs.promote_replica if parent_rpcs.respond_to? :promote_replica
4679
+ @promote_replica = ::Gapic::Config::Method.new promote_replica_config
4680
+ switchover_config = parent_rpcs.switchover if parent_rpcs.respond_to? :switchover
4681
+ @switchover = ::Gapic::Config::Method.new switchover_config
4682
+ reset_ssl_config_config = parent_rpcs.reset_ssl_config if parent_rpcs.respond_to? :reset_ssl_config
4683
+ @reset_ssl_config = ::Gapic::Config::Method.new reset_ssl_config_config
4684
+ restart_config = parent_rpcs.restart if parent_rpcs.respond_to? :restart
4685
+ @restart = ::Gapic::Config::Method.new restart_config
4686
+ restore_backup_config = parent_rpcs.restore_backup if parent_rpcs.respond_to? :restore_backup
4687
+ @restore_backup = ::Gapic::Config::Method.new restore_backup_config
4688
+ rotate_server_ca_config = parent_rpcs.rotate_server_ca if parent_rpcs.respond_to? :rotate_server_ca
4689
+ @rotate_server_ca = ::Gapic::Config::Method.new rotate_server_ca_config
4690
+ rotate_server_certificate_config = parent_rpcs.rotate_server_certificate if parent_rpcs.respond_to? :rotate_server_certificate
4691
+ @rotate_server_certificate = ::Gapic::Config::Method.new rotate_server_certificate_config
4692
+ rotate_entra_id_certificate_config = parent_rpcs.rotate_entra_id_certificate if parent_rpcs.respond_to? :rotate_entra_id_certificate
4693
+ @rotate_entra_id_certificate = ::Gapic::Config::Method.new rotate_entra_id_certificate_config
4694
+ start_replica_config = parent_rpcs.start_replica if parent_rpcs.respond_to? :start_replica
4695
+ @start_replica = ::Gapic::Config::Method.new start_replica_config
4696
+ stop_replica_config = parent_rpcs.stop_replica if parent_rpcs.respond_to? :stop_replica
4697
+ @stop_replica = ::Gapic::Config::Method.new stop_replica_config
4698
+ truncate_log_config = parent_rpcs.truncate_log if parent_rpcs.respond_to? :truncate_log
4699
+ @truncate_log = ::Gapic::Config::Method.new truncate_log_config
4700
+ update_config = parent_rpcs.update if parent_rpcs.respond_to? :update
4701
+ @update = ::Gapic::Config::Method.new update_config
4702
+ create_ephemeral_config = parent_rpcs.create_ephemeral if parent_rpcs.respond_to? :create_ephemeral
4703
+ @create_ephemeral = ::Gapic::Config::Method.new create_ephemeral_config
4704
+ reschedule_maintenance_config = parent_rpcs.reschedule_maintenance if parent_rpcs.respond_to? :reschedule_maintenance
4705
+ @reschedule_maintenance = ::Gapic::Config::Method.new reschedule_maintenance_config
4706
+ verify_external_sync_settings_config = parent_rpcs.verify_external_sync_settings if parent_rpcs.respond_to? :verify_external_sync_settings
4707
+ @verify_external_sync_settings = ::Gapic::Config::Method.new verify_external_sync_settings_config
4708
+ start_external_sync_config = parent_rpcs.start_external_sync if parent_rpcs.respond_to? :start_external_sync
4709
+ @start_external_sync = ::Gapic::Config::Method.new start_external_sync_config
4710
+ perform_disk_shrink_config = parent_rpcs.perform_disk_shrink if parent_rpcs.respond_to? :perform_disk_shrink
4711
+ @perform_disk_shrink = ::Gapic::Config::Method.new perform_disk_shrink_config
4712
+ get_disk_shrink_config_config = parent_rpcs.get_disk_shrink_config if parent_rpcs.respond_to? :get_disk_shrink_config
4713
+ @get_disk_shrink_config = ::Gapic::Config::Method.new get_disk_shrink_config_config
4714
+ reset_replica_size_config = parent_rpcs.reset_replica_size if parent_rpcs.respond_to? :reset_replica_size
4715
+ @reset_replica_size = ::Gapic::Config::Method.new reset_replica_size_config
4716
+ get_latest_recovery_time_config = parent_rpcs.get_latest_recovery_time if parent_rpcs.respond_to? :get_latest_recovery_time
4717
+ @get_latest_recovery_time = ::Gapic::Config::Method.new get_latest_recovery_time_config
4718
+ execute_sql_config = parent_rpcs.execute_sql if parent_rpcs.respond_to? :execute_sql
4719
+ @execute_sql = ::Gapic::Config::Method.new execute_sql_config
4720
+ acquire_ssrs_lease_config = parent_rpcs.acquire_ssrs_lease if parent_rpcs.respond_to? :acquire_ssrs_lease
4721
+ @acquire_ssrs_lease = ::Gapic::Config::Method.new acquire_ssrs_lease_config
4722
+ release_ssrs_lease_config = parent_rpcs.release_ssrs_lease if parent_rpcs.respond_to? :release_ssrs_lease
4723
+ @release_ssrs_lease = ::Gapic::Config::Method.new release_ssrs_lease_config
4724
+ pre_check_major_version_upgrade_config = parent_rpcs.pre_check_major_version_upgrade if parent_rpcs.respond_to? :pre_check_major_version_upgrade
4725
+ @pre_check_major_version_upgrade = ::Gapic::Config::Method.new pre_check_major_version_upgrade_config
4726
+ point_in_time_restore_config = parent_rpcs.point_in_time_restore if parent_rpcs.respond_to? :point_in_time_restore
4727
+ @point_in_time_restore = ::Gapic::Config::Method.new point_in_time_restore_config
4728
+
4729
+ yield self if block_given?
4730
+ end
4731
+ end
4732
+ end
4733
+ end
4734
+ end
4735
+ end
4736
+ end
4737
+ end
4738
+ end