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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +12 -0
  3. data/AUTHENTICATION.md +122 -0
  4. data/README.md +153 -8
  5. data/lib/google/cloud/sql/v1beta4/cloud_sql_connect_pb.rb +35 -0
  6. data/lib/google/cloud/sql/v1beta4/cloud_sql_connect_services_pb.rb +53 -0
  7. data/lib/google/cloud/sql/v1beta4/cloud_sql_data_pb.rb +35 -0
  8. data/lib/google/cloud/sql/v1beta4/cloud_sql_data_services_pb.rb +80 -0
  9. data/lib/google/cloud/sql/v1beta4/cloud_sql_iam_policies_pb.rb +23 -0
  10. data/lib/google/cloud/sql/v1beta4/cloud_sql_iam_policies_services_pb.rb +29 -0
  11. data/lib/google/cloud/sql/v1beta4/cloud_sql_pb.rb +117 -0
  12. data/lib/google/cloud/sql/v1beta4/cloud_sql_resources_pb.rb +192 -0
  13. data/lib/google/cloud/sql/v1beta4/cloud_sql_services_pb.rb +325 -0
  14. data/lib/google/cloud/sql/v1beta4/cloud_sql_tiers_pb.rb +26 -0
  15. data/lib/google/cloud/sql/v1beta4/cloud_sql_tiers_services_pb.rb +46 -0
  16. data/lib/google/cloud/sql/v1beta4/cloud_sql_users_pb.rb +40 -0
  17. data/lib/google/cloud/sql/v1beta4/cloud_sql_users_services_pb.rb +52 -0
  18. data/lib/google/cloud/sql/v1beta4/rest.rb +46 -0
  19. data/lib/google/cloud/sql/v1beta4/sql_backup_runs_service/client.rb +807 -0
  20. data/lib/google/cloud/sql/v1beta4/sql_backup_runs_service/credentials.rb +48 -0
  21. data/lib/google/cloud/sql/v1beta4/sql_backup_runs_service/rest/client.rb +718 -0
  22. data/lib/google/cloud/sql/v1beta4/sql_backup_runs_service/rest/service_stub.rb +332 -0
  23. data/lib/google/cloud/sql/v1beta4/sql_backup_runs_service/rest.rb +49 -0
  24. data/lib/google/cloud/sql/v1beta4/sql_backup_runs_service.rb +52 -0
  25. data/lib/google/cloud/sql/v1beta4/sql_backups_service/client.rb +896 -0
  26. data/lib/google/cloud/sql/v1beta4/sql_backups_service/credentials.rb +48 -0
  27. data/lib/google/cloud/sql/v1beta4/sql_backups_service/paths.rb +83 -0
  28. data/lib/google/cloud/sql/v1beta4/sql_backups_service/rest/client.rb +818 -0
  29. data/lib/google/cloud/sql/v1beta4/sql_backups_service/rest/service_stub.rb +388 -0
  30. data/lib/google/cloud/sql/v1beta4/sql_backups_service/rest.rb +50 -0
  31. data/lib/google/cloud/sql/v1beta4/sql_backups_service.rb +53 -0
  32. data/lib/google/cloud/sql/v1beta4/sql_connect_service/client.rb +705 -0
  33. data/lib/google/cloud/sql/v1beta4/sql_connect_service/credentials.rb +48 -0
  34. data/lib/google/cloud/sql/v1beta4/sql_connect_service/rest/client.rb +632 -0
  35. data/lib/google/cloud/sql/v1beta4/sql_connect_service/rest/service_stub.rb +268 -0
  36. data/lib/google/cloud/sql/v1beta4/sql_connect_service/rest.rb +51 -0
  37. data/lib/google/cloud/sql/v1beta4/sql_connect_service.rb +54 -0
  38. data/lib/google/cloud/sql/v1beta4/sql_data_service/client.rb +520 -0
  39. data/lib/google/cloud/sql/v1beta4/sql_data_service/credentials.rb +48 -0
  40. data/lib/google/cloud/sql/v1beta4/sql_data_service/paths.rb +50 -0
  41. data/lib/google/cloud/sql/v1beta4/sql_data_service.rb +49 -0
  42. data/lib/google/cloud/sql/v1beta4/sql_databases_service/client.rb +1009 -0
  43. data/lib/google/cloud/sql/v1beta4/sql_databases_service/credentials.rb +48 -0
  44. data/lib/google/cloud/sql/v1beta4/sql_databases_service/rest/client.rb +894 -0
  45. data/lib/google/cloud/sql/v1beta4/sql_databases_service/rest/service_stub.rb +460 -0
  46. data/lib/google/cloud/sql/v1beta4/sql_databases_service/rest.rb +49 -0
  47. data/lib/google/cloud/sql/v1beta4/sql_databases_service.rb +52 -0
  48. data/lib/google/cloud/sql/v1beta4/sql_flags_service/client.rb +486 -0
  49. data/lib/google/cloud/sql/v1beta4/sql_flags_service/credentials.rb +48 -0
  50. data/lib/google/cloud/sql/v1beta4/sql_flags_service/rest/client.rb +444 -0
  51. data/lib/google/cloud/sql/v1beta4/sql_flags_service/rest/service_stub.rb +140 -0
  52. data/lib/google/cloud/sql/v1beta4/sql_flags_service/rest.rb +49 -0
  53. data/lib/google/cloud/sql/v1beta4/sql_flags_service.rb +52 -0
  54. data/lib/google/cloud/sql/v1beta4/sql_instances_service/client.rb +4745 -0
  55. data/lib/google/cloud/sql/v1beta4/sql_instances_service/credentials.rb +48 -0
  56. data/lib/google/cloud/sql/v1beta4/sql_instances_service/paths.rb +159 -0
  57. data/lib/google/cloud/sql/v1beta4/sql_instances_service/rest/client.rb +4281 -0
  58. data/lib/google/cloud/sql/v1beta4/sql_instances_service/rest/service_stub.rb +2769 -0
  59. data/lib/google/cloud/sql/v1beta4/sql_instances_service/rest.rb +50 -0
  60. data/lib/google/cloud/sql/v1beta4/sql_instances_service.rb +53 -0
  61. data/lib/google/cloud/sql/v1beta4/sql_operations_service/client.rb +699 -0
  62. data/lib/google/cloud/sql/v1beta4/sql_operations_service/credentials.rb +48 -0
  63. data/lib/google/cloud/sql/v1beta4/sql_operations_service/rest/client.rb +629 -0
  64. data/lib/google/cloud/sql/v1beta4/sql_operations_service/rest/service_stub.rb +266 -0
  65. data/lib/google/cloud/sql/v1beta4/sql_operations_service/rest.rb +49 -0
  66. data/lib/google/cloud/sql/v1beta4/sql_operations_service.rb +52 -0
  67. data/lib/google/cloud/sql/v1beta4/sql_ssl_certs_service/client.rb +802 -0
  68. data/lib/google/cloud/sql/v1beta4/sql_ssl_certs_service/credentials.rb +48 -0
  69. data/lib/google/cloud/sql/v1beta4/sql_ssl_certs_service/rest/client.rb +713 -0
  70. data/lib/google/cloud/sql/v1beta4/sql_ssl_certs_service/rest/service_stub.rb +332 -0
  71. data/lib/google/cloud/sql/v1beta4/sql_ssl_certs_service/rest.rb +49 -0
  72. data/lib/google/cloud/sql/v1beta4/sql_ssl_certs_service.rb +52 -0
  73. data/lib/google/cloud/sql/v1beta4/sql_tiers_service/client.rb +493 -0
  74. data/lib/google/cloud/sql/v1beta4/sql_tiers_service/credentials.rb +48 -0
  75. data/lib/google/cloud/sql/v1beta4/sql_tiers_service/rest/client.rb +443 -0
  76. data/lib/google/cloud/sql/v1beta4/sql_tiers_service/rest/service_stub.rb +142 -0
  77. data/lib/google/cloud/sql/v1beta4/sql_tiers_service/rest.rb +51 -0
  78. data/lib/google/cloud/sql/v1beta4/sql_tiers_service.rb +54 -0
  79. data/lib/google/cloud/sql/v1beta4/sql_users_service/client.rb +915 -0
  80. data/lib/google/cloud/sql/v1beta4/sql_users_service/credentials.rb +48 -0
  81. data/lib/google/cloud/sql/v1beta4/sql_users_service/rest/client.rb +819 -0
  82. data/lib/google/cloud/sql/v1beta4/sql_users_service/rest/service_stub.rb +394 -0
  83. data/lib/google/cloud/sql/v1beta4/sql_users_service/rest.rb +49 -0
  84. data/lib/google/cloud/sql/v1beta4/sql_users_service.rb +52 -0
  85. data/lib/google/cloud/sql/v1beta4/version.rb +7 -2
  86. data/lib/google/cloud/sql/v1beta4.rb +56 -0
  87. data/lib/google-cloud-sql-v1beta4.rb +21 -0
  88. data/proto_docs/README.md +4 -0
  89. data/proto_docs/google/api/client.rb +593 -0
  90. data/proto_docs/google/api/field_behavior.rb +85 -0
  91. data/proto_docs/google/api/field_info.rb +88 -0
  92. data/proto_docs/google/api/launch_stage.rb +71 -0
  93. data/proto_docs/google/api/resource.rb +227 -0
  94. data/proto_docs/google/cloud/sql/v1beta4/cloud_sql.rb +1329 -0
  95. data/proto_docs/google/cloud/sql/v1beta4/cloud_sql_connect.rb +207 -0
  96. data/proto_docs/google/cloud/sql/v1beta4/cloud_sql_data.rb +189 -0
  97. data/proto_docs/google/cloud/sql/v1beta4/cloud_sql_resources.rb +4489 -0
  98. data/proto_docs/google/cloud/sql/v1beta4/cloud_sql_tiers.rb +68 -0
  99. data/proto_docs/google/cloud/sql/v1beta4/cloud_sql_users.rb +308 -0
  100. data/proto_docs/google/protobuf/any.rb +145 -0
  101. data/proto_docs/google/protobuf/duration.rb +98 -0
  102. data/proto_docs/google/protobuf/empty.rb +34 -0
  103. data/proto_docs/google/protobuf/field_mask.rb +229 -0
  104. data/proto_docs/google/protobuf/timestamp.rb +127 -0
  105. data/proto_docs/google/protobuf/wrappers.rb +148 -0
  106. data/proto_docs/google/rpc/status.rb +48 -0
  107. data/proto_docs/google/type/interval.rb +45 -0
  108. metadata +153 -9
@@ -0,0 +1,894 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Copyright 2026 Google LLC
4
+ #
5
+ # Licensed under the Apache License, Version 2.0 (the "License");
6
+ # you may not use this file except in compliance with the License.
7
+ # You may obtain a copy of the License at
8
+ #
9
+ # https://www.apache.org/licenses/LICENSE-2.0
10
+ #
11
+ # Unless required by applicable law or agreed to in writing, software
12
+ # distributed under the License is distributed on an "AS IS" BASIS,
13
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ # See the License for the specific language governing permissions and
15
+ # limitations under the License.
16
+
17
+ # Auto-generated by gapic-generator-ruby. DO NOT EDIT!
18
+
19
+ require "google/cloud/errors"
20
+ require "google/cloud/sql/v1beta4/cloud_sql_pb"
21
+ require "google/cloud/sql/v1beta4/sql_databases_service/rest/service_stub"
22
+ require "google/cloud/location/rest"
23
+
24
+ module Google
25
+ module Cloud
26
+ module Sql
27
+ module V1beta4
28
+ module SqlDatabasesService
29
+ module Rest
30
+ ##
31
+ # REST client for the SqlDatabasesService service.
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "sqladmin.$UNIVERSE_DOMAIN$"
39
+
40
+ # @private
41
+ attr_reader :sql_databases_service_stub
42
+
43
+ ##
44
+ # Configure the SqlDatabasesService Client class.
45
+ #
46
+ # See {::Google::Cloud::Sql::V1beta4::SqlDatabasesService::Rest::Client::Configuration}
47
+ # for a description of the configuration fields.
48
+ #
49
+ # @example
50
+ #
51
+ # # Modify the configuration for all SqlDatabasesService clients
52
+ # ::Google::Cloud::Sql::V1beta4::SqlDatabasesService::Rest::Client.configure do |config|
53
+ # config.timeout = 10.0
54
+ # end
55
+ #
56
+ # @yield [config] Configure the Client client.
57
+ # @yieldparam config [Client::Configuration]
58
+ #
59
+ # @return [Client::Configuration]
60
+ #
61
+ def self.configure
62
+ @configure ||= begin
63
+ namespace = ["Google", "Cloud", "Sql", "V1beta4"]
64
+ parent_config = while namespace.any?
65
+ parent_name = namespace.join "::"
66
+ parent_const = const_get parent_name
67
+ break parent_const.configure if parent_const.respond_to? :configure
68
+ namespace.pop
69
+ end
70
+ default_config = Client::Configuration.new parent_config
71
+
72
+ default_config.timeout = 60.0
73
+
74
+ default_config
75
+ end
76
+ yield @configure if block_given?
77
+ @configure
78
+ end
79
+
80
+ ##
81
+ # Configure the SqlDatabasesService Client instance.
82
+ #
83
+ # The configuration is set to the derived mode, meaning that values can be changed,
84
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
85
+ # should be made on {Client.configure}.
86
+ #
87
+ # See {::Google::Cloud::Sql::V1beta4::SqlDatabasesService::Rest::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_databases_service_stub.universe_domain
107
+ end
108
+
109
+ ##
110
+ # Create a new SqlDatabasesService REST client object.
111
+ #
112
+ # @example
113
+ #
114
+ # # Create a client using the default configuration
115
+ # client = ::Google::Cloud::Sql::V1beta4::SqlDatabasesService::Rest::Client.new
116
+ #
117
+ # # Create a client using a custom configuration
118
+ # client = ::Google::Cloud::Sql::V1beta4::SqlDatabasesService::Rest::Client.new do |config|
119
+ # config.timeout = 10.0
120
+ # end
121
+ #
122
+ # @yield [config] Configure the SqlDatabasesService client.
123
+ # @yieldparam config [Client::Configuration]
124
+ #
125
+ def initialize
126
+ # Create the configuration object
127
+ @config = Configuration.new Client.configure
128
+
129
+ # Yield the configuration if needed
130
+ yield @config if block_given?
131
+
132
+ # Create credentials
133
+ credentials = @config.credentials
134
+ # Use self-signed JWT if the endpoint is unchanged from default,
135
+ # but only if the default endpoint does not have a region prefix.
136
+ enable_self_signed_jwt = @config.endpoint.nil? ||
137
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
138
+ !@config.endpoint.split(".").first.include?("-"))
139
+ credentials ||= Credentials.default scope: @config.scope,
140
+ enable_self_signed_jwt: enable_self_signed_jwt
141
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
142
+ credentials = Credentials.new credentials, scope: @config.scope
143
+ end
144
+
145
+ @quota_project_id = @config.quota_project
146
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
147
+
148
+ @sql_databases_service_stub = ::Google::Cloud::Sql::V1beta4::SqlDatabasesService::Rest::ServiceStub.new(
149
+ endpoint: @config.endpoint,
150
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
151
+ universe_domain: @config.universe_domain,
152
+ credentials: credentials,
153
+ logger: @config.logger
154
+ )
155
+
156
+ @sql_databases_service_stub.logger(stub: true)&.info do |entry|
157
+ entry.set_system_name
158
+ entry.set_service
159
+ entry.message = "Created client for #{entry.service}"
160
+ entry.set_credentials_fields credentials
161
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
162
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
163
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
164
+ end
165
+
166
+ @location_client = Google::Cloud::Location::Locations::Rest::Client.new do |config|
167
+ config.credentials = credentials
168
+ config.quota_project = @quota_project_id
169
+ config.endpoint = @sql_databases_service_stub.endpoint
170
+ config.universe_domain = @sql_databases_service_stub.universe_domain
171
+ config.logger = @sql_databases_service_stub.logger if config.respond_to? :logger=
172
+ end
173
+ end
174
+
175
+ ##
176
+ # Get the associated client for mix-in of the Locations.
177
+ #
178
+ # @return [Google::Cloud::Location::Locations::Rest::Client]
179
+ #
180
+ attr_reader :location_client
181
+
182
+ ##
183
+ # The logger used for request/response debug logging.
184
+ #
185
+ # @return [Logger]
186
+ #
187
+ def logger
188
+ @sql_databases_service_stub.logger
189
+ end
190
+
191
+ # Service calls
192
+
193
+ ##
194
+ # Deletes a database from a Cloud SQL instance.
195
+ #
196
+ # @overload delete(request, options = nil)
197
+ # Pass arguments to `delete` via a request object, either of type
198
+ # {::Google::Cloud::Sql::V1beta4::SqlDatabasesDeleteRequest} or an equivalent Hash.
199
+ #
200
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlDatabasesDeleteRequest, ::Hash]
201
+ # A request object representing the call parameters. Required. To specify no
202
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
203
+ # @param options [::Gapic::CallOptions, ::Hash]
204
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
205
+ #
206
+ # @overload delete(database: nil, instance: nil, project: nil)
207
+ # Pass arguments to `delete` via keyword arguments. Note that at
208
+ # least one keyword argument is required. To specify no parameters, or to keep all
209
+ # the default parameter values, pass an empty Hash as a request object (see above).
210
+ #
211
+ # @param database [::String]
212
+ # Name of the database to be deleted in the instance.
213
+ # @param instance [::String]
214
+ # Database instance ID. This does not include the project ID.
215
+ # @param project [::String]
216
+ # Project ID of the project that contains the instance.
217
+ # @yield [result, operation] Access the result along with the TransportOperation object
218
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
219
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
220
+ #
221
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
222
+ #
223
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
224
+ #
225
+ # @example Basic example
226
+ # require "google/cloud/sql/v1beta4"
227
+ #
228
+ # # Create a client object. The client can be reused for multiple calls.
229
+ # client = Google::Cloud::Sql::V1beta4::SqlDatabasesService::Rest::Client.new
230
+ #
231
+ # # Create a request. To set request fields, pass in keyword arguments.
232
+ # request = Google::Cloud::Sql::V1beta4::SqlDatabasesDeleteRequest.new
233
+ #
234
+ # # Call the delete method.
235
+ # result = client.delete request
236
+ #
237
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
238
+ # p result
239
+ #
240
+ def delete request, options = nil
241
+ raise ::ArgumentError, "request must be provided" if request.nil?
242
+
243
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlDatabasesDeleteRequest
244
+
245
+ # Converts hash and nil to an options object
246
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
247
+
248
+ # Customize the options with defaults
249
+ call_metadata = @config.rpcs.delete.metadata.to_h
250
+
251
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
252
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
253
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
254
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
255
+ transports_version_send: [:rest]
256
+
257
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
258
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
259
+
260
+ options.apply_defaults timeout: @config.rpcs.delete.timeout,
261
+ metadata: call_metadata,
262
+ retry_policy: @config.rpcs.delete.retry_policy
263
+
264
+ options.apply_defaults timeout: @config.timeout,
265
+ metadata: @config.metadata,
266
+ retry_policy: @config.retry_policy
267
+
268
+ @sql_databases_service_stub.delete request, options do |result, operation|
269
+ yield result, operation if block_given?
270
+ end
271
+ rescue ::Gapic::Rest::Error => e
272
+ raise ::Google::Cloud::Error.from_error(e)
273
+ end
274
+
275
+ ##
276
+ # Retrieves a resource containing information about a database inside a Cloud
277
+ # SQL instance.
278
+ #
279
+ # @overload get(request, options = nil)
280
+ # Pass arguments to `get` via a request object, either of type
281
+ # {::Google::Cloud::Sql::V1beta4::SqlDatabasesGetRequest} or an equivalent Hash.
282
+ #
283
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlDatabasesGetRequest, ::Hash]
284
+ # A request object representing the call parameters. Required. To specify no
285
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
286
+ # @param options [::Gapic::CallOptions, ::Hash]
287
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
288
+ #
289
+ # @overload get(database: nil, instance: nil, project: nil)
290
+ # Pass arguments to `get` via keyword arguments. Note that at
291
+ # least one keyword argument is required. To specify no parameters, or to keep all
292
+ # the default parameter values, pass an empty Hash as a request object (see above).
293
+ #
294
+ # @param database [::String]
295
+ # Name of the database in the instance.
296
+ # @param instance [::String]
297
+ # Database instance ID. This does not include the project ID.
298
+ # @param project [::String]
299
+ # Project ID of the project that contains the instance.
300
+ # @yield [result, operation] Access the result along with the TransportOperation object
301
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Database]
302
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
303
+ #
304
+ # @return [::Google::Cloud::Sql::V1beta4::Database]
305
+ #
306
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
307
+ #
308
+ # @example Basic example
309
+ # require "google/cloud/sql/v1beta4"
310
+ #
311
+ # # Create a client object. The client can be reused for multiple calls.
312
+ # client = Google::Cloud::Sql::V1beta4::SqlDatabasesService::Rest::Client.new
313
+ #
314
+ # # Create a request. To set request fields, pass in keyword arguments.
315
+ # request = Google::Cloud::Sql::V1beta4::SqlDatabasesGetRequest.new
316
+ #
317
+ # # Call the get method.
318
+ # result = client.get request
319
+ #
320
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Database.
321
+ # p result
322
+ #
323
+ def get request, options = nil
324
+ raise ::ArgumentError, "request must be provided" if request.nil?
325
+
326
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlDatabasesGetRequest
327
+
328
+ # Converts hash and nil to an options object
329
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
330
+
331
+ # Customize the options with defaults
332
+ call_metadata = @config.rpcs.get.metadata.to_h
333
+
334
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
335
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
336
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
337
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
338
+ transports_version_send: [:rest]
339
+
340
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
341
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
342
+
343
+ options.apply_defaults timeout: @config.rpcs.get.timeout,
344
+ metadata: call_metadata,
345
+ retry_policy: @config.rpcs.get.retry_policy
346
+
347
+ options.apply_defaults timeout: @config.timeout,
348
+ metadata: @config.metadata,
349
+ retry_policy: @config.retry_policy
350
+
351
+ @sql_databases_service_stub.get request, options do |result, operation|
352
+ yield result, operation if block_given?
353
+ end
354
+ rescue ::Gapic::Rest::Error => e
355
+ raise ::Google::Cloud::Error.from_error(e)
356
+ end
357
+
358
+ ##
359
+ # Inserts a resource containing information about a database inside a Cloud
360
+ # SQL instance.
361
+ #
362
+ # **Note:** You can't modify the default character set and collation.
363
+ #
364
+ # @overload insert(request, options = nil)
365
+ # Pass arguments to `insert` via a request object, either of type
366
+ # {::Google::Cloud::Sql::V1beta4::SqlDatabasesInsertRequest} or an equivalent Hash.
367
+ #
368
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlDatabasesInsertRequest, ::Hash]
369
+ # A request object representing the call parameters. Required. To specify no
370
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
371
+ # @param options [::Gapic::CallOptions, ::Hash]
372
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
373
+ #
374
+ # @overload insert(instance: nil, project: nil, body: nil)
375
+ # Pass arguments to `insert` via keyword arguments. Note that at
376
+ # least one keyword argument is required. To specify no parameters, or to keep all
377
+ # the default parameter values, pass an empty Hash as a request object (see above).
378
+ #
379
+ # @param instance [::String]
380
+ # Database instance ID. This does not include the project ID.
381
+ # @param project [::String]
382
+ # Project ID of the project that contains the instance.
383
+ # @param body [::Google::Cloud::Sql::V1beta4::Database, ::Hash]
384
+ # @yield [result, operation] Access the result along with the TransportOperation object
385
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
386
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
387
+ #
388
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
389
+ #
390
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
391
+ #
392
+ # @example Basic example
393
+ # require "google/cloud/sql/v1beta4"
394
+ #
395
+ # # Create a client object. The client can be reused for multiple calls.
396
+ # client = Google::Cloud::Sql::V1beta4::SqlDatabasesService::Rest::Client.new
397
+ #
398
+ # # Create a request. To set request fields, pass in keyword arguments.
399
+ # request = Google::Cloud::Sql::V1beta4::SqlDatabasesInsertRequest.new
400
+ #
401
+ # # Call the insert method.
402
+ # result = client.insert request
403
+ #
404
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
405
+ # p result
406
+ #
407
+ def insert request, options = nil
408
+ raise ::ArgumentError, "request must be provided" if request.nil?
409
+
410
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlDatabasesInsertRequest
411
+
412
+ # Converts hash and nil to an options object
413
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
414
+
415
+ # Customize the options with defaults
416
+ call_metadata = @config.rpcs.insert.metadata.to_h
417
+
418
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
419
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
420
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
421
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
422
+ transports_version_send: [:rest]
423
+
424
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
425
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
426
+
427
+ options.apply_defaults timeout: @config.rpcs.insert.timeout,
428
+ metadata: call_metadata,
429
+ retry_policy: @config.rpcs.insert.retry_policy
430
+
431
+ options.apply_defaults timeout: @config.timeout,
432
+ metadata: @config.metadata,
433
+ retry_policy: @config.retry_policy
434
+
435
+ @sql_databases_service_stub.insert request, options do |result, operation|
436
+ yield result, operation if block_given?
437
+ end
438
+ rescue ::Gapic::Rest::Error => e
439
+ raise ::Google::Cloud::Error.from_error(e)
440
+ end
441
+
442
+ ##
443
+ # Lists databases in the specified Cloud SQL instance.
444
+ #
445
+ # @overload list(request, options = nil)
446
+ # Pass arguments to `list` via a request object, either of type
447
+ # {::Google::Cloud::Sql::V1beta4::SqlDatabasesListRequest} or an equivalent Hash.
448
+ #
449
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlDatabasesListRequest, ::Hash]
450
+ # A request object representing the call parameters. Required. To specify no
451
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
452
+ # @param options [::Gapic::CallOptions, ::Hash]
453
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
454
+ #
455
+ # @overload list(instance: nil, project: nil)
456
+ # Pass arguments to `list` via keyword arguments. Note that at
457
+ # least one keyword argument is required. To specify no parameters, or to keep all
458
+ # the default parameter values, pass an empty Hash as a request object (see above).
459
+ #
460
+ # @param instance [::String]
461
+ # Cloud SQL instance ID. This does not include the project ID.
462
+ # @param project [::String]
463
+ # Project ID of the project that contains the instance.
464
+ # @yield [result, operation] Access the result along with the TransportOperation object
465
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::DatabasesListResponse]
466
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
467
+ #
468
+ # @return [::Google::Cloud::Sql::V1beta4::DatabasesListResponse]
469
+ #
470
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
471
+ #
472
+ # @example Basic example
473
+ # require "google/cloud/sql/v1beta4"
474
+ #
475
+ # # Create a client object. The client can be reused for multiple calls.
476
+ # client = Google::Cloud::Sql::V1beta4::SqlDatabasesService::Rest::Client.new
477
+ #
478
+ # # Create a request. To set request fields, pass in keyword arguments.
479
+ # request = Google::Cloud::Sql::V1beta4::SqlDatabasesListRequest.new
480
+ #
481
+ # # Call the list method.
482
+ # result = client.list request
483
+ #
484
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::DatabasesListResponse.
485
+ # p result
486
+ #
487
+ def list request, options = nil
488
+ raise ::ArgumentError, "request must be provided" if request.nil?
489
+
490
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlDatabasesListRequest
491
+
492
+ # Converts hash and nil to an options object
493
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
494
+
495
+ # Customize the options with defaults
496
+ call_metadata = @config.rpcs.list.metadata.to_h
497
+
498
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
499
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
500
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
501
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
502
+ transports_version_send: [:rest]
503
+
504
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
505
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
506
+
507
+ options.apply_defaults timeout: @config.rpcs.list.timeout,
508
+ metadata: call_metadata,
509
+ retry_policy: @config.rpcs.list.retry_policy
510
+
511
+ options.apply_defaults timeout: @config.timeout,
512
+ metadata: @config.metadata,
513
+ retry_policy: @config.retry_policy
514
+
515
+ @sql_databases_service_stub.list request, options do |result, operation|
516
+ yield result, operation if block_given?
517
+ end
518
+ rescue ::Gapic::Rest::Error => e
519
+ raise ::Google::Cloud::Error.from_error(e)
520
+ end
521
+
522
+ ##
523
+ # Partially updates a resource containing information about a database inside
524
+ # a Cloud SQL instance. This method supports patch semantics.
525
+ #
526
+ # @overload patch(request, options = nil)
527
+ # Pass arguments to `patch` via a request object, either of type
528
+ # {::Google::Cloud::Sql::V1beta4::SqlDatabasesUpdateRequest} or an equivalent Hash.
529
+ #
530
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlDatabasesUpdateRequest, ::Hash]
531
+ # A request object representing the call parameters. Required. To specify no
532
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
533
+ # @param options [::Gapic::CallOptions, ::Hash]
534
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
535
+ #
536
+ # @overload patch(database: nil, instance: nil, project: nil, body: nil)
537
+ # Pass arguments to `patch` via keyword arguments. Note that at
538
+ # least one keyword argument is required. To specify no parameters, or to keep all
539
+ # the default parameter values, pass an empty Hash as a request object (see above).
540
+ #
541
+ # @param database [::String]
542
+ # Name of the database to be updated in the instance.
543
+ # @param instance [::String]
544
+ # Database instance ID. This does not include the project ID.
545
+ # @param project [::String]
546
+ # Project ID of the project that contains the instance.
547
+ # @param body [::Google::Cloud::Sql::V1beta4::Database, ::Hash]
548
+ # @yield [result, operation] Access the result along with the TransportOperation object
549
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
550
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
551
+ #
552
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
553
+ #
554
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
555
+ #
556
+ # @example Basic example
557
+ # require "google/cloud/sql/v1beta4"
558
+ #
559
+ # # Create a client object. The client can be reused for multiple calls.
560
+ # client = Google::Cloud::Sql::V1beta4::SqlDatabasesService::Rest::Client.new
561
+ #
562
+ # # Create a request. To set request fields, pass in keyword arguments.
563
+ # request = Google::Cloud::Sql::V1beta4::SqlDatabasesUpdateRequest.new
564
+ #
565
+ # # Call the patch method.
566
+ # result = client.patch request
567
+ #
568
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
569
+ # p result
570
+ #
571
+ def patch request, options = nil
572
+ raise ::ArgumentError, "request must be provided" if request.nil?
573
+
574
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlDatabasesUpdateRequest
575
+
576
+ # Converts hash and nil to an options object
577
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
578
+
579
+ # Customize the options with defaults
580
+ call_metadata = @config.rpcs.patch.metadata.to_h
581
+
582
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
583
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
584
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
585
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
586
+ transports_version_send: [:rest]
587
+
588
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
589
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
590
+
591
+ options.apply_defaults timeout: @config.rpcs.patch.timeout,
592
+ metadata: call_metadata,
593
+ retry_policy: @config.rpcs.patch.retry_policy
594
+
595
+ options.apply_defaults timeout: @config.timeout,
596
+ metadata: @config.metadata,
597
+ retry_policy: @config.retry_policy
598
+
599
+ @sql_databases_service_stub.patch request, options do |result, operation|
600
+ yield result, operation if block_given?
601
+ end
602
+ rescue ::Gapic::Rest::Error => e
603
+ raise ::Google::Cloud::Error.from_error(e)
604
+ end
605
+
606
+ ##
607
+ # Updates a resource containing information about a database inside a Cloud
608
+ # SQL instance.
609
+ #
610
+ # @overload update(request, options = nil)
611
+ # Pass arguments to `update` via a request object, either of type
612
+ # {::Google::Cloud::Sql::V1beta4::SqlDatabasesUpdateRequest} or an equivalent Hash.
613
+ #
614
+ # @param request [::Google::Cloud::Sql::V1beta4::SqlDatabasesUpdateRequest, ::Hash]
615
+ # A request object representing the call parameters. Required. To specify no
616
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
617
+ # @param options [::Gapic::CallOptions, ::Hash]
618
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
619
+ #
620
+ # @overload update(database: nil, instance: nil, project: nil, body: nil)
621
+ # Pass arguments to `update` via keyword arguments. Note that at
622
+ # least one keyword argument is required. To specify no parameters, or to keep all
623
+ # the default parameter values, pass an empty Hash as a request object (see above).
624
+ #
625
+ # @param database [::String]
626
+ # Name of the database to be updated in the instance.
627
+ # @param instance [::String]
628
+ # Database instance ID. This does not include the project ID.
629
+ # @param project [::String]
630
+ # Project ID of the project that contains the instance.
631
+ # @param body [::Google::Cloud::Sql::V1beta4::Database, ::Hash]
632
+ # @yield [result, operation] Access the result along with the TransportOperation object
633
+ # @yieldparam result [::Google::Cloud::Sql::V1beta4::Operation]
634
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
635
+ #
636
+ # @return [::Google::Cloud::Sql::V1beta4::Operation]
637
+ #
638
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
639
+ #
640
+ # @example Basic example
641
+ # require "google/cloud/sql/v1beta4"
642
+ #
643
+ # # Create a client object. The client can be reused for multiple calls.
644
+ # client = Google::Cloud::Sql::V1beta4::SqlDatabasesService::Rest::Client.new
645
+ #
646
+ # # Create a request. To set request fields, pass in keyword arguments.
647
+ # request = Google::Cloud::Sql::V1beta4::SqlDatabasesUpdateRequest.new
648
+ #
649
+ # # Call the update method.
650
+ # result = client.update request
651
+ #
652
+ # # The returned object is of type Google::Cloud::Sql::V1beta4::Operation.
653
+ # p result
654
+ #
655
+ def update request, options = nil
656
+ raise ::ArgumentError, "request must be provided" if request.nil?
657
+
658
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Sql::V1beta4::SqlDatabasesUpdateRequest
659
+
660
+ # Converts hash and nil to an options object
661
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
662
+
663
+ # Customize the options with defaults
664
+ call_metadata = @config.rpcs.update.metadata.to_h
665
+
666
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
667
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
668
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
669
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION,
670
+ transports_version_send: [:rest]
671
+
672
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
673
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
674
+
675
+ options.apply_defaults timeout: @config.rpcs.update.timeout,
676
+ metadata: call_metadata,
677
+ retry_policy: @config.rpcs.update.retry_policy
678
+
679
+ options.apply_defaults timeout: @config.timeout,
680
+ metadata: @config.metadata,
681
+ retry_policy: @config.retry_policy
682
+
683
+ @sql_databases_service_stub.update request, options do |result, operation|
684
+ yield result, operation if block_given?
685
+ end
686
+ rescue ::Gapic::Rest::Error => e
687
+ raise ::Google::Cloud::Error.from_error(e)
688
+ end
689
+
690
+ ##
691
+ # Configuration class for the SqlDatabasesService REST API.
692
+ #
693
+ # This class represents the configuration for SqlDatabasesService REST,
694
+ # providing control over timeouts, retry behavior, logging, transport
695
+ # parameters, and other low-level controls. Certain parameters can also be
696
+ # applied individually to specific RPCs. See
697
+ # {::Google::Cloud::Sql::V1beta4::SqlDatabasesService::Rest::Client::Configuration::Rpcs}
698
+ # for a list of RPCs that can be configured independently.
699
+ #
700
+ # Configuration can be applied globally to all clients, or to a single client
701
+ # on construction.
702
+ #
703
+ # @example
704
+ #
705
+ # # Modify the global config, setting the timeout for
706
+ # # delete to 20 seconds,
707
+ # # and all remaining timeouts to 10 seconds.
708
+ # ::Google::Cloud::Sql::V1beta4::SqlDatabasesService::Rest::Client.configure do |config|
709
+ # config.timeout = 10.0
710
+ # config.rpcs.delete.timeout = 20.0
711
+ # end
712
+ #
713
+ # # Apply the above configuration only to a new client.
714
+ # client = ::Google::Cloud::Sql::V1beta4::SqlDatabasesService::Rest::Client.new do |config|
715
+ # config.timeout = 10.0
716
+ # config.rpcs.delete.timeout = 20.0
717
+ # end
718
+ #
719
+ # @!attribute [rw] endpoint
720
+ # A custom service endpoint, as a hostname or hostname:port. The default is
721
+ # nil, indicating to use the default endpoint in the current universe domain.
722
+ # @return [::String,nil]
723
+ # @!attribute [rw] credentials
724
+ # Credentials to send with calls. You may provide any of the following types:
725
+ # * (`String`) The path to a service account key file in JSON format
726
+ # * (`Hash`) A service account key as a Hash
727
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
728
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
729
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
730
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
731
+ # * (`nil`) indicating no credentials
732
+ #
733
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
734
+ # external source for authentication to Google Cloud, you must validate it before
735
+ # providing it to a Google API client library. Providing an unvalidated credential
736
+ # configuration to Google APIs can compromise the security of your systems and data.
737
+ # For more information, refer to [Validate credential configurations from external
738
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
739
+ # @return [::Object]
740
+ # @!attribute [rw] scope
741
+ # The OAuth scopes
742
+ # @return [::Array<::String>]
743
+ # @!attribute [rw] lib_name
744
+ # The library name as recorded in instrumentation and logging
745
+ # @return [::String]
746
+ # @!attribute [rw] lib_version
747
+ # The library version as recorded in instrumentation and logging
748
+ # @return [::String]
749
+ # @!attribute [rw] timeout
750
+ # The call timeout in seconds.
751
+ # @return [::Numeric]
752
+ # @!attribute [rw] metadata
753
+ # Additional headers to be sent with the call.
754
+ # @return [::Hash{::Symbol=>::String}]
755
+ # @!attribute [rw] retry_policy
756
+ # The retry policy. The value is a hash with the following keys:
757
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
758
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
759
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
760
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
761
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
762
+ # trigger a retry.
763
+ # @return [::Hash]
764
+ # @!attribute [rw] quota_project
765
+ # A separate project against which to charge quota.
766
+ # @return [::String]
767
+ # @!attribute [rw] universe_domain
768
+ # The universe domain within which to make requests. This determines the
769
+ # default endpoint URL. The default value of nil uses the environment
770
+ # universe (usually the default "googleapis.com" universe).
771
+ # @return [::String,nil]
772
+ # @!attribute [rw] logger
773
+ # A custom logger to use for request/response debug logging, or the value
774
+ # `:default` (the default) to construct a default logger, or `nil` to
775
+ # explicitly disable logging.
776
+ # @return [::Logger,:default,nil]
777
+ #
778
+ class Configuration
779
+ extend ::Gapic::Config
780
+
781
+ # @private
782
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
783
+ DEFAULT_ENDPOINT = "sqladmin.googleapis.com"
784
+
785
+ config_attr :endpoint, nil, ::String, nil
786
+ config_attr :credentials, nil do |value|
787
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
788
+ allowed.any? { |klass| klass === value }
789
+ end
790
+ config_attr :scope, nil, ::String, ::Array, nil
791
+ config_attr :lib_name, nil, ::String, nil
792
+ config_attr :lib_version, nil, ::String, nil
793
+ config_attr :timeout, nil, ::Numeric, nil
794
+ config_attr :metadata, nil, ::Hash, nil
795
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
796
+ config_attr :quota_project, nil, ::String, nil
797
+ config_attr :universe_domain, nil, ::String, nil
798
+ config_attr :logger, :default, ::Logger, nil, :default
799
+
800
+ # @private
801
+ def initialize parent_config = nil
802
+ @parent_config = parent_config unless parent_config.nil?
803
+
804
+ yield self if block_given?
805
+ end
806
+
807
+ ##
808
+ # Configurations for individual RPCs
809
+ # @return [Rpcs]
810
+ #
811
+ def rpcs
812
+ @rpcs ||= begin
813
+ parent_rpcs = nil
814
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
815
+ Rpcs.new parent_rpcs
816
+ end
817
+ end
818
+
819
+ ##
820
+ # Configuration RPC class for the SqlDatabasesService API.
821
+ #
822
+ # Includes fields providing the configuration for each RPC in this service.
823
+ # Each configuration object is of type `Gapic::Config::Method` and includes
824
+ # the following configuration fields:
825
+ #
826
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
827
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
828
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
829
+ # include the following keys:
830
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
831
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
832
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
833
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
834
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
835
+ # trigger a retry.
836
+ #
837
+ class Rpcs
838
+ ##
839
+ # RPC-specific configuration for `delete`
840
+ # @return [::Gapic::Config::Method]
841
+ #
842
+ attr_reader :delete
843
+ ##
844
+ # RPC-specific configuration for `get`
845
+ # @return [::Gapic::Config::Method]
846
+ #
847
+ attr_reader :get
848
+ ##
849
+ # RPC-specific configuration for `insert`
850
+ # @return [::Gapic::Config::Method]
851
+ #
852
+ attr_reader :insert
853
+ ##
854
+ # RPC-specific configuration for `list`
855
+ # @return [::Gapic::Config::Method]
856
+ #
857
+ attr_reader :list
858
+ ##
859
+ # RPC-specific configuration for `patch`
860
+ # @return [::Gapic::Config::Method]
861
+ #
862
+ attr_reader :patch
863
+ ##
864
+ # RPC-specific configuration for `update`
865
+ # @return [::Gapic::Config::Method]
866
+ #
867
+ attr_reader :update
868
+
869
+ # @private
870
+ def initialize parent_rpcs = nil
871
+ delete_config = parent_rpcs.delete if parent_rpcs.respond_to? :delete
872
+ @delete = ::Gapic::Config::Method.new delete_config
873
+ get_config = parent_rpcs.get if parent_rpcs.respond_to? :get
874
+ @get = ::Gapic::Config::Method.new get_config
875
+ insert_config = parent_rpcs.insert if parent_rpcs.respond_to? :insert
876
+ @insert = ::Gapic::Config::Method.new insert_config
877
+ list_config = parent_rpcs.list if parent_rpcs.respond_to? :list
878
+ @list = ::Gapic::Config::Method.new list_config
879
+ patch_config = parent_rpcs.patch if parent_rpcs.respond_to? :patch
880
+ @patch = ::Gapic::Config::Method.new patch_config
881
+ update_config = parent_rpcs.update if parent_rpcs.respond_to? :update
882
+ @update = ::Gapic::Config::Method.new update_config
883
+
884
+ yield self if block_given?
885
+ end
886
+ end
887
+ end
888
+ end
889
+ end
890
+ end
891
+ end
892
+ end
893
+ end
894
+ end