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