google-cloud-bigtable-v2 1.15.1 → 1.17.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 (35) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -2
  3. data/lib/google/bigtable/v2/bigtable_services_pb.rb +1 -1
  4. data/lib/google/bigtable/v2/data_pb.rb +2 -1
  5. data/lib/google/bigtable/v2/feature_flags_pb.rb +3 -1
  6. data/lib/google/cloud/bigtable/v2/bigtable/client.rb +1 -1
  7. data/lib/google/cloud/bigtable/v2/bigtable/credentials.rb +1 -1
  8. data/lib/google/cloud/bigtable/v2/bigtable/paths.rb +1 -1
  9. data/lib/google/cloud/bigtable/v2/bigtable/rest/client.rb +1645 -0
  10. data/lib/google/cloud/bigtable/v2/bigtable/rest/service_stub.rb +788 -0
  11. data/lib/google/cloud/bigtable/v2/bigtable/rest.rb +52 -0
  12. data/lib/google/cloud/bigtable/v2/bigtable.rb +7 -1
  13. data/lib/google/cloud/bigtable/v2/rest.rb +37 -0
  14. data/lib/google/cloud/bigtable/v2/version.rb +1 -1
  15. data/lib/google/cloud/bigtable/v2.rb +6 -1
  16. data/lib/google-cloud-bigtable-v2.rb +1 -1
  17. data/proto_docs/google/api/client.rb +1 -1
  18. data/proto_docs/google/api/field_behavior.rb +1 -1
  19. data/proto_docs/google/api/launch_stage.rb +1 -1
  20. data/proto_docs/google/api/resource.rb +1 -1
  21. data/proto_docs/google/api/routing.rb +1 -1
  22. data/proto_docs/google/bigtable/v2/bigtable.rb +1 -1
  23. data/proto_docs/google/bigtable/v2/data.rb +24 -1
  24. data/proto_docs/google/bigtable/v2/feature_flags.rb +5 -1
  25. data/proto_docs/google/bigtable/v2/peer_info.rb +1 -1
  26. data/proto_docs/google/bigtable/v2/request_stats.rb +1 -1
  27. data/proto_docs/google/bigtable/v2/response_params.rb +1 -1
  28. data/proto_docs/google/bigtable/v2/types.rb +1 -1
  29. data/proto_docs/google/protobuf/any.rb +1 -1
  30. data/proto_docs/google/protobuf/duration.rb +1 -1
  31. data/proto_docs/google/protobuf/timestamp.rb +8 -7
  32. data/proto_docs/google/protobuf/wrappers.rb +1 -1
  33. data/proto_docs/google/rpc/status.rb +1 -1
  34. data/proto_docs/google/type/date.rb +1 -1
  35. metadata +9 -5
@@ -0,0 +1,1645 @@
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/bigtable/v2/bigtable_pb"
21
+ require "google/cloud/bigtable/v2/bigtable/rest/service_stub"
22
+
23
+ module Google
24
+ module Cloud
25
+ module Bigtable
26
+ module V2
27
+ module Bigtable
28
+ module Rest
29
+ ##
30
+ # REST client for the Bigtable service.
31
+ #
32
+ # Service for reading from and writing to existing Bigtable tables.
33
+ #
34
+ class Client
35
+ # @private
36
+ API_VERSION = ""
37
+
38
+ # @private
39
+ DEFAULT_ENDPOINT_TEMPLATE = "bigtable.$UNIVERSE_DOMAIN$"
40
+
41
+ include Paths
42
+
43
+ # @private
44
+ attr_reader :bigtable_stub
45
+
46
+ ##
47
+ # Configure the Bigtable Client class.
48
+ #
49
+ # See {::Google::Cloud::Bigtable::V2::Bigtable::Rest::Client::Configuration}
50
+ # for a description of the configuration fields.
51
+ #
52
+ # @example
53
+ #
54
+ # # Modify the configuration for all Bigtable clients
55
+ # ::Google::Cloud::Bigtable::V2::Bigtable::Rest::Client.configure do |config|
56
+ # config.timeout = 10.0
57
+ # end
58
+ #
59
+ # @yield [config] Configure the Client client.
60
+ # @yieldparam config [Client::Configuration]
61
+ #
62
+ # @return [Client::Configuration]
63
+ #
64
+ def self.configure
65
+ @configure ||= begin
66
+ namespace = ["Google", "Cloud", "Bigtable", "V2"]
67
+ parent_config = while namespace.any?
68
+ parent_name = namespace.join "::"
69
+ parent_const = const_get parent_name
70
+ break parent_const.configure if parent_const.respond_to? :configure
71
+ namespace.pop
72
+ end
73
+ default_config = Client::Configuration.new parent_config
74
+
75
+ default_config.rpcs.read_rows.timeout = 43_200.0
76
+
77
+ default_config.rpcs.sample_row_keys.timeout = 60.0
78
+
79
+ default_config.rpcs.mutate_row.timeout = 60.0
80
+ default_config.rpcs.mutate_row.retry_policy = {
81
+ initial_delay: 0.01, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
82
+ }
83
+
84
+ default_config.rpcs.mutate_rows.timeout = 600.0
85
+
86
+ default_config.rpcs.check_and_mutate_row.timeout = 20.0
87
+
88
+ default_config.rpcs.read_modify_write_row.timeout = 20.0
89
+
90
+ default_config.rpcs.generate_initial_change_stream_partitions.timeout = 60.0
91
+
92
+ default_config.rpcs.read_change_stream.timeout = 43_200.0
93
+
94
+ default_config.rpcs.execute_query.timeout = 43_200.0
95
+ default_config.rpcs.execute_query.retry_policy = {
96
+ initial_delay: 0.01, max_delay: 60.0, multiplier: 2, retry_codes: [14, 4]
97
+ }
98
+
99
+ default_config
100
+ end
101
+ yield @configure if block_given?
102
+ @configure
103
+ end
104
+
105
+ ##
106
+ # Configure the Bigtable Client instance.
107
+ #
108
+ # The configuration is set to the derived mode, meaning that values can be changed,
109
+ # but structural changes (adding new fields, etc.) are not allowed. Structural changes
110
+ # should be made on {Client.configure}.
111
+ #
112
+ # See {::Google::Cloud::Bigtable::V2::Bigtable::Rest::Client::Configuration}
113
+ # for a description of the configuration fields.
114
+ #
115
+ # @yield [config] Configure the Client client.
116
+ # @yieldparam config [Client::Configuration]
117
+ #
118
+ # @return [Client::Configuration]
119
+ #
120
+ def configure
121
+ yield @config if block_given?
122
+ @config
123
+ end
124
+
125
+ ##
126
+ # The effective universe domain
127
+ #
128
+ # @return [String]
129
+ #
130
+ def universe_domain
131
+ @bigtable_stub.universe_domain
132
+ end
133
+
134
+ ##
135
+ # Create a new Bigtable REST client object.
136
+ #
137
+ # @example
138
+ #
139
+ # # Create a client using the default configuration
140
+ # client = ::Google::Cloud::Bigtable::V2::Bigtable::Rest::Client.new
141
+ #
142
+ # # Create a client using a custom configuration
143
+ # client = ::Google::Cloud::Bigtable::V2::Bigtable::Rest::Client.new do |config|
144
+ # config.timeout = 10.0
145
+ # end
146
+ #
147
+ # @yield [config] Configure the Bigtable client.
148
+ # @yieldparam config [Client::Configuration]
149
+ #
150
+ def initialize
151
+ # Create the configuration object
152
+ @config = Configuration.new Client.configure
153
+
154
+ # Yield the configuration if needed
155
+ yield @config if block_given?
156
+
157
+ # Create credentials
158
+ credentials = @config.credentials
159
+ # Use self-signed JWT if the endpoint is unchanged from default,
160
+ # but only if the default endpoint does not have a region prefix.
161
+ enable_self_signed_jwt = @config.endpoint.nil? ||
162
+ (@config.endpoint == Configuration::DEFAULT_ENDPOINT &&
163
+ !@config.endpoint.split(".").first.include?("-"))
164
+ credentials ||= Credentials.default scope: @config.scope,
165
+ enable_self_signed_jwt: enable_self_signed_jwt
166
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
167
+ credentials = Credentials.new credentials, scope: @config.scope
168
+ end
169
+
170
+ @quota_project_id = @config.quota_project
171
+ @quota_project_id ||= credentials.quota_project_id if credentials.respond_to? :quota_project_id
172
+
173
+ @bigtable_stub = ::Google::Cloud::Bigtable::V2::Bigtable::Rest::ServiceStub.new(
174
+ endpoint: @config.endpoint,
175
+ endpoint_template: DEFAULT_ENDPOINT_TEMPLATE,
176
+ universe_domain: @config.universe_domain,
177
+ credentials: credentials,
178
+ logger: @config.logger
179
+ )
180
+
181
+ @bigtable_stub.logger(stub: true)&.info do |entry|
182
+ entry.set_system_name
183
+ entry.set_service
184
+ entry.message = "Created client for #{entry.service}"
185
+ entry.set_credentials_fields credentials
186
+ entry.set "customEndpoint", @config.endpoint if @config.endpoint
187
+ entry.set "defaultTimeout", @config.timeout if @config.timeout
188
+ entry.set "quotaProject", @quota_project_id if @quota_project_id
189
+ end
190
+ end
191
+
192
+ ##
193
+ # The logger used for request/response debug logging.
194
+ #
195
+ # @return [Logger]
196
+ #
197
+ def logger
198
+ @bigtable_stub.logger
199
+ end
200
+
201
+ # Service calls
202
+
203
+ ##
204
+ # Streams back the contents of all requested rows in key order, optionally
205
+ # applying the same Reader filter to each. Depending on their size,
206
+ # rows and cells may be broken up across multiple responses, but
207
+ # atomicity of each row will still be preserved. See the
208
+ # ReadRowsResponse documentation for details.
209
+ #
210
+ # @overload read_rows(request, options = nil)
211
+ # Pass arguments to `read_rows` via a request object, either of type
212
+ # {::Google::Cloud::Bigtable::V2::ReadRowsRequest} or an equivalent Hash.
213
+ #
214
+ # @param request [::Google::Cloud::Bigtable::V2::ReadRowsRequest, ::Hash]
215
+ # A request object representing the call parameters. Required. To specify no
216
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
217
+ # @param options [::Gapic::CallOptions, ::Hash]
218
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
219
+ #
220
+ # @overload read_rows(table_name: nil, authorized_view_name: nil, materialized_view_name: nil, app_profile_id: nil, rows: nil, filter: nil, rows_limit: nil, request_stats_view: nil, reversed: nil)
221
+ # Pass arguments to `read_rows` via keyword arguments. Note that at
222
+ # least one keyword argument is required. To specify no parameters, or to keep all
223
+ # the default parameter values, pass an empty Hash as a request object (see above).
224
+ #
225
+ # @param table_name [::String]
226
+ # Optional. The unique name of the table from which to read.
227
+ #
228
+ # Values are of the form
229
+ # `projects/<project>/instances/<instance>/tables/<table>`.
230
+ # @param authorized_view_name [::String]
231
+ # Optional. The unique name of the AuthorizedView from which to read.
232
+ #
233
+ # Values are of the form
234
+ # `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
235
+ # @param materialized_view_name [::String]
236
+ # Optional. The unique name of the MaterializedView from which to read.
237
+ #
238
+ # Values are of the form
239
+ # `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
240
+ # @param app_profile_id [::String]
241
+ # This value specifies routing for replication. If not specified, the
242
+ # "default" application profile will be used.
243
+ # @param rows [::Google::Cloud::Bigtable::V2::RowSet, ::Hash]
244
+ # The row keys and/or ranges to read sequentially. If not specified, reads
245
+ # from all rows.
246
+ # @param filter [::Google::Cloud::Bigtable::V2::RowFilter, ::Hash]
247
+ # The filter to apply to the contents of the specified row(s). If unset,
248
+ # reads the entirety of each row.
249
+ # @param rows_limit [::Integer]
250
+ # The read will stop after committing to N rows' worth of results. The
251
+ # default (zero) is to return all results.
252
+ # @param request_stats_view [::Google::Cloud::Bigtable::V2::ReadRowsRequest::RequestStatsView]
253
+ # The view into RequestStats, as described above.
254
+ # @param reversed [::Boolean]
255
+ # Experimental API - Please note that this API is currently experimental
256
+ # and can change in the future.
257
+ #
258
+ # Return rows in lexiographical descending order of the row keys. The row
259
+ # contents will not be affected by this flag.
260
+ #
261
+ # Example result set:
262
+ #
263
+ # [
264
+ # {key: "k2", "f:col1": "v1", "f:col2": "v1"},
265
+ # {key: "k1", "f:col1": "v2", "f:col2": "v2"}
266
+ # ]
267
+ # @return [::Enumerable<::Google::Cloud::Bigtable::V2::ReadRowsResponse>]
268
+ #
269
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
270
+ #
271
+ # @example Basic example
272
+ # require "google/cloud/bigtable/v2"
273
+ #
274
+ # # Create a client object. The client can be reused for multiple calls.
275
+ # client = Google::Cloud::Bigtable::V2::Bigtable::Rest::Client.new
276
+ #
277
+ # # Create a request. To set request fields, pass in keyword arguments.
278
+ # request = Google::Cloud::Bigtable::V2::ReadRowsRequest.new
279
+ #
280
+ # # Call the read_rows method to start streaming.
281
+ # output = client.read_rows request
282
+ #
283
+ # # The returned object is a streamed enumerable yielding elements of type
284
+ # # ::Google::Cloud::Bigtable::V2::ReadRowsResponse
285
+ # output.each do |current_response|
286
+ # p current_response
287
+ # end
288
+ #
289
+ def read_rows request, options = nil
290
+ raise ::ArgumentError, "request must be provided" if request.nil?
291
+
292
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::V2::ReadRowsRequest
293
+
294
+ # Converts hash and nil to an options object
295
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
296
+
297
+ # Customize the options with defaults
298
+ call_metadata = @config.rpcs.read_rows.metadata.to_h
299
+
300
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
301
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
302
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
303
+ gapic_version: ::Google::Cloud::Bigtable::V2::VERSION,
304
+ transports_version_send: [:rest]
305
+
306
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
307
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
308
+
309
+ options.apply_defaults timeout: @config.rpcs.read_rows.timeout,
310
+ metadata: call_metadata,
311
+ retry_policy: @config.rpcs.read_rows.retry_policy
312
+
313
+ options.apply_defaults timeout: @config.timeout,
314
+ metadata: @config.metadata,
315
+ retry_policy: @config.retry_policy
316
+
317
+ ::Gapic::Rest::ServerStream.new(
318
+ ::Google::Cloud::Bigtable::V2::ReadRowsResponse,
319
+ ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q|
320
+ @bigtable_stub.read_rows request, options do |chunk|
321
+ in_q.deq
322
+ out_q.enq chunk
323
+ end
324
+ end
325
+ )
326
+ rescue ::Gapic::Rest::Error => e
327
+ raise ::Google::Cloud::Error.from_error(e)
328
+ end
329
+
330
+ ##
331
+ # Returns a sample of row keys in the table. The returned row keys will
332
+ # delimit contiguous sections of the table of approximately equal size,
333
+ # which can be used to break up the data for distributed tasks like
334
+ # mapreduces.
335
+ #
336
+ # If a `row_range` is provided in the request, the returned samples will be
337
+ # restricted to the specified range.
338
+ #
339
+ # @overload sample_row_keys(request, options = nil)
340
+ # Pass arguments to `sample_row_keys` via a request object, either of type
341
+ # {::Google::Cloud::Bigtable::V2::SampleRowKeysRequest} or an equivalent Hash.
342
+ #
343
+ # @param request [::Google::Cloud::Bigtable::V2::SampleRowKeysRequest, ::Hash]
344
+ # A request object representing the call parameters. Required. To specify no
345
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
346
+ # @param options [::Gapic::CallOptions, ::Hash]
347
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
348
+ #
349
+ # @overload sample_row_keys(table_name: nil, authorized_view_name: nil, materialized_view_name: nil, app_profile_id: nil, row_range: nil)
350
+ # Pass arguments to `sample_row_keys` via keyword arguments. Note that at
351
+ # least one keyword argument is required. To specify no parameters, or to keep all
352
+ # the default parameter values, pass an empty Hash as a request object (see above).
353
+ #
354
+ # @param table_name [::String]
355
+ # Optional. The unique name of the table from which to sample row keys.
356
+ #
357
+ # Values are of the form
358
+ # `projects/<project>/instances/<instance>/tables/<table>`.
359
+ # @param authorized_view_name [::String]
360
+ # Optional. The unique name of the AuthorizedView from which to sample row
361
+ # keys.
362
+ #
363
+ # Values are of the form
364
+ # `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
365
+ # @param materialized_view_name [::String]
366
+ # Optional. The unique name of the MaterializedView from which to read.
367
+ #
368
+ # Values are of the form
369
+ # `projects/<project>/instances/<instance>/materializedViews/<materialized_view>`.
370
+ # @param app_profile_id [::String]
371
+ # This value specifies routing for replication. If not specified, the
372
+ # "default" application profile will be used.
373
+ # @param row_range [::Google::Cloud::Bigtable::V2::RowRange, ::Hash]
374
+ # Optional. The row range to sample. If not specified, samples
375
+ # from all rows.
376
+ # The output will always return the end key in the range as the last sample
377
+ # returned.
378
+ # @return [::Enumerable<::Google::Cloud::Bigtable::V2::SampleRowKeysResponse>]
379
+ #
380
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
381
+ #
382
+ # @example Basic example
383
+ # require "google/cloud/bigtable/v2"
384
+ #
385
+ # # Create a client object. The client can be reused for multiple calls.
386
+ # client = Google::Cloud::Bigtable::V2::Bigtable::Rest::Client.new
387
+ #
388
+ # # Create a request. To set request fields, pass in keyword arguments.
389
+ # request = Google::Cloud::Bigtable::V2::SampleRowKeysRequest.new
390
+ #
391
+ # # Call the sample_row_keys method to start streaming.
392
+ # output = client.sample_row_keys request
393
+ #
394
+ # # The returned object is a streamed enumerable yielding elements of type
395
+ # # ::Google::Cloud::Bigtable::V2::SampleRowKeysResponse
396
+ # output.each do |current_response|
397
+ # p current_response
398
+ # end
399
+ #
400
+ def sample_row_keys request, options = nil
401
+ raise ::ArgumentError, "request must be provided" if request.nil?
402
+
403
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::V2::SampleRowKeysRequest
404
+
405
+ # Converts hash and nil to an options object
406
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
407
+
408
+ # Customize the options with defaults
409
+ call_metadata = @config.rpcs.sample_row_keys.metadata.to_h
410
+
411
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
412
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
413
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
414
+ gapic_version: ::Google::Cloud::Bigtable::V2::VERSION,
415
+ transports_version_send: [:rest]
416
+
417
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
418
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
419
+
420
+ options.apply_defaults timeout: @config.rpcs.sample_row_keys.timeout,
421
+ metadata: call_metadata,
422
+ retry_policy: @config.rpcs.sample_row_keys.retry_policy
423
+
424
+ options.apply_defaults timeout: @config.timeout,
425
+ metadata: @config.metadata,
426
+ retry_policy: @config.retry_policy
427
+
428
+ ::Gapic::Rest::ServerStream.new(
429
+ ::Google::Cloud::Bigtable::V2::SampleRowKeysResponse,
430
+ ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q|
431
+ @bigtable_stub.sample_row_keys request, options do |chunk|
432
+ in_q.deq
433
+ out_q.enq chunk
434
+ end
435
+ end
436
+ )
437
+ rescue ::Gapic::Rest::Error => e
438
+ raise ::Google::Cloud::Error.from_error(e)
439
+ end
440
+
441
+ ##
442
+ # Mutates a row atomically. Cells already present in the row are left
443
+ # unchanged unless explicitly changed by `mutation`.
444
+ #
445
+ # @overload mutate_row(request, options = nil)
446
+ # Pass arguments to `mutate_row` via a request object, either of type
447
+ # {::Google::Cloud::Bigtable::V2::MutateRowRequest} or an equivalent Hash.
448
+ #
449
+ # @param request [::Google::Cloud::Bigtable::V2::MutateRowRequest, ::Hash]
450
+ # A request object representing the call parameters. Required. To specify no
451
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
452
+ # @param options [::Gapic::CallOptions, ::Hash]
453
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
454
+ #
455
+ # @overload mutate_row(table_name: nil, authorized_view_name: nil, app_profile_id: nil, row_key: nil, mutations: nil, idempotency: nil)
456
+ # Pass arguments to `mutate_row` via keyword arguments. Note that at
457
+ # least one keyword argument is required. To specify no parameters, or to keep all
458
+ # the default parameter values, pass an empty Hash as a request object (see above).
459
+ #
460
+ # @param table_name [::String]
461
+ # Optional. The unique name of the table to which the mutation should be
462
+ # applied.
463
+ #
464
+ # Values are of the form
465
+ # `projects/<project>/instances/<instance>/tables/<table>`.
466
+ # @param authorized_view_name [::String]
467
+ # Optional. The unique name of the AuthorizedView to which the mutation
468
+ # should be applied.
469
+ #
470
+ # Values are of the form
471
+ # `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
472
+ # @param app_profile_id [::String]
473
+ # This value specifies routing for replication. If not specified, the
474
+ # "default" application profile will be used.
475
+ # @param row_key [::String]
476
+ # Required. The key of the row to which the mutation should be applied.
477
+ # @param mutations [::Array<::Google::Cloud::Bigtable::V2::Mutation, ::Hash>]
478
+ # Required. Changes to be atomically applied to the specified row. Entries
479
+ # are applied in order, meaning that earlier mutations can be masked by later
480
+ # ones. Must contain at least one entry and at most 100000.
481
+ # @param idempotency [::Google::Cloud::Bigtable::V2::Idempotency, ::Hash]
482
+ # If set consistently across retries, prevents this mutation from being
483
+ # double applied to aggregate column families within a 15m window.
484
+ # @yield [result, operation] Access the result along with the TransportOperation object
485
+ # @yieldparam result [::Google::Cloud::Bigtable::V2::MutateRowResponse]
486
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
487
+ #
488
+ # @return [::Google::Cloud::Bigtable::V2::MutateRowResponse]
489
+ #
490
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
491
+ #
492
+ # @example Basic example
493
+ # require "google/cloud/bigtable/v2"
494
+ #
495
+ # # Create a client object. The client can be reused for multiple calls.
496
+ # client = Google::Cloud::Bigtable::V2::Bigtable::Rest::Client.new
497
+ #
498
+ # # Create a request. To set request fields, pass in keyword arguments.
499
+ # request = Google::Cloud::Bigtable::V2::MutateRowRequest.new
500
+ #
501
+ # # Call the mutate_row method.
502
+ # result = client.mutate_row request
503
+ #
504
+ # # The returned object is of type Google::Cloud::Bigtable::V2::MutateRowResponse.
505
+ # p result
506
+ #
507
+ def mutate_row request, options = nil
508
+ raise ::ArgumentError, "request must be provided" if request.nil?
509
+
510
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::V2::MutateRowRequest
511
+
512
+ # Converts hash and nil to an options object
513
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
514
+
515
+ # Customize the options with defaults
516
+ call_metadata = @config.rpcs.mutate_row.metadata.to_h
517
+
518
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
519
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
520
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
521
+ gapic_version: ::Google::Cloud::Bigtable::V2::VERSION,
522
+ transports_version_send: [:rest]
523
+
524
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
525
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
526
+
527
+ options.apply_defaults timeout: @config.rpcs.mutate_row.timeout,
528
+ metadata: call_metadata,
529
+ retry_policy: @config.rpcs.mutate_row.retry_policy
530
+
531
+ options.apply_defaults timeout: @config.timeout,
532
+ metadata: @config.metadata,
533
+ retry_policy: @config.retry_policy
534
+
535
+ @bigtable_stub.mutate_row request, options do |result, operation|
536
+ yield result, operation if block_given?
537
+ end
538
+ rescue ::Gapic::Rest::Error => e
539
+ raise ::Google::Cloud::Error.from_error(e)
540
+ end
541
+
542
+ ##
543
+ # Mutates multiple rows in a batch. Each individual row is mutated
544
+ # atomically as in MutateRow, but the entire batch is not executed
545
+ # atomically.
546
+ #
547
+ # @overload mutate_rows(request, options = nil)
548
+ # Pass arguments to `mutate_rows` via a request object, either of type
549
+ # {::Google::Cloud::Bigtable::V2::MutateRowsRequest} or an equivalent Hash.
550
+ #
551
+ # @param request [::Google::Cloud::Bigtable::V2::MutateRowsRequest, ::Hash]
552
+ # A request object representing the call parameters. Required. To specify no
553
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
554
+ # @param options [::Gapic::CallOptions, ::Hash]
555
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
556
+ #
557
+ # @overload mutate_rows(table_name: nil, authorized_view_name: nil, app_profile_id: nil, entries: nil)
558
+ # Pass arguments to `mutate_rows` via keyword arguments. Note that at
559
+ # least one keyword argument is required. To specify no parameters, or to keep all
560
+ # the default parameter values, pass an empty Hash as a request object (see above).
561
+ #
562
+ # @param table_name [::String]
563
+ # Optional. The unique name of the table to which the mutations should be
564
+ # applied.
565
+ #
566
+ # Values are of the form
567
+ # `projects/<project>/instances/<instance>/tables/<table>`.
568
+ # @param authorized_view_name [::String]
569
+ # Optional. The unique name of the AuthorizedView to which the mutations
570
+ # should be applied.
571
+ #
572
+ # Values are of the form
573
+ # `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
574
+ # @param app_profile_id [::String]
575
+ # This value specifies routing for replication. If not specified, the
576
+ # "default" application profile will be used.
577
+ # @param entries [::Array<::Google::Cloud::Bigtable::V2::MutateRowsRequest::Entry, ::Hash>]
578
+ # Required. The row keys and corresponding mutations to be applied in bulk.
579
+ # Each entry is applied as an atomic mutation, but the entries may be
580
+ # applied in arbitrary order (even between entries for the same row).
581
+ # At least one entry must be specified, and in total the entries can
582
+ # contain at most 100000 mutations.
583
+ # @return [::Enumerable<::Google::Cloud::Bigtable::V2::MutateRowsResponse>]
584
+ #
585
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
586
+ #
587
+ # @example Basic example
588
+ # require "google/cloud/bigtable/v2"
589
+ #
590
+ # # Create a client object. The client can be reused for multiple calls.
591
+ # client = Google::Cloud::Bigtable::V2::Bigtable::Rest::Client.new
592
+ #
593
+ # # Create a request. To set request fields, pass in keyword arguments.
594
+ # request = Google::Cloud::Bigtable::V2::MutateRowsRequest.new
595
+ #
596
+ # # Call the mutate_rows method to start streaming.
597
+ # output = client.mutate_rows request
598
+ #
599
+ # # The returned object is a streamed enumerable yielding elements of type
600
+ # # ::Google::Cloud::Bigtable::V2::MutateRowsResponse
601
+ # output.each do |current_response|
602
+ # p current_response
603
+ # end
604
+ #
605
+ def mutate_rows request, options = nil
606
+ raise ::ArgumentError, "request must be provided" if request.nil?
607
+
608
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::V2::MutateRowsRequest
609
+
610
+ # Converts hash and nil to an options object
611
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
612
+
613
+ # Customize the options with defaults
614
+ call_metadata = @config.rpcs.mutate_rows.metadata.to_h
615
+
616
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
617
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
618
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
619
+ gapic_version: ::Google::Cloud::Bigtable::V2::VERSION,
620
+ transports_version_send: [:rest]
621
+
622
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
623
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
624
+
625
+ options.apply_defaults timeout: @config.rpcs.mutate_rows.timeout,
626
+ metadata: call_metadata,
627
+ retry_policy: @config.rpcs.mutate_rows.retry_policy
628
+
629
+ options.apply_defaults timeout: @config.timeout,
630
+ metadata: @config.metadata,
631
+ retry_policy: @config.retry_policy
632
+
633
+ ::Gapic::Rest::ServerStream.new(
634
+ ::Google::Cloud::Bigtable::V2::MutateRowsResponse,
635
+ ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q|
636
+ @bigtable_stub.mutate_rows request, options do |chunk|
637
+ in_q.deq
638
+ out_q.enq chunk
639
+ end
640
+ end
641
+ )
642
+ rescue ::Gapic::Rest::Error => e
643
+ raise ::Google::Cloud::Error.from_error(e)
644
+ end
645
+
646
+ ##
647
+ # Mutates a row atomically based on the output of a predicate Reader filter.
648
+ #
649
+ # @overload check_and_mutate_row(request, options = nil)
650
+ # Pass arguments to `check_and_mutate_row` via a request object, either of type
651
+ # {::Google::Cloud::Bigtable::V2::CheckAndMutateRowRequest} or an equivalent Hash.
652
+ #
653
+ # @param request [::Google::Cloud::Bigtable::V2::CheckAndMutateRowRequest, ::Hash]
654
+ # A request object representing the call parameters. Required. To specify no
655
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
656
+ # @param options [::Gapic::CallOptions, ::Hash]
657
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
658
+ #
659
+ # @overload check_and_mutate_row(table_name: nil, authorized_view_name: nil, app_profile_id: nil, row_key: nil, predicate_filter: nil, true_mutations: nil, false_mutations: nil)
660
+ # Pass arguments to `check_and_mutate_row` via keyword arguments. Note that at
661
+ # least one keyword argument is required. To specify no parameters, or to keep all
662
+ # the default parameter values, pass an empty Hash as a request object (see above).
663
+ #
664
+ # @param table_name [::String]
665
+ # Optional. The unique name of the table to which the conditional mutation
666
+ # should be applied.
667
+ #
668
+ # Values are of the form
669
+ # `projects/<project>/instances/<instance>/tables/<table>`.
670
+ # @param authorized_view_name [::String]
671
+ # Optional. The unique name of the AuthorizedView to which the conditional
672
+ # mutation should be applied.
673
+ #
674
+ # Values are of the form
675
+ # `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
676
+ # @param app_profile_id [::String]
677
+ # This value specifies routing for replication. If not specified, the
678
+ # "default" application profile will be used.
679
+ # @param row_key [::String]
680
+ # Required. The key of the row to which the conditional mutation should be
681
+ # applied.
682
+ # @param predicate_filter [::Google::Cloud::Bigtable::V2::RowFilter, ::Hash]
683
+ # The filter to be applied to the contents of the specified row. Depending
684
+ # on whether or not any results are yielded, either `true_mutations` or
685
+ # `false_mutations` will be executed. If unset, checks that the row contains
686
+ # any values at all.
687
+ # @param true_mutations [::Array<::Google::Cloud::Bigtable::V2::Mutation, ::Hash>]
688
+ # Changes to be atomically applied to the specified row if `predicate_filter`
689
+ # yields at least one cell when applied to `row_key`. Entries are applied in
690
+ # order, meaning that earlier mutations can be masked by later ones.
691
+ # Must contain at least one entry if `false_mutations` is empty, and at most
692
+ # 100000.
693
+ # @param false_mutations [::Array<::Google::Cloud::Bigtable::V2::Mutation, ::Hash>]
694
+ # Changes to be atomically applied to the specified row if `predicate_filter`
695
+ # does not yield any cells when applied to `row_key`. Entries are applied in
696
+ # order, meaning that earlier mutations can be masked by later ones.
697
+ # Must contain at least one entry if `true_mutations` is empty, and at most
698
+ # 100000.
699
+ # @yield [result, operation] Access the result along with the TransportOperation object
700
+ # @yieldparam result [::Google::Cloud::Bigtable::V2::CheckAndMutateRowResponse]
701
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
702
+ #
703
+ # @return [::Google::Cloud::Bigtable::V2::CheckAndMutateRowResponse]
704
+ #
705
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
706
+ #
707
+ # @example Basic example
708
+ # require "google/cloud/bigtable/v2"
709
+ #
710
+ # # Create a client object. The client can be reused for multiple calls.
711
+ # client = Google::Cloud::Bigtable::V2::Bigtable::Rest::Client.new
712
+ #
713
+ # # Create a request. To set request fields, pass in keyword arguments.
714
+ # request = Google::Cloud::Bigtable::V2::CheckAndMutateRowRequest.new
715
+ #
716
+ # # Call the check_and_mutate_row method.
717
+ # result = client.check_and_mutate_row request
718
+ #
719
+ # # The returned object is of type Google::Cloud::Bigtable::V2::CheckAndMutateRowResponse.
720
+ # p result
721
+ #
722
+ def check_and_mutate_row request, options = nil
723
+ raise ::ArgumentError, "request must be provided" if request.nil?
724
+
725
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::V2::CheckAndMutateRowRequest
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
+ call_metadata = @config.rpcs.check_and_mutate_row.metadata.to_h
732
+
733
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
734
+ call_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::Bigtable::V2::VERSION,
737
+ transports_version_send: [:rest]
738
+
739
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
740
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
741
+
742
+ options.apply_defaults timeout: @config.rpcs.check_and_mutate_row.timeout,
743
+ metadata: call_metadata,
744
+ retry_policy: @config.rpcs.check_and_mutate_row.retry_policy
745
+
746
+ options.apply_defaults timeout: @config.timeout,
747
+ metadata: @config.metadata,
748
+ retry_policy: @config.retry_policy
749
+
750
+ @bigtable_stub.check_and_mutate_row request, options do |result, operation|
751
+ yield result, operation if block_given?
752
+ end
753
+ rescue ::Gapic::Rest::Error => e
754
+ raise ::Google::Cloud::Error.from_error(e)
755
+ end
756
+
757
+ ##
758
+ # Warm up associated instance metadata for this connection.
759
+ # This call is not required but may be useful for connection keep-alive.
760
+ #
761
+ # @overload ping_and_warm(request, options = nil)
762
+ # Pass arguments to `ping_and_warm` via a request object, either of type
763
+ # {::Google::Cloud::Bigtable::V2::PingAndWarmRequest} or an equivalent Hash.
764
+ #
765
+ # @param request [::Google::Cloud::Bigtable::V2::PingAndWarmRequest, ::Hash]
766
+ # A request object representing the call parameters. Required. To specify no
767
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
768
+ # @param options [::Gapic::CallOptions, ::Hash]
769
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
770
+ #
771
+ # @overload ping_and_warm(name: nil, app_profile_id: nil)
772
+ # Pass arguments to `ping_and_warm` via keyword arguments. Note that at
773
+ # least one keyword argument is required. To specify no parameters, or to keep all
774
+ # the default parameter values, pass an empty Hash as a request object (see above).
775
+ #
776
+ # @param name [::String]
777
+ # Required. The unique name of the instance to check permissions for as well
778
+ # as respond. Values are of the form
779
+ # `projects/<project>/instances/<instance>`.
780
+ # @param app_profile_id [::String]
781
+ # This value specifies routing for replication. If not specified, the
782
+ # "default" application profile will be used.
783
+ # @yield [result, operation] Access the result along with the TransportOperation object
784
+ # @yieldparam result [::Google::Cloud::Bigtable::V2::PingAndWarmResponse]
785
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
786
+ #
787
+ # @return [::Google::Cloud::Bigtable::V2::PingAndWarmResponse]
788
+ #
789
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
790
+ #
791
+ # @example Basic example
792
+ # require "google/cloud/bigtable/v2"
793
+ #
794
+ # # Create a client object. The client can be reused for multiple calls.
795
+ # client = Google::Cloud::Bigtable::V2::Bigtable::Rest::Client.new
796
+ #
797
+ # # Create a request. To set request fields, pass in keyword arguments.
798
+ # request = Google::Cloud::Bigtable::V2::PingAndWarmRequest.new
799
+ #
800
+ # # Call the ping_and_warm method.
801
+ # result = client.ping_and_warm request
802
+ #
803
+ # # The returned object is of type Google::Cloud::Bigtable::V2::PingAndWarmResponse.
804
+ # p result
805
+ #
806
+ def ping_and_warm request, options = nil
807
+ raise ::ArgumentError, "request must be provided" if request.nil?
808
+
809
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::V2::PingAndWarmRequest
810
+
811
+ # Converts hash and nil to an options object
812
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
813
+
814
+ # Customize the options with defaults
815
+ call_metadata = @config.rpcs.ping_and_warm.metadata.to_h
816
+
817
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
818
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
819
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
820
+ gapic_version: ::Google::Cloud::Bigtable::V2::VERSION,
821
+ transports_version_send: [:rest]
822
+
823
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
824
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
825
+
826
+ options.apply_defaults timeout: @config.rpcs.ping_and_warm.timeout,
827
+ metadata: call_metadata,
828
+ retry_policy: @config.rpcs.ping_and_warm.retry_policy
829
+
830
+ options.apply_defaults timeout: @config.timeout,
831
+ metadata: @config.metadata,
832
+ retry_policy: @config.retry_policy
833
+
834
+ @bigtable_stub.ping_and_warm request, options do |result, operation|
835
+ yield result, operation if block_given?
836
+ end
837
+ rescue ::Gapic::Rest::Error => e
838
+ raise ::Google::Cloud::Error.from_error(e)
839
+ end
840
+
841
+ ##
842
+ # Modifies a row atomically on the server. The method reads the latest
843
+ # existing timestamp and value from the specified columns and writes a new
844
+ # entry based on pre-defined read/modify/write rules. The new value for the
845
+ # timestamp is the greater of the existing timestamp or the current server
846
+ # time. The method returns the new contents of all modified cells.
847
+ #
848
+ # @overload read_modify_write_row(request, options = nil)
849
+ # Pass arguments to `read_modify_write_row` via a request object, either of type
850
+ # {::Google::Cloud::Bigtable::V2::ReadModifyWriteRowRequest} or an equivalent Hash.
851
+ #
852
+ # @param request [::Google::Cloud::Bigtable::V2::ReadModifyWriteRowRequest, ::Hash]
853
+ # A request object representing the call parameters. Required. To specify no
854
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
855
+ # @param options [::Gapic::CallOptions, ::Hash]
856
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
857
+ #
858
+ # @overload read_modify_write_row(table_name: nil, authorized_view_name: nil, app_profile_id: nil, row_key: nil, rules: nil)
859
+ # Pass arguments to `read_modify_write_row` via keyword arguments. Note that at
860
+ # least one keyword argument is required. To specify no parameters, or to keep all
861
+ # the default parameter values, pass an empty Hash as a request object (see above).
862
+ #
863
+ # @param table_name [::String]
864
+ # Optional. The unique name of the table to which the read/modify/write rules
865
+ # should be applied.
866
+ #
867
+ # Values are of the form
868
+ # `projects/<project>/instances/<instance>/tables/<table>`.
869
+ # @param authorized_view_name [::String]
870
+ # Optional. The unique name of the AuthorizedView to which the
871
+ # read/modify/write rules should be applied.
872
+ #
873
+ # Values are of the form
874
+ # `projects/<project>/instances/<instance>/tables/<table>/authorizedViews/<authorized_view>`.
875
+ # @param app_profile_id [::String]
876
+ # This value specifies routing for replication. If not specified, the
877
+ # "default" application profile will be used.
878
+ # @param row_key [::String]
879
+ # Required. The key of the row to which the read/modify/write rules should be
880
+ # applied.
881
+ # @param rules [::Array<::Google::Cloud::Bigtable::V2::ReadModifyWriteRule, ::Hash>]
882
+ # Required. Rules specifying how the specified row's contents are to be
883
+ # transformed into writes. Entries are applied in order, meaning that earlier
884
+ # rules will affect the results of later ones. At least one entry must be
885
+ # specified, and there can be at most 100000 rules.
886
+ # @yield [result, operation] Access the result along with the TransportOperation object
887
+ # @yieldparam result [::Google::Cloud::Bigtable::V2::ReadModifyWriteRowResponse]
888
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
889
+ #
890
+ # @return [::Google::Cloud::Bigtable::V2::ReadModifyWriteRowResponse]
891
+ #
892
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
893
+ #
894
+ # @example Basic example
895
+ # require "google/cloud/bigtable/v2"
896
+ #
897
+ # # Create a client object. The client can be reused for multiple calls.
898
+ # client = Google::Cloud::Bigtable::V2::Bigtable::Rest::Client.new
899
+ #
900
+ # # Create a request. To set request fields, pass in keyword arguments.
901
+ # request = Google::Cloud::Bigtable::V2::ReadModifyWriteRowRequest.new
902
+ #
903
+ # # Call the read_modify_write_row method.
904
+ # result = client.read_modify_write_row request
905
+ #
906
+ # # The returned object is of type Google::Cloud::Bigtable::V2::ReadModifyWriteRowResponse.
907
+ # p result
908
+ #
909
+ def read_modify_write_row request, options = nil
910
+ raise ::ArgumentError, "request must be provided" if request.nil?
911
+
912
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::V2::ReadModifyWriteRowRequest
913
+
914
+ # Converts hash and nil to an options object
915
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
916
+
917
+ # Customize the options with defaults
918
+ call_metadata = @config.rpcs.read_modify_write_row.metadata.to_h
919
+
920
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
921
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
922
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
923
+ gapic_version: ::Google::Cloud::Bigtable::V2::VERSION,
924
+ transports_version_send: [:rest]
925
+
926
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
927
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
928
+
929
+ options.apply_defaults timeout: @config.rpcs.read_modify_write_row.timeout,
930
+ metadata: call_metadata,
931
+ retry_policy: @config.rpcs.read_modify_write_row.retry_policy
932
+
933
+ options.apply_defaults timeout: @config.timeout,
934
+ metadata: @config.metadata,
935
+ retry_policy: @config.retry_policy
936
+
937
+ @bigtable_stub.read_modify_write_row request, options do |result, operation|
938
+ yield result, operation if block_given?
939
+ end
940
+ rescue ::Gapic::Rest::Error => e
941
+ raise ::Google::Cloud::Error.from_error(e)
942
+ end
943
+
944
+ ##
945
+ # Returns the current list of partitions that make up the table's
946
+ # change stream. The union of partitions will cover the entire keyspace.
947
+ # Partitions can be read with `ReadChangeStream`.
948
+ # NOTE: This API is only intended to be used by Apache Beam BigtableIO.
949
+ #
950
+ # @overload generate_initial_change_stream_partitions(request, options = nil)
951
+ # Pass arguments to `generate_initial_change_stream_partitions` via a request object, either of type
952
+ # {::Google::Cloud::Bigtable::V2::GenerateInitialChangeStreamPartitionsRequest} or an equivalent Hash.
953
+ #
954
+ # @param request [::Google::Cloud::Bigtable::V2::GenerateInitialChangeStreamPartitionsRequest, ::Hash]
955
+ # A request object representing the call parameters. Required. To specify no
956
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
957
+ # @param options [::Gapic::CallOptions, ::Hash]
958
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
959
+ #
960
+ # @overload generate_initial_change_stream_partitions(table_name: nil, app_profile_id: nil)
961
+ # Pass arguments to `generate_initial_change_stream_partitions` via keyword arguments. Note that at
962
+ # least one keyword argument is required. To specify no parameters, or to keep all
963
+ # the default parameter values, pass an empty Hash as a request object (see above).
964
+ #
965
+ # @param table_name [::String]
966
+ # Required. The unique name of the table from which to get change stream
967
+ # partitions. Values are of the form
968
+ # `projects/<project>/instances/<instance>/tables/<table>`.
969
+ # Change streaming must be enabled on the table.
970
+ # @param app_profile_id [::String]
971
+ # This value specifies routing for replication. If not specified, the
972
+ # "default" application profile will be used.
973
+ # Single cluster routing must be configured on the profile.
974
+ # @return [::Enumerable<::Google::Cloud::Bigtable::V2::GenerateInitialChangeStreamPartitionsResponse>]
975
+ #
976
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
977
+ #
978
+ # @example Basic example
979
+ # require "google/cloud/bigtable/v2"
980
+ #
981
+ # # Create a client object. The client can be reused for multiple calls.
982
+ # client = Google::Cloud::Bigtable::V2::Bigtable::Rest::Client.new
983
+ #
984
+ # # Create a request. To set request fields, pass in keyword arguments.
985
+ # request = Google::Cloud::Bigtable::V2::GenerateInitialChangeStreamPartitionsRequest.new
986
+ #
987
+ # # Call the generate_initial_change_stream_partitions method to start streaming.
988
+ # output = client.generate_initial_change_stream_partitions request
989
+ #
990
+ # # The returned object is a streamed enumerable yielding elements of type
991
+ # # ::Google::Cloud::Bigtable::V2::GenerateInitialChangeStreamPartitionsResponse
992
+ # output.each do |current_response|
993
+ # p current_response
994
+ # end
995
+ #
996
+ def generate_initial_change_stream_partitions request, options = nil
997
+ raise ::ArgumentError, "request must be provided" if request.nil?
998
+
999
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::V2::GenerateInitialChangeStreamPartitionsRequest
1000
+
1001
+ # Converts hash and nil to an options object
1002
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1003
+
1004
+ # Customize the options with defaults
1005
+ call_metadata = @config.rpcs.generate_initial_change_stream_partitions.metadata.to_h
1006
+
1007
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1008
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1009
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1010
+ gapic_version: ::Google::Cloud::Bigtable::V2::VERSION,
1011
+ transports_version_send: [:rest]
1012
+
1013
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1014
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1015
+
1016
+ options.apply_defaults timeout: @config.rpcs.generate_initial_change_stream_partitions.timeout,
1017
+ metadata: call_metadata,
1018
+ retry_policy: @config.rpcs.generate_initial_change_stream_partitions.retry_policy
1019
+
1020
+ options.apply_defaults timeout: @config.timeout,
1021
+ metadata: @config.metadata,
1022
+ retry_policy: @config.retry_policy
1023
+
1024
+ ::Gapic::Rest::ServerStream.new(
1025
+ ::Google::Cloud::Bigtable::V2::GenerateInitialChangeStreamPartitionsResponse,
1026
+ ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q|
1027
+ @bigtable_stub.generate_initial_change_stream_partitions request, options do |chunk|
1028
+ in_q.deq
1029
+ out_q.enq chunk
1030
+ end
1031
+ end
1032
+ )
1033
+ rescue ::Gapic::Rest::Error => e
1034
+ raise ::Google::Cloud::Error.from_error(e)
1035
+ end
1036
+
1037
+ ##
1038
+ # Reads changes from a table's change stream. Changes will
1039
+ # reflect both user-initiated mutations and mutations that are caused by
1040
+ # garbage collection.
1041
+ # NOTE: This API is only intended to be used by Apache Beam BigtableIO.
1042
+ #
1043
+ # @overload read_change_stream(request, options = nil)
1044
+ # Pass arguments to `read_change_stream` via a request object, either of type
1045
+ # {::Google::Cloud::Bigtable::V2::ReadChangeStreamRequest} or an equivalent Hash.
1046
+ #
1047
+ # @param request [::Google::Cloud::Bigtable::V2::ReadChangeStreamRequest, ::Hash]
1048
+ # A request object representing the call parameters. Required. To specify no
1049
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1050
+ # @param options [::Gapic::CallOptions, ::Hash]
1051
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1052
+ #
1053
+ # @overload read_change_stream(table_name: nil, app_profile_id: nil, partition: nil, start_time: nil, continuation_tokens: nil, end_time: nil, heartbeat_duration: nil)
1054
+ # Pass arguments to `read_change_stream` via keyword arguments. Note that at
1055
+ # least one keyword argument is required. To specify no parameters, or to keep all
1056
+ # the default parameter values, pass an empty Hash as a request object (see above).
1057
+ #
1058
+ # @param table_name [::String]
1059
+ # Required. The unique name of the table from which to read a change stream.
1060
+ # Values are of the form
1061
+ # `projects/<project>/instances/<instance>/tables/<table>`.
1062
+ # Change streaming must be enabled on the table.
1063
+ # @param app_profile_id [::String]
1064
+ # This value specifies routing for replication. If not specified, the
1065
+ # "default" application profile will be used.
1066
+ # Single cluster routing must be configured on the profile.
1067
+ # @param partition [::Google::Cloud::Bigtable::V2::StreamPartition, ::Hash]
1068
+ # The partition to read changes from.
1069
+ # @param start_time [::Google::Protobuf::Timestamp, ::Hash]
1070
+ # Start reading the stream at the specified timestamp. This timestamp must
1071
+ # be within the change stream retention period, less than or equal to the
1072
+ # current time, and after change stream creation, whichever is greater.
1073
+ # This value is inclusive and will be truncated to microsecond granularity.
1074
+ #
1075
+ # Note: The following parameters are mutually exclusive: `start_time`, `continuation_tokens`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
1076
+ # @param continuation_tokens [::Google::Cloud::Bigtable::V2::StreamContinuationTokens, ::Hash]
1077
+ # Tokens that describe how to resume reading a stream where reading
1078
+ # previously left off. If specified, changes will be read starting at the
1079
+ # the position. Tokens are delivered on the stream as part of `Heartbeat`
1080
+ # and `CloseStream` messages.
1081
+ #
1082
+ # If a single token is provided, the token's partition must exactly match
1083
+ # the request's partition. If multiple tokens are provided, as in the case
1084
+ # of a partition merge, the union of the token partitions must exactly
1085
+ # cover the request's partition. Otherwise, INVALID_ARGUMENT will be
1086
+ # returned.
1087
+ #
1088
+ # Note: The following parameters are mutually exclusive: `continuation_tokens`, `start_time`. At most one of these parameters can be set. If more than one is set, only one will be used, and it is not defined which one.
1089
+ # @param end_time [::Google::Protobuf::Timestamp, ::Hash]
1090
+ # If specified, OK will be returned when the stream advances beyond
1091
+ # this time. Otherwise, changes will be continuously delivered on the stream.
1092
+ # This value is inclusive and will be truncated to microsecond granularity.
1093
+ # @param heartbeat_duration [::Google::Protobuf::Duration, ::Hash]
1094
+ # If specified, the duration between `Heartbeat` messages on the stream.
1095
+ # Otherwise, defaults to 5 seconds.
1096
+ # @return [::Enumerable<::Google::Cloud::Bigtable::V2::ReadChangeStreamResponse>]
1097
+ #
1098
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1099
+ #
1100
+ # @example Basic example
1101
+ # require "google/cloud/bigtable/v2"
1102
+ #
1103
+ # # Create a client object. The client can be reused for multiple calls.
1104
+ # client = Google::Cloud::Bigtable::V2::Bigtable::Rest::Client.new
1105
+ #
1106
+ # # Create a request. To set request fields, pass in keyword arguments.
1107
+ # request = Google::Cloud::Bigtable::V2::ReadChangeStreamRequest.new
1108
+ #
1109
+ # # Call the read_change_stream method to start streaming.
1110
+ # output = client.read_change_stream request
1111
+ #
1112
+ # # The returned object is a streamed enumerable yielding elements of type
1113
+ # # ::Google::Cloud::Bigtable::V2::ReadChangeStreamResponse
1114
+ # output.each do |current_response|
1115
+ # p current_response
1116
+ # end
1117
+ #
1118
+ def read_change_stream request, options = nil
1119
+ raise ::ArgumentError, "request must be provided" if request.nil?
1120
+
1121
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::V2::ReadChangeStreamRequest
1122
+
1123
+ # Converts hash and nil to an options object
1124
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1125
+
1126
+ # Customize the options with defaults
1127
+ call_metadata = @config.rpcs.read_change_stream.metadata.to_h
1128
+
1129
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1130
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1131
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1132
+ gapic_version: ::Google::Cloud::Bigtable::V2::VERSION,
1133
+ transports_version_send: [:rest]
1134
+
1135
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1136
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1137
+
1138
+ options.apply_defaults timeout: @config.rpcs.read_change_stream.timeout,
1139
+ metadata: call_metadata,
1140
+ retry_policy: @config.rpcs.read_change_stream.retry_policy
1141
+
1142
+ options.apply_defaults timeout: @config.timeout,
1143
+ metadata: @config.metadata,
1144
+ retry_policy: @config.retry_policy
1145
+
1146
+ ::Gapic::Rest::ServerStream.new(
1147
+ ::Google::Cloud::Bigtable::V2::ReadChangeStreamResponse,
1148
+ ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q|
1149
+ @bigtable_stub.read_change_stream request, options do |chunk|
1150
+ in_q.deq
1151
+ out_q.enq chunk
1152
+ end
1153
+ end
1154
+ )
1155
+ rescue ::Gapic::Rest::Error => e
1156
+ raise ::Google::Cloud::Error.from_error(e)
1157
+ end
1158
+
1159
+ ##
1160
+ # Prepares a GoogleSQL query for execution on a particular Bigtable instance.
1161
+ #
1162
+ # @overload prepare_query(request, options = nil)
1163
+ # Pass arguments to `prepare_query` via a request object, either of type
1164
+ # {::Google::Cloud::Bigtable::V2::PrepareQueryRequest} or an equivalent Hash.
1165
+ #
1166
+ # @param request [::Google::Cloud::Bigtable::V2::PrepareQueryRequest, ::Hash]
1167
+ # A request object representing the call parameters. Required. To specify no
1168
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1169
+ # @param options [::Gapic::CallOptions, ::Hash]
1170
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1171
+ #
1172
+ # @overload prepare_query(instance_name: nil, app_profile_id: nil, query: nil, proto_format: nil, param_types: nil)
1173
+ # Pass arguments to `prepare_query` via keyword arguments. Note that at
1174
+ # least one keyword argument is required. To specify no parameters, or to keep all
1175
+ # the default parameter values, pass an empty Hash as a request object (see above).
1176
+ #
1177
+ # @param instance_name [::String]
1178
+ # Required. The unique name of the instance against which the query should be
1179
+ # executed.
1180
+ # Values are of the form `projects/<project>/instances/<instance>`
1181
+ # @param app_profile_id [::String]
1182
+ # Optional. This value specifies routing for preparing the query. Note that
1183
+ # this `app_profile_id` is only used for preparing the query. The actual
1184
+ # query execution will use the app profile specified in the
1185
+ # `ExecuteQueryRequest`. If not specified, the `default` application profile
1186
+ # will be used.
1187
+ # @param query [::String]
1188
+ # Required. The query string.
1189
+ # @param proto_format [::Google::Cloud::Bigtable::V2::ProtoFormat, ::Hash]
1190
+ # Protocol buffer format as described by ProtoSchema and ProtoRows
1191
+ # messages.
1192
+ # @param param_types [::Hash{::String => ::Google::Cloud::Bigtable::V2::Type, ::Hash}]
1193
+ # Required. `param_types` is a map of parameter identifier strings to their
1194
+ # `Type`s.
1195
+ #
1196
+ # In query string, a parameter placeholder consists of the
1197
+ # `@` character followed by the parameter name (for example, `@firstName`) in
1198
+ # the query string.
1199
+ #
1200
+ # For example, if param_types["firstName"] = Bytes then @firstName will be a
1201
+ # query parameter of type Bytes. The specific `Value` to be used for the
1202
+ # query execution must be sent in `ExecuteQueryRequest` in the `params` map.
1203
+ # @yield [result, operation] Access the result along with the TransportOperation object
1204
+ # @yieldparam result [::Google::Cloud::Bigtable::V2::PrepareQueryResponse]
1205
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1206
+ #
1207
+ # @return [::Google::Cloud::Bigtable::V2::PrepareQueryResponse]
1208
+ #
1209
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1210
+ #
1211
+ # @example Basic example
1212
+ # require "google/cloud/bigtable/v2"
1213
+ #
1214
+ # # Create a client object. The client can be reused for multiple calls.
1215
+ # client = Google::Cloud::Bigtable::V2::Bigtable::Rest::Client.new
1216
+ #
1217
+ # # Create a request. To set request fields, pass in keyword arguments.
1218
+ # request = Google::Cloud::Bigtable::V2::PrepareQueryRequest.new
1219
+ #
1220
+ # # Call the prepare_query method.
1221
+ # result = client.prepare_query request
1222
+ #
1223
+ # # The returned object is of type Google::Cloud::Bigtable::V2::PrepareQueryResponse.
1224
+ # p result
1225
+ #
1226
+ def prepare_query request, options = nil
1227
+ raise ::ArgumentError, "request must be provided" if request.nil?
1228
+
1229
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::V2::PrepareQueryRequest
1230
+
1231
+ # Converts hash and nil to an options object
1232
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1233
+
1234
+ # Customize the options with defaults
1235
+ call_metadata = @config.rpcs.prepare_query.metadata.to_h
1236
+
1237
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1238
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1239
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1240
+ gapic_version: ::Google::Cloud::Bigtable::V2::VERSION,
1241
+ transports_version_send: [:rest]
1242
+
1243
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1244
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1245
+
1246
+ options.apply_defaults timeout: @config.rpcs.prepare_query.timeout,
1247
+ metadata: call_metadata,
1248
+ retry_policy: @config.rpcs.prepare_query.retry_policy
1249
+
1250
+ options.apply_defaults timeout: @config.timeout,
1251
+ metadata: @config.metadata,
1252
+ retry_policy: @config.retry_policy
1253
+
1254
+ @bigtable_stub.prepare_query request, options do |result, operation|
1255
+ yield result, operation if block_given?
1256
+ end
1257
+ rescue ::Gapic::Rest::Error => e
1258
+ raise ::Google::Cloud::Error.from_error(e)
1259
+ end
1260
+
1261
+ ##
1262
+ # Executes a SQL query against a particular Bigtable instance.
1263
+ #
1264
+ # @overload execute_query(request, options = nil)
1265
+ # Pass arguments to `execute_query` via a request object, either of type
1266
+ # {::Google::Cloud::Bigtable::V2::ExecuteQueryRequest} or an equivalent Hash.
1267
+ #
1268
+ # @param request [::Google::Cloud::Bigtable::V2::ExecuteQueryRequest, ::Hash]
1269
+ # A request object representing the call parameters. Required. To specify no
1270
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1271
+ # @param options [::Gapic::CallOptions, ::Hash]
1272
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1273
+ #
1274
+ # @overload execute_query(instance_name: nil, app_profile_id: nil, query: nil, prepared_query: nil, proto_format: nil, resume_token: nil, params: nil, view_parameters: nil)
1275
+ # Pass arguments to `execute_query` via keyword arguments. Note that at
1276
+ # least one keyword argument is required. To specify no parameters, or to keep all
1277
+ # the default parameter values, pass an empty Hash as a request object (see above).
1278
+ #
1279
+ # @param instance_name [::String]
1280
+ # Required. The unique name of the instance against which the query should be
1281
+ # executed.
1282
+ # Values are of the form `projects/<project>/instances/<instance>`
1283
+ # @param app_profile_id [::String]
1284
+ # Optional. This value specifies routing for replication. If not specified,
1285
+ # the `default` application profile will be used.
1286
+ # @param query [::String]
1287
+ # Required. The query string.
1288
+ #
1289
+ # Exactly one of `query` and `prepared_query` is required. Setting both
1290
+ # or neither is an `INVALID_ARGUMENT`.
1291
+ # @param prepared_query [::String]
1292
+ # A prepared query that was returned from `PrepareQueryResponse`.
1293
+ #
1294
+ # Exactly one of `query` and `prepared_query` is required. Setting both
1295
+ # or neither is an `INVALID_ARGUMENT`.
1296
+ #
1297
+ # Setting this field also places restrictions on several other fields:
1298
+ # - `data_format` must be empty.
1299
+ # - `validate_only` must be false.
1300
+ # - `params` must match the `param_types` set in the `PrepareQueryRequest`.
1301
+ # @param proto_format [::Google::Cloud::Bigtable::V2::ProtoFormat, ::Hash]
1302
+ # Protocol buffer format as described by ProtoSchema and ProtoRows
1303
+ # messages.
1304
+ # @param resume_token [::String]
1305
+ # Optional. If this request is resuming a previously interrupted query
1306
+ # execution, `resume_token` should be copied from the last
1307
+ # PartialResultSet yielded before the interruption. Doing this
1308
+ # enables the query execution to resume where the last one left
1309
+ # off.
1310
+ # The rest of the request parameters must exactly match the
1311
+ # request that yielded this token. Otherwise the request will fail.
1312
+ # @param params [::Hash{::String => ::Google::Cloud::Bigtable::V2::Value, ::Hash}]
1313
+ # Required. params contains string type keys and Bigtable type values that
1314
+ # bind to placeholders in the query string. In query string, a parameter
1315
+ # placeholder consists of the
1316
+ # `@` character followed by the parameter name (for example, `@firstName`) in
1317
+ # the query string.
1318
+ #
1319
+ # For example, if
1320
+ # `params["firstName"] = bytes_value: "foo" type {bytes_type {}}`
1321
+ # then `@firstName` will be replaced with googlesql bytes value "foo" in the
1322
+ # query string during query evaluation.
1323
+ #
1324
+ # If `Value.kind` is not set, the value is treated as a NULL value of the
1325
+ # given type. For example, if
1326
+ # `params["firstName"] = type {string_type {}}`
1327
+ # then `@firstName` will be replaced with googlesql null string.
1328
+ #
1329
+ # If `query` is set, any empty `Value.type` in the map will be rejected with
1330
+ # `INVALID_ARGUMENT`.
1331
+ #
1332
+ # If `prepared_query` is set, any empty `Value.type` in the map will be
1333
+ # inferred from the `param_types` in the `PrepareQueryRequest`. Any non-empty
1334
+ # `Value.type` must match the corresponding `param_types` entry, or be
1335
+ # rejected with `INVALID_ARGUMENT`.
1336
+ # @param view_parameters [::Hash{::String => ::Google::Cloud::Bigtable::V2::Value, ::Hash}]
1337
+ # Optional. This map provides the runtime values returned by the
1338
+ # VIEW_PARAMETERS() function calls, typically used for user-level scoping of
1339
+ # data based on identity.
1340
+ #
1341
+ # The key is the name of the view parameter e.g. `user_id`, and
1342
+ # the value is the parameter value e.g. `alice@example.com`.
1343
+ # @return [::Enumerable<::Google::Cloud::Bigtable::V2::ExecuteQueryResponse>]
1344
+ #
1345
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1346
+ #
1347
+ # @example Basic example
1348
+ # require "google/cloud/bigtable/v2"
1349
+ #
1350
+ # # Create a client object. The client can be reused for multiple calls.
1351
+ # client = Google::Cloud::Bigtable::V2::Bigtable::Rest::Client.new
1352
+ #
1353
+ # # Create a request. To set request fields, pass in keyword arguments.
1354
+ # request = Google::Cloud::Bigtable::V2::ExecuteQueryRequest.new
1355
+ #
1356
+ # # Call the execute_query method to start streaming.
1357
+ # output = client.execute_query request
1358
+ #
1359
+ # # The returned object is a streamed enumerable yielding elements of type
1360
+ # # ::Google::Cloud::Bigtable::V2::ExecuteQueryResponse
1361
+ # output.each do |current_response|
1362
+ # p current_response
1363
+ # end
1364
+ #
1365
+ def execute_query request, options = nil
1366
+ raise ::ArgumentError, "request must be provided" if request.nil?
1367
+
1368
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Bigtable::V2::ExecuteQueryRequest
1369
+
1370
+ # Converts hash and nil to an options object
1371
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1372
+
1373
+ # Customize the options with defaults
1374
+ call_metadata = @config.rpcs.execute_query.metadata.to_h
1375
+
1376
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1377
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1378
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1379
+ gapic_version: ::Google::Cloud::Bigtable::V2::VERSION,
1380
+ transports_version_send: [:rest]
1381
+
1382
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1383
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1384
+
1385
+ options.apply_defaults timeout: @config.rpcs.execute_query.timeout,
1386
+ metadata: call_metadata,
1387
+ retry_policy: @config.rpcs.execute_query.retry_policy
1388
+
1389
+ options.apply_defaults timeout: @config.timeout,
1390
+ metadata: @config.metadata,
1391
+ retry_policy: @config.retry_policy
1392
+
1393
+ ::Gapic::Rest::ServerStream.new(
1394
+ ::Google::Cloud::Bigtable::V2::ExecuteQueryResponse,
1395
+ ::Gapic::Rest::ThreadedEnumerator.new do |in_q, out_q|
1396
+ @bigtable_stub.execute_query request, options do |chunk|
1397
+ in_q.deq
1398
+ out_q.enq chunk
1399
+ end
1400
+ end
1401
+ )
1402
+ rescue ::Gapic::Rest::Error => e
1403
+ raise ::Google::Cloud::Error.from_error(e)
1404
+ end
1405
+
1406
+ ##
1407
+ # Configuration class for the Bigtable REST API.
1408
+ #
1409
+ # This class represents the configuration for Bigtable REST,
1410
+ # providing control over timeouts, retry behavior, logging, transport
1411
+ # parameters, and other low-level controls. Certain parameters can also be
1412
+ # applied individually to specific RPCs. See
1413
+ # {::Google::Cloud::Bigtable::V2::Bigtable::Rest::Client::Configuration::Rpcs}
1414
+ # for a list of RPCs that can be configured independently.
1415
+ #
1416
+ # Configuration can be applied globally to all clients, or to a single client
1417
+ # on construction.
1418
+ #
1419
+ # @example
1420
+ #
1421
+ # # Modify the global config, setting the timeout for
1422
+ # # read_rows to 20 seconds,
1423
+ # # and all remaining timeouts to 10 seconds.
1424
+ # ::Google::Cloud::Bigtable::V2::Bigtable::Rest::Client.configure do |config|
1425
+ # config.timeout = 10.0
1426
+ # config.rpcs.read_rows.timeout = 20.0
1427
+ # end
1428
+ #
1429
+ # # Apply the above configuration only to a new client.
1430
+ # client = ::Google::Cloud::Bigtable::V2::Bigtable::Rest::Client.new do |config|
1431
+ # config.timeout = 10.0
1432
+ # config.rpcs.read_rows.timeout = 20.0
1433
+ # end
1434
+ #
1435
+ # @!attribute [rw] endpoint
1436
+ # A custom service endpoint, as a hostname or hostname:port. The default is
1437
+ # nil, indicating to use the default endpoint in the current universe domain.
1438
+ # @return [::String,nil]
1439
+ # @!attribute [rw] credentials
1440
+ # Credentials to send with calls. You may provide any of the following types:
1441
+ # * (`String`) The path to a service account key file in JSON format
1442
+ # * (`Hash`) A service account key as a Hash
1443
+ # * (`Google::Auth::Credentials`) A googleauth credentials object
1444
+ # (see the [googleauth docs](https://rubydoc.info/gems/googleauth/Google/Auth/Credentials))
1445
+ # * (`Signet::OAuth2::Client`) A signet oauth2 client object
1446
+ # (see the [signet docs](https://rubydoc.info/gems/signet/Signet/OAuth2/Client))
1447
+ # * (`nil`) indicating no credentials
1448
+ #
1449
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1450
+ # external source for authentication to Google Cloud, you must validate it before
1451
+ # providing it to a Google API client library. Providing an unvalidated credential
1452
+ # configuration to Google APIs can compromise the security of your systems and data.
1453
+ # For more information, refer to [Validate credential configurations from external
1454
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1455
+ # @return [::Object]
1456
+ # @!attribute [rw] scope
1457
+ # The OAuth scopes
1458
+ # @return [::Array<::String>]
1459
+ # @!attribute [rw] lib_name
1460
+ # The library name as recorded in instrumentation and logging
1461
+ # @return [::String]
1462
+ # @!attribute [rw] lib_version
1463
+ # The library version as recorded in instrumentation and logging
1464
+ # @return [::String]
1465
+ # @!attribute [rw] timeout
1466
+ # The call timeout in seconds.
1467
+ # @return [::Numeric]
1468
+ # @!attribute [rw] metadata
1469
+ # Additional headers to be sent with the call.
1470
+ # @return [::Hash{::Symbol=>::String}]
1471
+ # @!attribute [rw] retry_policy
1472
+ # The retry policy. The value is a hash with the following keys:
1473
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1474
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1475
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1476
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
1477
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1478
+ # trigger a retry.
1479
+ # @return [::Hash]
1480
+ # @!attribute [rw] quota_project
1481
+ # A separate project against which to charge quota.
1482
+ # @return [::String]
1483
+ # @!attribute [rw] universe_domain
1484
+ # The universe domain within which to make requests. This determines the
1485
+ # default endpoint URL. The default value of nil uses the environment
1486
+ # universe (usually the default "googleapis.com" universe).
1487
+ # @return [::String,nil]
1488
+ # @!attribute [rw] logger
1489
+ # A custom logger to use for request/response debug logging, or the value
1490
+ # `:default` (the default) to construct a default logger, or `nil` to
1491
+ # explicitly disable logging.
1492
+ # @return [::Logger,:default,nil]
1493
+ #
1494
+ class Configuration
1495
+ extend ::Gapic::Config
1496
+
1497
+ # @private
1498
+ # The endpoint specific to the default "googleapis.com" universe. Deprecated.
1499
+ DEFAULT_ENDPOINT = "bigtable.googleapis.com"
1500
+
1501
+ config_attr :endpoint, nil, ::String, nil
1502
+ config_attr :credentials, nil do |value|
1503
+ allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Google::Auth::BaseClient, ::Signet::OAuth2::Client, nil]
1504
+ allowed.any? { |klass| klass === value }
1505
+ end
1506
+ config_attr :scope, nil, ::String, ::Array, nil
1507
+ config_attr :lib_name, nil, ::String, nil
1508
+ config_attr :lib_version, nil, ::String, nil
1509
+ config_attr :timeout, nil, ::Numeric, nil
1510
+ config_attr :metadata, nil, ::Hash, nil
1511
+ config_attr :retry_policy, nil, ::Hash, ::Proc, nil
1512
+ config_attr :quota_project, nil, ::String, nil
1513
+ config_attr :universe_domain, nil, ::String, nil
1514
+ config_attr :logger, :default, ::Logger, nil, :default
1515
+
1516
+ # @private
1517
+ def initialize parent_config = nil
1518
+ @parent_config = parent_config unless parent_config.nil?
1519
+
1520
+ yield self if block_given?
1521
+ end
1522
+
1523
+ ##
1524
+ # Configurations for individual RPCs
1525
+ # @return [Rpcs]
1526
+ #
1527
+ def rpcs
1528
+ @rpcs ||= begin
1529
+ parent_rpcs = nil
1530
+ parent_rpcs = @parent_config.rpcs if defined?(@parent_config) && @parent_config.respond_to?(:rpcs)
1531
+ Rpcs.new parent_rpcs
1532
+ end
1533
+ end
1534
+
1535
+ ##
1536
+ # Configuration RPC class for the Bigtable API.
1537
+ #
1538
+ # Includes fields providing the configuration for each RPC in this service.
1539
+ # Each configuration object is of type `Gapic::Config::Method` and includes
1540
+ # the following configuration fields:
1541
+ #
1542
+ # * `timeout` (*type:* `Numeric`) - The call timeout in seconds
1543
+ # * `metadata` (*type:* `Hash{Symbol=>String}`) - Additional headers
1544
+ # * `retry_policy (*type:* `Hash`) - The retry policy. The policy fields
1545
+ # include the following keys:
1546
+ # * `:initial_delay` (*type:* `Numeric`) - The initial delay in seconds.
1547
+ # * `:max_delay` (*type:* `Numeric`) - The max delay in seconds.
1548
+ # * `:multiplier` (*type:* `Numeric`) - The incremental backoff multiplier.
1549
+ # * `:jitter` (*type:* `Numeric`) - The jitter in seconds. Default: 1.0.
1550
+ # * `:retry_codes` (*type:* `Array<String>`) - The error codes that should
1551
+ # trigger a retry.
1552
+ #
1553
+ class Rpcs
1554
+ ##
1555
+ # RPC-specific configuration for `read_rows`
1556
+ # @return [::Gapic::Config::Method]
1557
+ #
1558
+ attr_reader :read_rows
1559
+ ##
1560
+ # RPC-specific configuration for `sample_row_keys`
1561
+ # @return [::Gapic::Config::Method]
1562
+ #
1563
+ attr_reader :sample_row_keys
1564
+ ##
1565
+ # RPC-specific configuration for `mutate_row`
1566
+ # @return [::Gapic::Config::Method]
1567
+ #
1568
+ attr_reader :mutate_row
1569
+ ##
1570
+ # RPC-specific configuration for `mutate_rows`
1571
+ # @return [::Gapic::Config::Method]
1572
+ #
1573
+ attr_reader :mutate_rows
1574
+ ##
1575
+ # RPC-specific configuration for `check_and_mutate_row`
1576
+ # @return [::Gapic::Config::Method]
1577
+ #
1578
+ attr_reader :check_and_mutate_row
1579
+ ##
1580
+ # RPC-specific configuration for `ping_and_warm`
1581
+ # @return [::Gapic::Config::Method]
1582
+ #
1583
+ attr_reader :ping_and_warm
1584
+ ##
1585
+ # RPC-specific configuration for `read_modify_write_row`
1586
+ # @return [::Gapic::Config::Method]
1587
+ #
1588
+ attr_reader :read_modify_write_row
1589
+ ##
1590
+ # RPC-specific configuration for `generate_initial_change_stream_partitions`
1591
+ # @return [::Gapic::Config::Method]
1592
+ #
1593
+ attr_reader :generate_initial_change_stream_partitions
1594
+ ##
1595
+ # RPC-specific configuration for `read_change_stream`
1596
+ # @return [::Gapic::Config::Method]
1597
+ #
1598
+ attr_reader :read_change_stream
1599
+ ##
1600
+ # RPC-specific configuration for `prepare_query`
1601
+ # @return [::Gapic::Config::Method]
1602
+ #
1603
+ attr_reader :prepare_query
1604
+ ##
1605
+ # RPC-specific configuration for `execute_query`
1606
+ # @return [::Gapic::Config::Method]
1607
+ #
1608
+ attr_reader :execute_query
1609
+
1610
+ # @private
1611
+ def initialize parent_rpcs = nil
1612
+ read_rows_config = parent_rpcs.read_rows if parent_rpcs.respond_to? :read_rows
1613
+ @read_rows = ::Gapic::Config::Method.new read_rows_config
1614
+ sample_row_keys_config = parent_rpcs.sample_row_keys if parent_rpcs.respond_to? :sample_row_keys
1615
+ @sample_row_keys = ::Gapic::Config::Method.new sample_row_keys_config
1616
+ mutate_row_config = parent_rpcs.mutate_row if parent_rpcs.respond_to? :mutate_row
1617
+ @mutate_row = ::Gapic::Config::Method.new mutate_row_config
1618
+ mutate_rows_config = parent_rpcs.mutate_rows if parent_rpcs.respond_to? :mutate_rows
1619
+ @mutate_rows = ::Gapic::Config::Method.new mutate_rows_config
1620
+ check_and_mutate_row_config = parent_rpcs.check_and_mutate_row if parent_rpcs.respond_to? :check_and_mutate_row
1621
+ @check_and_mutate_row = ::Gapic::Config::Method.new check_and_mutate_row_config
1622
+ ping_and_warm_config = parent_rpcs.ping_and_warm if parent_rpcs.respond_to? :ping_and_warm
1623
+ @ping_and_warm = ::Gapic::Config::Method.new ping_and_warm_config
1624
+ read_modify_write_row_config = parent_rpcs.read_modify_write_row if parent_rpcs.respond_to? :read_modify_write_row
1625
+ @read_modify_write_row = ::Gapic::Config::Method.new read_modify_write_row_config
1626
+ generate_initial_change_stream_partitions_config = parent_rpcs.generate_initial_change_stream_partitions if parent_rpcs.respond_to? :generate_initial_change_stream_partitions
1627
+ @generate_initial_change_stream_partitions = ::Gapic::Config::Method.new generate_initial_change_stream_partitions_config
1628
+ read_change_stream_config = parent_rpcs.read_change_stream if parent_rpcs.respond_to? :read_change_stream
1629
+ @read_change_stream = ::Gapic::Config::Method.new read_change_stream_config
1630
+ prepare_query_config = parent_rpcs.prepare_query if parent_rpcs.respond_to? :prepare_query
1631
+ @prepare_query = ::Gapic::Config::Method.new prepare_query_config
1632
+ execute_query_config = parent_rpcs.execute_query if parent_rpcs.respond_to? :execute_query
1633
+ @execute_query = ::Gapic::Config::Method.new execute_query_config
1634
+
1635
+ yield self if block_given?
1636
+ end
1637
+ end
1638
+ end
1639
+ end
1640
+ end
1641
+ end
1642
+ end
1643
+ end
1644
+ end
1645
+ end