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