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,520 @@
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_data_pb"
21
+ require "google/cloud/location"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Sql
26
+ module V1beta4
27
+ module SqlDataService
28
+ ##
29
+ # Client for the SqlDataService service.
30
+ #
31
+ # Service for streaming data to and from Cloud SQL instances.
32
+ #
33
+ class Client
34
+ # @private
35
+ API_VERSION = ""
36
+
37
+ # @private
38
+ DEFAULT_ENDPOINT_TEMPLATE = "sqladmin.$UNIVERSE_DOMAIN$"
39
+
40
+ include Paths
41
+
42
+ # @private
43
+ attr_reader :sql_data_service_stub
44
+
45
+ ##
46
+ # Configure the SqlDataService Client class.
47
+ #
48
+ # See {::Google::Cloud::Sql::V1beta4::SqlDataService::Client::Configuration}
49
+ # for a description of the configuration fields.
50
+ #
51
+ # @example
52
+ #
53
+ # # Modify the configuration for all SqlDataService clients
54
+ # ::Google::Cloud::Sql::V1beta4::SqlDataService::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", "V1beta4"]
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
75
+ end
76
+ yield @configure if block_given?
77
+ @configure
78
+ end
79
+
80
+ ##
81
+ # Configure the SqlDataService Client instance.
82
+ #
83
+ # The configuration is set to the derived mode, meaning that values can be changed,
84
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
85
+ # should be made on {Client.configure}.
86
+ #
87
+ # See {::Google::Cloud::Sql::V1beta4::SqlDataService::Client::Configuration}
88
+ # for a description of the configuration fields.
89
+ #
90
+ # @yield [config] Configure the Client client.
91
+ # @yieldparam config [Client::Configuration]
92
+ #
93
+ # @return [Client::Configuration]
94
+ #
95
+ def configure
96
+ yield @config if block_given?
97
+ @config
98
+ end
99
+
100
+ ##
101
+ # The effective universe domain
102
+ #
103
+ # @return [String]
104
+ #
105
+ def universe_domain
106
+ @sql_data_service_stub.universe_domain
107
+ end
108
+
109
+ ##
110
+ # Create a new SqlDataService client object.
111
+ #
112
+ # @example
113
+ #
114
+ # # Create a client using the default configuration
115
+ # client = ::Google::Cloud::Sql::V1beta4::SqlDataService::Client.new
116
+ #
117
+ # # Create a client using a custom configuration
118
+ # client = ::Google::Cloud::Sql::V1beta4::SqlDataService::Client.new do |config|
119
+ # config.timeout = 10.0
120
+ # end
121
+ #
122
+ # @yield [config] Configure the SqlDataService client.
123
+ # @yieldparam config [Client::Configuration]
124
+ #
125
+ def initialize
126
+ # These require statements are intentionally placed here to initialize
127
+ # the gRPC module only when it's required.
128
+ # See https://github.com/googleapis/toolkit/issues/446
129
+ require "gapic/grpc"
130
+ require "google/cloud/sql/v1beta4/cloud_sql_data_services_pb"
131
+
132
+ # Create the configuration object
133
+ @config = Configuration.new Client.configure
134
+
135
+ # Yield the configuration if needed
136
+ yield @config if block_given?
137
+
138
+ # Create credentials
139
+ credentials = @config.credentials
140
+ # Use self-signed JWT if the endpoint is unchanged from default,
141
+ # but only if the default endpoint does not have a region prefix.
142
+ enable_self_signed_jwt = @config.endpoint.nil? ||
143
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
144
+ !@config.endpoint.split(".").first.include?("-"))
145
+ credentials ||= Credentials.default scope: @config.scope,
146
+ enable_self_signed_jwt: enable_self_signed_jwt
147
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
148
+ credentials = Credentials.new credentials, scope: @config.scope
149
+ end
150
+ @quota_project_id = @config.quota_project
151
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
152
+
153
+ @sql_data_service_stub = ::Gapic::ServiceStub.new(
154
+ ::Google::Cloud::Sql::V1beta4::SqlDataService::Stub,
155
+ credentials: credentials,
156
+ endpoint: @config.endpoint,
157
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
158
+ universe_domain: @config.universe_domain,
159
+ channel_args: @config.channel_args,
160
+ interceptors: @config.interceptors,
161
+ channel_pool_config: @config.channel_pool,
162
+ logger: @config.logger
163
+ )
164
+
165
+ @sql_data_service_stub.stub_logger&.info do |entry|
166
+ entry.set_system_name
167
+ entry.set_service
168
+ entry.message = "Created client for #{entry.service}"
169
+ entry.set_credentials_fields credentials
170
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
171
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
172
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
173
+ end
174
+
175
+ @location_client = Google::Cloud::Location::Locations::Client.new do |config|
176
+ config.credentials = credentials
177
+ config.quota_project = @quota_project_id
178
+ config.endpoint = @sql_data_service_stub.endpoint
179
+ config.universe_domain = @sql_data_service_stub.universe_domain
180
+ config.logger = @sql_data_service_stub.logger if config.respond_to? :logger=
181
+ end
182
+ end
183
+
184
+ ##
185
+ # Get the associated client for mix-in of the Locations.
186
+ #
187
+ # @return [Google::Cloud::Location::Locations::Client]
188
+ #
189
+ attr_reader :location_client
190
+
191
+ ##
192
+ # The logger used for request/response debug logging.
193
+ #
194
+ # @return [Logger]
195
+ #
196
+ def logger
197
+ @sql_data_service_stub.logger
198
+ end
199
+
200
+ # Service calls
201
+
202
+ ##
203
+ # `StreamSqlData` establishes a bidirectional stream to a Cloud SQL instance,
204
+ # and then streams data to and from the instance.
205
+ #
206
+ # The first message from the client MUST be a `StreamSqlDataRequest` request
207
+ # with configuration settings, including required values for the
208
+ # `connection_settings` field. Subsequent messages from the client may
209
+ # contain the `payload` field.
210
+ #
211
+ # Messages from the server may contain the `payload` field.
212
+ #
213
+ # The `payload` fields of the request and response streams contain the raw
214
+ # data of the database's native wire protocol (e.g., PostgreSQL wire
215
+ # protocol). The database client is responsible for generating and parsing
216
+ # this data.
217
+ #
218
+ # Any errors on initial connection (e.g., connection failure, authorization
219
+ # issues, network problems) will result in the stream being terminated with
220
+ # an appropriate RPC status exception.
221
+ #
222
+ # After a successful connection is made, if an error occurs, then the server
223
+ # terminates connection and returns the appropriate RPC status exception.
224
+ #
225
+ # Add the request params headers to the request to ensure that
226
+ # the streaming request is routed to the correct service for your database.
227
+ #
228
+ # Use this format for the request params header:
229
+ #
230
+ # `x-goog-request-params`:
231
+ # location_id=\\{location_path}&instance_id=\\{instance_path}`
232
+ #
233
+ # `location_path` is `locations/{location_name}`
234
+ # `instance_path` is `projects/{project_name}/instances/{instance_name}`
235
+ #
236
+ # for example:
237
+ # `x-goog-request-params`:
238
+ # `location_id=locations/us-central1&instance_id=projects/myproject/instances/instancename`
239
+ #
240
+ # @param request [::Gapic::StreamInput, ::Enumerable<::Google::Cloud::Sql::V1beta4::StreamSqlDataRequest, ::Hash>]
241
+ # An enumerable of {::Google::Cloud::Sql::V1beta4::StreamSqlDataRequest} instances.
242
+ # @param options [::Gapic::CallOptions, ::Hash]
243
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
244
+ #
245
+ # @yield [response, operation] Access the result along with the RPC operation
246
+ # @yieldparam response [::Enumerable<::Google::Cloud::Sql::V1beta4::StreamSqlDataResponse>]
247
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
248
+ #
249
+ # @return [::Enumerable<::Google::Cloud::Sql::V1beta4::StreamSqlDataResponse>]
250
+ #
251
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
252
+ #
253
+ # @example Basic example
254
+ # require "google/cloud/sql/v1beta4"
255
+ #
256
+ # # Create a client object. The client can be reused for multiple calls.
257
+ # client = Google::Cloud::Sql::V1beta4::SqlDataService::Client.new
258
+ #
259
+ # # Create an input stream.
260
+ # input = Gapic::StreamInput.new
261
+ #
262
+ # # Call the stream_sql_data method to start streaming.
263
+ # output = client.stream_sql_data input
264
+ #
265
+ # # Send requests on the stream. For each request object, set fields by
266
+ # # passing keyword arguments. Be sure to close the stream when done.
267
+ # input << Google::Cloud::Sql::V1beta4::StreamSqlDataRequest.new
268
+ # input << Google::Cloud::Sql::V1beta4::StreamSqlDataRequest.new
269
+ # input.close
270
+ #
271
+ # # The returned object is a streamed enumerable yielding elements of type
272
+ # # ::Google::Cloud::Sql::V1beta4::StreamSqlDataResponse
273
+ # output.each do |current_response|
274
+ # p current_response
275
+ # end
276
+ #
277
+ def stream_sql_data request, options = nil
278
+ unless request.is_a? ::Enumerable
279
+ raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum
280
+ request = request.to_enum
281
+ end
282
+
283
+ request = request.lazy.map do |req|
284
+ ::Gapic::Protobuf.coerce req, to: ::Google::Cloud::Sql::V1beta4::StreamSqlDataRequest
285
+ end
286
+
287
+ # Converts hash and nil to an options object
288
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
289
+
290
+ # Customize the options with defaults
291
+ metadata = @config.rpcs.stream_sql_data.metadata.to_h
292
+
293
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
294
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
295
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
296
+ gapic_version: ::Google::Cloud::Sql::V1beta4::VERSION
297
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
298
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
299
+
300
+ options.apply_defaults timeout: @config.rpcs.stream_sql_data.timeout,
301
+ metadata: metadata,
302
+ retry_policy: @config.rpcs.stream_sql_data.retry_policy
303
+
304
+ options.apply_defaults timeout: @config.timeout,
305
+ metadata: @config.metadata,
306
+ retry_policy: @config.retry_policy
307
+
308
+ @sql_data_service_stub.call_rpc :stream_sql_data, request, options: options do |response, operation|
309
+ yield response, operation if block_given?
310
+ end
311
+ rescue ::GRPC::BadStatus => e
312
+ raise ::Google::Cloud::Error.from_error(e)
313
+ end
314
+
315
+ ##
316
+ # Configuration class for the SqlDataService API.
317
+ #
318
+ # This class represents the configuration for SqlDataService,
319
+ # providing control over timeouts, retry behavior, logging, transport
320
+ # parameters, and other low-level controls. Certain parameters can also be
321
+ # applied individually to specific RPCs. See
322
+ # {::Google::Cloud::Sql::V1beta4::SqlDataService::Client::Configuration::Rpcs}
323
+ # for a list of RPCs that can be configured independently.
324
+ #
325
+ # Configuration can be applied globally to all clients, or to a single client
326
+ # on construction.
327
+ #
328
+ # @example
329
+ #
330
+ # # Modify the global config, setting the timeout for
331
+ # # stream_sql_data to 20 seconds,
332
+ # # and all remaining timeouts to 10 seconds.
333
+ # ::Google::Cloud::Sql::V1beta4::SqlDataService::Client.configure do |config|
334
+ # config.timeout = 10.0
335
+ # config.rpcs.stream_sql_data.timeout = 20.0
336
+ # end
337
+ #
338
+ # # Apply the above configuration only to a new client.
339
+ # client = ::Google::Cloud::Sql::V1beta4::SqlDataService::Client.new do |config|
340
+ # config.timeout = 10.0
341
+ # config.rpcs.stream_sql_data.timeout = 20.0
342
+ # end
343
+ #
344
+ # @!attribute [rw] endpoint
345
+ # A custom service endpoint, as a hostname or hostname:port. The default is
346
+ # nil, indicating to use the default endpoint in the current universe domain.
347
+ # @return [::String,nil]
348
+ # @!attribute [rw] credentials
349
+ # Credentials to send with calls. You may provide any of the following types:
350
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
351
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
352
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
353
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
354
+ # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
355
+ # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
356
+ # * (`nil`) indicating no credentials
357
+ #
358
+ # @note Warning: Passing a `String` to a keyfile path or a `Hash` of credentials
359
+ # is deprecated. Providing an unvalidated credential configuration to
360
+ # Google APIs can compromise the security of your systems and data.
361
+ #
362
+ # @example
363
+ #
364
+ # # The recommended way to provide credentials is to use the `make_creds` method
365
+ # # on the appropriate credentials class for your environment.
366
+ #
367
+ # require "googleauth"
368
+ #
369
+ # credentials = ::Google::Auth::ServiceAccountCredentials.make_creds(
370
+ # json_key_io: ::File.open("/path/to/keyfile.json")
371
+ # )
372
+ #
373
+ # client = ::Google::Cloud::Sql::V1beta4::SqlDataService::Client.new do |config|
374
+ # config.credentials = credentials
375
+ # end
376
+ #
377
+ # @note Warning: If you accept a credential configuration (JSON file or Hash) from an
378
+ # external source for authentication to Google Cloud, you must validate it before
379
+ # providing it to a Google API client library. Providing an unvalidated credential
380
+ # configuration to Google APIs can compromise the security of your systems and data.
381
+ # For more information, refer to [Validate credential configurations from external
382
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
383
+ # @return [::Object]
384
+ # @!attribute [rw] scope
385
+ # The OAuth scopes
386
+ # @return [::Array<::String>]
387
+ # @!attribute [rw] lib_name
388
+ # The library name as recorded in instrumentation and logging
389
+ # @return [::String]
390
+ # @!attribute [rw] lib_version
391
+ # The library version as recorded in instrumentation and logging
392
+ # @return [::String]
393
+ # @!attribute [rw] channel_args
394
+ # Extra parameters passed to the gRPC channel. Note: this is ignored if a
395
+ # `GRPC::Core::Channel` object is provided as the credential.
396
+ # @return [::Hash]
397
+ # @!attribute [rw] interceptors
398
+ # An array of interceptors that are run before calls are executed.
399
+ # @return [::Array<::GRPC::ClientInterceptor>]
400
+ # @!attribute [rw] timeout
401
+ # The call timeout in seconds.
402
+ # @return [::Numeric]
403
+ # @!attribute [rw] metadata
404
+ # Additional gRPC headers to be sent with the call.
405
+ # @return [::Hash{::Symbol=>::String}]
406
+ # @!attribute [rw] retry_policy
407
+ # The retry policy. The value is a hash with the following keys:
408
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
409
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
410
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
411
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
412
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
413
+ # trigger a retry.
414
+ # @return [::Hash]
415
+ # @!attribute [rw] quota_project
416
+ # A separate project against which to charge quota.
417
+ # @return [::String]
418
+ # @!attribute [rw] universe_domain
419
+ # The universe domain within which to make requests. This determines the
420
+ # default endpoint URL. The default value of nil uses the environment
421
+ # universe (usually the default "googleapis.com" universe).
422
+ # @return [::String,nil]
423
+ # @!attribute [rw] logger
424
+ # A custom logger to use for request/response debug logging, or the value
425
+ # `:default` (the default) to construct a default logger, or `nil` to
426
+ # explicitly disable logging.
427
+ # @return [::Logger,:default,nil]
428
+ #
429
+ class Configuration
430
+ extend ::Gapic::Config
431
+
432
+ # @private
433
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
434
+ DEFAULT_ENDPOINT = "sqladmin.googleapis.com"
435
+
436
+ config_attr :endpoint, nil, ::String, nil
437
+ config_attr :credentials, nil do |value|
438
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
439
+ allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC::Core::Channel
440
+ allowed.any? { |klass| klass === value }
441
+ end
442
+ config_attr :scope, nil, ::String, ::Array, nil
443
+ config_attr :lib_name, nil, ::String, nil
444
+ config_attr :lib_version, nil, ::String, nil
445
+ config_attr(:channel_args, { "grpc.service_config_disable_resolution" => 1 }, ::Hash, nil)
446
+ config_attr :interceptors, nil, ::Array, nil
447
+ config_attr :timeout, nil, ::Numeric, nil
448
+ config_attr :metadata, nil, ::Hash, nil
449
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
450
+ config_attr :quota_project, nil, ::String, nil
451
+ config_attr :universe_domain, nil, ::String, nil
452
+ config_attr :logger, :default, ::Logger, nil, :default
453
+
454
+ # @private
455
+ def initialize parent_config = nil
456
+ @parent_config = parent_config unless parent_config.nil?
457
+
458
+ yield self if block_given?
459
+ end
460
+
461
+ ##
462
+ # Configurations for individual RPCs
463
+ # @return [Rpcs]
464
+ #
465
+ def rpcs
466
+ @rpcs ||= begin
467
+ parent_rpcs = nil
468
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
469
+ Rpcs.new parent_rpcs
470
+ end
471
+ end
472
+
473
+ ##
474
+ # Configuration for the channel pool
475
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
476
+ #
477
+ def channel_pool
478
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
479
+ end
480
+
481
+ ##
482
+ # Configuration RPC class for the SqlDataService API.
483
+ #
484
+ # Includes fields providing the configuration for each RPC in this service.
485
+ # Each configuration object is of type `Gapic::Config::Method` and includes
486
+ # the following configuration fields:
487
+ #
488
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
489
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional gRPC headers
490
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
491
+ # include the following keys:
492
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
493
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
494
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
495
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
496
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
497
+ # trigger a retry.
498
+ #
499
+ class Rpcs
500
+ ##
501
+ # RPC-specific configuration for `stream_sql_data`
502
+ # @return [::Gapic::Config::Method]
503
+ #
504
+ attr_reader :stream_sql_data
505
+
506
+ # @private
507
+ def initialize parent_rpcs = nil
508
+ stream_sql_data_config = parent_rpcs.stream_sql_data if parent_rpcs.respond_to? :stream_sql_data
509
+ @stream_sql_data = ::Gapic::Config::Method.new stream_sql_data_config
510
+
511
+ yield self if block_given?
512
+ end
513
+ end
514
+ end
515
+ end
516
+ end
517
+ end
518
+ end
519
+ end
520
+ end
@@ -0,0 +1,48 @@
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 "googleauth"
20
+
21
+ module Google
22
+ module Cloud
23
+ module Sql
24
+ module V1beta4
25
+ module SqlDataService
26
+ # Credentials for the SqlDataService API.
27
+ class Credentials < ::Google::Auth::Credentials
28
+ self.scope = [
29
+ "https://www.googleapis.com/auth/cloud-platform",
30
+ "https://www.googleapis.com/auth/sqlservice.admin"
31
+ ]
32
+ self.env_vars = [
33
+ "GOOGLE_CLOUD_CREDENTIALS",
34
+ "GOOGLE_CLOUD_KEYFILE",
35
+ "GCLOUD_KEYFILE",
36
+ "GOOGLE_CLOUD_CREDENTIALS_JSON",
37
+ "GOOGLE_CLOUD_KEYFILE_JSON",
38
+ "GCLOUD_KEYFILE_JSON"
39
+ ]
40
+ self.paths = [
41
+ "~/.config/google_cloud/application_default_credentials.json"
42
+ ]
43
+ end
44
+ end
45
+ end
46
+ end
47
+ end
48
+ end
@@ -0,0 +1,50 @@
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
+
20
+ module Google
21
+ module Cloud
22
+ module Sql
23
+ module V1beta4
24
+ module SqlDataService
25
+ # Path helper methods for the SqlDataService API.
26
+ module Paths
27
+ ##
28
+ # Create a fully-qualified Instance resource string.
29
+ #
30
+ # The resource will be in the following format:
31
+ #
32
+ # `projects/{project}/instances/{instance}`
33
+ #
34
+ # @param project [String]
35
+ # @param instance [String]
36
+ #
37
+ # @return [::String]
38
+ def instance_path project:, instance:
39
+ raise ::ArgumentError, "project cannot contain /" if project.to_s.include? "/"
40
+
41
+ "projects/#{project}/instances/#{instance}"
42
+ end
43
+
44
+ extend self
45
+ end
46
+ end
47
+ end
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,49 @@
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 "gapic/common"
20
+ require "gapic/config"
21
+ require "gapic/config/method"
22
+
23
+ require "google/cloud/sql/v1beta4/version"
24
+
25
+ require "google/cloud/sql/v1beta4/sql_data_service/credentials"
26
+ require "google/cloud/sql/v1beta4/sql_data_service/paths"
27
+ require "google/cloud/sql/v1beta4/sql_data_service/client"
28
+
29
+ module Google
30
+ module Cloud
31
+ module Sql
32
+ module V1beta4
33
+ ##
34
+ # Service for streaming data to and from Cloud SQL instances.
35
+ #
36
+ # @example Load this service and instantiate a gRPC client
37
+ #
38
+ # require "google/cloud/sql/v1beta4/sql_data_service"
39
+ # client = ::Google::Cloud::Sql::V1beta4::SqlDataService::Client.new
40
+ #
41
+ module SqlDataService
42
+ end
43
+ end
44
+ end
45
+ end
46
+ end
47
+
48
+ helper_path = ::File.join __dir__, "sql_data_service", "helpers.rb"
49
+ require "google/cloud/sql/v1beta4/sql_data_service/helpers" if ::File.file? helper_path