google-cloud-datastore-v1 0.6.0 → 0.8.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.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +1 -1
- data/lib/google/cloud/datastore/v1/datastore/client.rb +196 -26
- data/lib/google/cloud/datastore/v1/datastore.rb +1 -1
- data/lib/google/cloud/datastore/v1/version.rb +1 -1
- data/lib/google/cloud/datastore/v1.rb +2 -2
- data/lib/google/datastore/v1/aggregation_result_pb.rb +32 -0
- data/lib/google/datastore/v1/datastore_pb.rb +24 -0
- data/lib/google/datastore/v1/datastore_services_pb.rb +2 -0
- data/lib/google/datastore/v1/entity_pb.rb +1 -0
- data/lib/google/datastore/v1/query_pb.rb +19 -0
- data/proto_docs/google/api/client.rb +318 -0
- data/proto_docs/google/api/launch_stage.rb +71 -0
- data/proto_docs/google/api/routing.rb +459 -0
- data/proto_docs/google/datastore/v1/aggregation_result.rb +73 -0
- data/proto_docs/google/datastore/v1/datastore.rb +110 -18
- data/proto_docs/google/datastore/v1/entity.rb +4 -0
- data/proto_docs/google/datastore/v1/query.rb +94 -1
- data/proto_docs/google/protobuf/duration.rb +98 -0
- metadata +11 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c45c26b4609092449a125a9c82ea164e7a8cc8ae73dc4b221879fe2aec45d13e
|
4
|
+
data.tar.gz: d0949170d61b922ecde9f8ceda24e9d169afc6949b344e91c9d536d04aa50099
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7eee514105c9d4a2e2b98d5ff9948059d4c1b52f2770e2ad57843945f7dc89b8d61b383845125d7c1a070ddc2ae51c935db270237a90f7965657da0906698a94
|
7
|
+
data.tar.gz: ea3a3d81f08b5b8d7232405bae7e7f9ae53a01842121e6363f80e030749052bc186a3ea15fe07d076272541a392f67c753b7e3ab24fd27055e3fdbeecdcc1d67
|
data/AUTHENTICATION.md
CHANGED
@@ -114,7 +114,7 @@ credentials are discovered.
|
|
114
114
|
To configure your system for this, simply:
|
115
115
|
|
116
116
|
1. [Download and install the Cloud SDK](https://cloud.google.com/sdk)
|
117
|
-
2. Authenticate using OAuth 2.0 `$ gcloud auth login`
|
117
|
+
2. Authenticate using OAuth 2.0 `$ gcloud auth application-default login`
|
118
118
|
3. Write code as if already authenticated.
|
119
119
|
|
120
120
|
**NOTE:** This is _not_ recommended for running in production. The Cloud SDK
|
data/README.md
CHANGED
@@ -46,7 +46,7 @@ for general usage information.
|
|
46
46
|
## Enabling Logging
|
47
47
|
|
48
48
|
To enable logging for this library, set the logger for the underlying [gRPC](https://github.com/grpc/grpc/tree/master/src/ruby) library.
|
49
|
-
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/
|
49
|
+
The logger that you set may be a Ruby stdlib [`Logger`](https://ruby-doc.org/current/stdlibs/logger/Logger.html) as shown below,
|
50
50
|
or a [`Google::Cloud::Logging::Logger`](https://googleapis.dev/ruby/google-cloud-logging/latest)
|
51
51
|
that will write logs to [Cloud Logging](https://cloud.google.com/logging/). See [grpc/logconfig.rb](https://github.com/grpc/grpc/blob/master/src/ruby/lib/grpc/logconfig.rb)
|
52
52
|
and the gRPC [spec_helper.rb](https://github.com/grpc/grpc/blob/master/src/ruby/spec/spec_helper.rb) for additional information.
|
@@ -77,6 +77,11 @@ module Google
|
|
77
77
|
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
78
78
|
}
|
79
79
|
|
80
|
+
default_config.rpcs.run_aggregation_query.timeout = 60.0
|
81
|
+
default_config.rpcs.run_aggregation_query.retry_policy = {
|
82
|
+
initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
|
83
|
+
}
|
84
|
+
|
80
85
|
default_config.rpcs.begin_transaction.timeout = 60.0
|
81
86
|
|
82
87
|
default_config.rpcs.commit.timeout = 60.0
|
@@ -183,13 +188,18 @@ module Google
|
|
183
188
|
# @param options [::Gapic::CallOptions, ::Hash]
|
184
189
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
185
190
|
#
|
186
|
-
# @overload lookup(project_id: nil, read_options: nil, keys: nil)
|
191
|
+
# @overload lookup(project_id: nil, database_id: nil, read_options: nil, keys: nil)
|
187
192
|
# Pass arguments to `lookup` via keyword arguments. Note that at
|
188
193
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
189
194
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
190
195
|
#
|
191
196
|
# @param project_id [::String]
|
192
197
|
# Required. The ID of the project against which to make the request.
|
198
|
+
# @param database_id [::String]
|
199
|
+
# The ID of the database against which to make the request.
|
200
|
+
#
|
201
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
202
|
+
# database.
|
193
203
|
# @param read_options [::Google::Cloud::Datastore::V1::ReadOptions, ::Hash]
|
194
204
|
# The options for this lookup request.
|
195
205
|
# @param keys [::Array<::Google::Cloud::Datastore::V1::Key, ::Hash>]
|
@@ -236,11 +246,14 @@ module Google
|
|
236
246
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
237
247
|
|
238
248
|
header_params = {}
|
239
|
-
if request.project_id
|
249
|
+
if request.project_id && !request.project_id.empty?
|
240
250
|
header_params["project_id"] = request.project_id
|
241
251
|
end
|
252
|
+
if request.database_id && !request.database_id.empty?
|
253
|
+
header_params["database_id"] = request.database_id
|
254
|
+
end
|
242
255
|
|
243
|
-
request_params_header =
|
256
|
+
request_params_header = URI.encode_www_form header_params
|
244
257
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
245
258
|
|
246
259
|
options.apply_defaults timeout: @config.rpcs.lookup.timeout,
|
@@ -272,13 +285,18 @@ module Google
|
|
272
285
|
# @param options [::Gapic::CallOptions, ::Hash]
|
273
286
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
274
287
|
#
|
275
|
-
# @overload run_query(project_id: nil, partition_id: nil, read_options: nil, query: nil, gql_query: nil)
|
288
|
+
# @overload run_query(project_id: nil, database_id: nil, partition_id: nil, read_options: nil, query: nil, gql_query: nil)
|
276
289
|
# Pass arguments to `run_query` via keyword arguments. Note that at
|
277
290
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
278
291
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
279
292
|
#
|
280
293
|
# @param project_id [::String]
|
281
294
|
# Required. The ID of the project against which to make the request.
|
295
|
+
# @param database_id [::String]
|
296
|
+
# The ID of the database against which to make the request.
|
297
|
+
#
|
298
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
299
|
+
# database.
|
282
300
|
# @param partition_id [::Google::Cloud::Datastore::V1::PartitionId, ::Hash]
|
283
301
|
# Entities are partitioned into subsets, identified by a partition ID.
|
284
302
|
# Queries are scoped to a single partition.
|
@@ -289,7 +307,7 @@ module Google
|
|
289
307
|
# @param query [::Google::Cloud::Datastore::V1::Query, ::Hash]
|
290
308
|
# The query to run.
|
291
309
|
# @param gql_query [::Google::Cloud::Datastore::V1::GqlQuery, ::Hash]
|
292
|
-
# The GQL query to run.
|
310
|
+
# The GQL query to run. This query must be a non-aggregation query.
|
293
311
|
#
|
294
312
|
# @yield [response, operation] Access the result along with the RPC operation
|
295
313
|
# @yieldparam response [::Google::Cloud::Datastore::V1::RunQueryResponse]
|
@@ -332,11 +350,14 @@ module Google
|
|
332
350
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
333
351
|
|
334
352
|
header_params = {}
|
335
|
-
if request.project_id
|
353
|
+
if request.project_id && !request.project_id.empty?
|
336
354
|
header_params["project_id"] = request.project_id
|
337
355
|
end
|
356
|
+
if request.database_id && !request.database_id.empty?
|
357
|
+
header_params["database_id"] = request.database_id
|
358
|
+
end
|
338
359
|
|
339
|
-
request_params_header =
|
360
|
+
request_params_header = URI.encode_www_form header_params
|
340
361
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
341
362
|
|
342
363
|
options.apply_defaults timeout: @config.rpcs.run_query.timeout,
|
@@ -355,6 +376,110 @@ module Google
|
|
355
376
|
raise ::Google::Cloud::Error.from_error(e)
|
356
377
|
end
|
357
378
|
|
379
|
+
##
|
380
|
+
# Runs an aggregation query.
|
381
|
+
#
|
382
|
+
# @overload run_aggregation_query(request, options = nil)
|
383
|
+
# Pass arguments to `run_aggregation_query` via a request object, either of type
|
384
|
+
# {::Google::Cloud::Datastore::V1::RunAggregationQueryRequest} or an equivalent Hash.
|
385
|
+
#
|
386
|
+
# @param request [::Google::Cloud::Datastore::V1::RunAggregationQueryRequest, ::Hash]
|
387
|
+
# A request object representing the call parameters. Required. To specify no
|
388
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
389
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
390
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
391
|
+
#
|
392
|
+
# @overload run_aggregation_query(project_id: nil, database_id: nil, partition_id: nil, read_options: nil, aggregation_query: nil, gql_query: nil)
|
393
|
+
# Pass arguments to `run_aggregation_query` via keyword arguments. Note that at
|
394
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
395
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
396
|
+
#
|
397
|
+
# @param project_id [::String]
|
398
|
+
# Required. The ID of the project against which to make the request.
|
399
|
+
# @param database_id [::String]
|
400
|
+
# The ID of the database against which to make the request.
|
401
|
+
#
|
402
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
403
|
+
# database.
|
404
|
+
# @param partition_id [::Google::Cloud::Datastore::V1::PartitionId, ::Hash]
|
405
|
+
# Entities are partitioned into subsets, identified by a partition ID.
|
406
|
+
# Queries are scoped to a single partition.
|
407
|
+
# This partition ID is normalized with the standard default context
|
408
|
+
# partition ID.
|
409
|
+
# @param read_options [::Google::Cloud::Datastore::V1::ReadOptions, ::Hash]
|
410
|
+
# The options for this query.
|
411
|
+
# @param aggregation_query [::Google::Cloud::Datastore::V1::AggregationQuery, ::Hash]
|
412
|
+
# The query to run.
|
413
|
+
# @param gql_query [::Google::Cloud::Datastore::V1::GqlQuery, ::Hash]
|
414
|
+
# The GQL query to run. This query must be an aggregation query.
|
415
|
+
#
|
416
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
417
|
+
# @yieldparam response [::Google::Cloud::Datastore::V1::RunAggregationQueryResponse]
|
418
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
419
|
+
#
|
420
|
+
# @return [::Google::Cloud::Datastore::V1::RunAggregationQueryResponse]
|
421
|
+
#
|
422
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
423
|
+
#
|
424
|
+
# @example Basic example
|
425
|
+
# require "google/cloud/datastore/v1"
|
426
|
+
#
|
427
|
+
# # Create a client object. The client can be reused for multiple calls.
|
428
|
+
# client = Google::Cloud::Datastore::V1::Datastore::Client.new
|
429
|
+
#
|
430
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
431
|
+
# request = Google::Cloud::Datastore::V1::RunAggregationQueryRequest.new
|
432
|
+
#
|
433
|
+
# # Call the run_aggregation_query method.
|
434
|
+
# result = client.run_aggregation_query request
|
435
|
+
#
|
436
|
+
# # The returned object is of type Google::Cloud::Datastore::V1::RunAggregationQueryResponse.
|
437
|
+
# p result
|
438
|
+
#
|
439
|
+
def run_aggregation_query request, options = nil
|
440
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
441
|
+
|
442
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::V1::RunAggregationQueryRequest
|
443
|
+
|
444
|
+
# Converts hash and nil to an options object
|
445
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
446
|
+
|
447
|
+
# Customize the options with defaults
|
448
|
+
metadata = @config.rpcs.run_aggregation_query.metadata.to_h
|
449
|
+
|
450
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
451
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
452
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
453
|
+
gapic_version: ::Google::Cloud::Datastore::V1::VERSION
|
454
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
455
|
+
|
456
|
+
header_params = {}
|
457
|
+
if request.project_id && !request.project_id.empty?
|
458
|
+
header_params["project_id"] = request.project_id
|
459
|
+
end
|
460
|
+
if request.database_id && !request.database_id.empty?
|
461
|
+
header_params["database_id"] = request.database_id
|
462
|
+
end
|
463
|
+
|
464
|
+
request_params_header = URI.encode_www_form header_params
|
465
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
466
|
+
|
467
|
+
options.apply_defaults timeout: @config.rpcs.run_aggregation_query.timeout,
|
468
|
+
metadata: metadata,
|
469
|
+
retry_policy: @config.rpcs.run_aggregation_query.retry_policy
|
470
|
+
|
471
|
+
options.apply_defaults timeout: @config.timeout,
|
472
|
+
metadata: @config.metadata,
|
473
|
+
retry_policy: @config.retry_policy
|
474
|
+
|
475
|
+
@datastore_stub.call_rpc :run_aggregation_query, request, options: options do |response, operation|
|
476
|
+
yield response, operation if block_given?
|
477
|
+
return response
|
478
|
+
end
|
479
|
+
rescue ::GRPC::BadStatus => e
|
480
|
+
raise ::Google::Cloud::Error.from_error(e)
|
481
|
+
end
|
482
|
+
|
358
483
|
##
|
359
484
|
# Begins a new transaction.
|
360
485
|
#
|
@@ -368,13 +493,18 @@ module Google
|
|
368
493
|
# @param options [::Gapic::CallOptions, ::Hash]
|
369
494
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
370
495
|
#
|
371
|
-
# @overload begin_transaction(project_id: nil, transaction_options: nil)
|
496
|
+
# @overload begin_transaction(project_id: nil, database_id: nil, transaction_options: nil)
|
372
497
|
# Pass arguments to `begin_transaction` via keyword arguments. Note that at
|
373
498
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
374
499
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
375
500
|
#
|
376
501
|
# @param project_id [::String]
|
377
502
|
# Required. The ID of the project against which to make the request.
|
503
|
+
# @param database_id [::String]
|
504
|
+
# The ID of the database against which to make the request.
|
505
|
+
#
|
506
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
507
|
+
# database.
|
378
508
|
# @param transaction_options [::Google::Cloud::Datastore::V1::TransactionOptions, ::Hash]
|
379
509
|
# Options for a new transaction.
|
380
510
|
#
|
@@ -419,11 +549,14 @@ module Google
|
|
419
549
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
420
550
|
|
421
551
|
header_params = {}
|
422
|
-
if request.project_id
|
552
|
+
if request.project_id && !request.project_id.empty?
|
423
553
|
header_params["project_id"] = request.project_id
|
424
554
|
end
|
555
|
+
if request.database_id && !request.database_id.empty?
|
556
|
+
header_params["database_id"] = request.database_id
|
557
|
+
end
|
425
558
|
|
426
|
-
request_params_header =
|
559
|
+
request_params_header = URI.encode_www_form header_params
|
427
560
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
428
561
|
|
429
562
|
options.apply_defaults timeout: @config.rpcs.begin_transaction.timeout,
|
@@ -456,13 +589,18 @@ module Google
|
|
456
589
|
# @param options [::Gapic::CallOptions, ::Hash]
|
457
590
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
458
591
|
#
|
459
|
-
# @overload commit(project_id: nil, mode: nil, transaction: nil, mutations: nil)
|
592
|
+
# @overload commit(project_id: nil, database_id: nil, mode: nil, transaction: nil, mutations: nil)
|
460
593
|
# Pass arguments to `commit` via keyword arguments. Note that at
|
461
594
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
462
595
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
463
596
|
#
|
464
597
|
# @param project_id [::String]
|
465
598
|
# Required. The ID of the project against which to make the request.
|
599
|
+
# @param database_id [::String]
|
600
|
+
# The ID of the database against which to make the request.
|
601
|
+
#
|
602
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
603
|
+
# database.
|
466
604
|
# @param mode [::Google::Cloud::Datastore::V1::CommitRequest::Mode]
|
467
605
|
# The type of commit to perform. Defaults to `TRANSACTIONAL`.
|
468
606
|
# @param transaction [::String]
|
@@ -525,11 +663,14 @@ module Google
|
|
525
663
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
526
664
|
|
527
665
|
header_params = {}
|
528
|
-
if request.project_id
|
666
|
+
if request.project_id && !request.project_id.empty?
|
529
667
|
header_params["project_id"] = request.project_id
|
530
668
|
end
|
669
|
+
if request.database_id && !request.database_id.empty?
|
670
|
+
header_params["database_id"] = request.database_id
|
671
|
+
end
|
531
672
|
|
532
|
-
request_params_header =
|
673
|
+
request_params_header = URI.encode_www_form header_params
|
533
674
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
534
675
|
|
535
676
|
options.apply_defaults timeout: @config.rpcs.commit.timeout,
|
@@ -561,13 +702,18 @@ module Google
|
|
561
702
|
# @param options [::Gapic::CallOptions, ::Hash]
|
562
703
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
563
704
|
#
|
564
|
-
# @overload rollback(project_id: nil, transaction: nil)
|
705
|
+
# @overload rollback(project_id: nil, database_id: nil, transaction: nil)
|
565
706
|
# Pass arguments to `rollback` via keyword arguments. Note that at
|
566
707
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
567
708
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
568
709
|
#
|
569
710
|
# @param project_id [::String]
|
570
711
|
# Required. The ID of the project against which to make the request.
|
712
|
+
# @param database_id [::String]
|
713
|
+
# The ID of the database against which to make the request.
|
714
|
+
#
|
715
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
716
|
+
# database.
|
571
717
|
# @param transaction [::String]
|
572
718
|
# Required. The transaction identifier, returned by a call to
|
573
719
|
# {::Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction Datastore.BeginTransaction}.
|
@@ -613,11 +759,14 @@ module Google
|
|
613
759
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
614
760
|
|
615
761
|
header_params = {}
|
616
|
-
if request.project_id
|
762
|
+
if request.project_id && !request.project_id.empty?
|
617
763
|
header_params["project_id"] = request.project_id
|
618
764
|
end
|
765
|
+
if request.database_id && !request.database_id.empty?
|
766
|
+
header_params["database_id"] = request.database_id
|
767
|
+
end
|
619
768
|
|
620
|
-
request_params_header =
|
769
|
+
request_params_header = URI.encode_www_form header_params
|
621
770
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
622
771
|
|
623
772
|
options.apply_defaults timeout: @config.rpcs.rollback.timeout,
|
@@ -650,16 +799,21 @@ module Google
|
|
650
799
|
# @param options [::Gapic::CallOptions, ::Hash]
|
651
800
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
652
801
|
#
|
653
|
-
# @overload allocate_ids(project_id: nil, keys: nil)
|
802
|
+
# @overload allocate_ids(project_id: nil, database_id: nil, keys: nil)
|
654
803
|
# Pass arguments to `allocate_ids` via keyword arguments. Note that at
|
655
804
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
656
805
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
657
806
|
#
|
658
807
|
# @param project_id [::String]
|
659
808
|
# Required. The ID of the project against which to make the request.
|
809
|
+
# @param database_id [::String]
|
810
|
+
# The ID of the database against which to make the request.
|
811
|
+
#
|
812
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
813
|
+
# database.
|
660
814
|
# @param keys [::Array<::Google::Cloud::Datastore::V1::Key, ::Hash>]
|
661
|
-
# Required. A list of keys with incomplete key paths for which to allocate
|
662
|
-
# No key may be reserved/read-only.
|
815
|
+
# Required. A list of keys with incomplete key paths for which to allocate
|
816
|
+
# IDs. No key may be reserved/read-only.
|
663
817
|
#
|
664
818
|
# @yield [response, operation] Access the result along with the RPC operation
|
665
819
|
# @yieldparam response [::Google::Cloud::Datastore::V1::AllocateIdsResponse]
|
@@ -702,11 +856,14 @@ module Google
|
|
702
856
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
703
857
|
|
704
858
|
header_params = {}
|
705
|
-
if request.project_id
|
859
|
+
if request.project_id && !request.project_id.empty?
|
706
860
|
header_params["project_id"] = request.project_id
|
707
861
|
end
|
862
|
+
if request.database_id && !request.database_id.empty?
|
863
|
+
header_params["database_id"] = request.database_id
|
864
|
+
end
|
708
865
|
|
709
|
-
request_params_header =
|
866
|
+
request_params_header = URI.encode_www_form header_params
|
710
867
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
711
868
|
|
712
869
|
options.apply_defaults timeout: @config.rpcs.allocate_ids.timeout,
|
@@ -747,10 +904,13 @@ module Google
|
|
747
904
|
# @param project_id [::String]
|
748
905
|
# Required. The ID of the project against which to make the request.
|
749
906
|
# @param database_id [::String]
|
750
|
-
#
|
907
|
+
# The ID of the database against which to make the request.
|
908
|
+
#
|
909
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
910
|
+
# database.
|
751
911
|
# @param keys [::Array<::Google::Cloud::Datastore::V1::Key, ::Hash>]
|
752
|
-
# Required. A list of keys with complete key paths whose numeric IDs should
|
753
|
-
# auto-allocated.
|
912
|
+
# Required. A list of keys with complete key paths whose numeric IDs should
|
913
|
+
# not be auto-allocated.
|
754
914
|
#
|
755
915
|
# @yield [response, operation] Access the result along with the RPC operation
|
756
916
|
# @yieldparam response [::Google::Cloud::Datastore::V1::ReserveIdsResponse]
|
@@ -793,11 +953,14 @@ module Google
|
|
793
953
|
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
794
954
|
|
795
955
|
header_params = {}
|
796
|
-
if request.project_id
|
956
|
+
if request.project_id && !request.project_id.empty?
|
797
957
|
header_params["project_id"] = request.project_id
|
798
958
|
end
|
959
|
+
if request.database_id && !request.database_id.empty?
|
960
|
+
header_params["database_id"] = request.database_id
|
961
|
+
end
|
799
962
|
|
800
|
-
request_params_header =
|
963
|
+
request_params_header = URI.encode_www_form header_params
|
801
964
|
metadata[:"x-goog-request-params"] ||= request_params_header
|
802
965
|
|
803
966
|
options.apply_defaults timeout: @config.rpcs.reserve_ids.timeout,
|
@@ -962,6 +1125,11 @@ module Google
|
|
962
1125
|
#
|
963
1126
|
attr_reader :run_query
|
964
1127
|
##
|
1128
|
+
# RPC-specific configuration for `run_aggregation_query`
|
1129
|
+
# @return [::Gapic::Config::Method]
|
1130
|
+
#
|
1131
|
+
attr_reader :run_aggregation_query
|
1132
|
+
##
|
965
1133
|
# RPC-specific configuration for `begin_transaction`
|
966
1134
|
# @return [::Gapic::Config::Method]
|
967
1135
|
#
|
@@ -993,6 +1161,8 @@ module Google
|
|
993
1161
|
@lookup = ::Gapic::Config::Method.new lookup_config
|
994
1162
|
run_query_config = parent_rpcs.run_query if parent_rpcs.respond_to? :run_query
|
995
1163
|
@run_query = ::Gapic::Config::Method.new run_query_config
|
1164
|
+
run_aggregation_query_config = parent_rpcs.run_aggregation_query if parent_rpcs.respond_to? :run_aggregation_query
|
1165
|
+
@run_aggregation_query = ::Gapic::Config::Method.new run_aggregation_query_config
|
996
1166
|
begin_transaction_config = parent_rpcs.begin_transaction if parent_rpcs.respond_to? :begin_transaction
|
997
1167
|
@begin_transaction = ::Gapic::Config::Method.new begin_transaction_config
|
998
1168
|
commit_config = parent_rpcs.commit if parent_rpcs.respond_to? :commit
|
@@ -37,7 +37,7 @@ module Google
|
|
37
37
|
# input keys sets the project ID (if not already set) to the project ID from
|
38
38
|
# the request.
|
39
39
|
#
|
40
|
-
#
|
40
|
+
# @example Load this service and instantiate a gRPC client
|
41
41
|
#
|
42
42
|
# require "google/cloud/datastore/v1/datastore"
|
43
43
|
# client = ::Google::Cloud::Datastore::V1::Datastore::Client.new
|
@@ -23,9 +23,9 @@ module Google
|
|
23
23
|
module Cloud
|
24
24
|
module Datastore
|
25
25
|
##
|
26
|
-
#
|
26
|
+
# API client module.
|
27
27
|
#
|
28
|
-
# @example
|
28
|
+
# @example Load this package, including all its services, and instantiate a gRPC client
|
29
29
|
#
|
30
30
|
# require "google/cloud/datastore/v1"
|
31
31
|
# client = ::Google::Cloud::Datastore::V1::Datastore::Client.new
|
@@ -0,0 +1,32 @@
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
|
+
# source: google/datastore/v1/aggregation_result.proto
|
3
|
+
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/datastore/v1/entity_pb'
|
7
|
+
require 'google/datastore/v1/query_pb'
|
8
|
+
require 'google/protobuf/timestamp_pb'
|
9
|
+
|
10
|
+
Google::Protobuf::DescriptorPool.generated_pool.build do
|
11
|
+
add_file("google/datastore/v1/aggregation_result.proto", :syntax => :proto3) do
|
12
|
+
add_message "google.datastore.v1.AggregationResult" do
|
13
|
+
map :aggregate_properties, :string, :message, 2, "google.datastore.v1.Value"
|
14
|
+
end
|
15
|
+
add_message "google.datastore.v1.AggregationResultBatch" do
|
16
|
+
repeated :aggregation_results, :message, 1, "google.datastore.v1.AggregationResult"
|
17
|
+
optional :more_results, :enum, 2, "google.datastore.v1.QueryResultBatch.MoreResultsType"
|
18
|
+
optional :read_time, :message, 3, "google.protobuf.Timestamp"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
module Google
|
24
|
+
module Cloud
|
25
|
+
module Datastore
|
26
|
+
module V1
|
27
|
+
AggregationResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AggregationResult").msgclass
|
28
|
+
AggregationResultBatch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AggregationResultBatch").msgclass
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -6,6 +6,8 @@ require 'google/protobuf'
|
|
6
6
|
require 'google/api/annotations_pb'
|
7
7
|
require 'google/api/client_pb'
|
8
8
|
require 'google/api/field_behavior_pb'
|
9
|
+
require 'google/api/routing_pb'
|
10
|
+
require 'google/datastore/v1/aggregation_result_pb'
|
9
11
|
require 'google/datastore/v1/entity_pb'
|
10
12
|
require 'google/datastore/v1/query_pb'
|
11
13
|
require 'google/protobuf/timestamp_pb'
|
@@ -14,6 +16,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
14
16
|
add_file("google/datastore/v1/datastore.proto", :syntax => :proto3) do
|
15
17
|
add_message "google.datastore.v1.LookupRequest" do
|
16
18
|
optional :project_id, :string, 8
|
19
|
+
optional :database_id, :string, 9
|
17
20
|
optional :read_options, :message, 1, "google.datastore.v1.ReadOptions"
|
18
21
|
repeated :keys, :message, 3, "google.datastore.v1.Key"
|
19
22
|
end
|
@@ -25,6 +28,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
25
28
|
end
|
26
29
|
add_message "google.datastore.v1.RunQueryRequest" do
|
27
30
|
optional :project_id, :string, 8
|
31
|
+
optional :database_id, :string, 9
|
28
32
|
optional :partition_id, :message, 2, "google.datastore.v1.PartitionId"
|
29
33
|
optional :read_options, :message, 1, "google.datastore.v1.ReadOptions"
|
30
34
|
oneof :query_type do
|
@@ -36,8 +40,23 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
36
40
|
optional :batch, :message, 1, "google.datastore.v1.QueryResultBatch"
|
37
41
|
optional :query, :message, 2, "google.datastore.v1.Query"
|
38
42
|
end
|
43
|
+
add_message "google.datastore.v1.RunAggregationQueryRequest" do
|
44
|
+
optional :project_id, :string, 8
|
45
|
+
optional :database_id, :string, 9
|
46
|
+
optional :partition_id, :message, 2, "google.datastore.v1.PartitionId"
|
47
|
+
optional :read_options, :message, 1, "google.datastore.v1.ReadOptions"
|
48
|
+
oneof :query_type do
|
49
|
+
optional :aggregation_query, :message, 3, "google.datastore.v1.AggregationQuery"
|
50
|
+
optional :gql_query, :message, 7, "google.datastore.v1.GqlQuery"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
add_message "google.datastore.v1.RunAggregationQueryResponse" do
|
54
|
+
optional :batch, :message, 1, "google.datastore.v1.AggregationResultBatch"
|
55
|
+
optional :query, :message, 2, "google.datastore.v1.AggregationQuery"
|
56
|
+
end
|
39
57
|
add_message "google.datastore.v1.BeginTransactionRequest" do
|
40
58
|
optional :project_id, :string, 8
|
59
|
+
optional :database_id, :string, 9
|
41
60
|
optional :transaction_options, :message, 10, "google.datastore.v1.TransactionOptions"
|
42
61
|
end
|
43
62
|
add_message "google.datastore.v1.BeginTransactionResponse" do
|
@@ -45,12 +64,14 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
45
64
|
end
|
46
65
|
add_message "google.datastore.v1.RollbackRequest" do
|
47
66
|
optional :project_id, :string, 8
|
67
|
+
optional :database_id, :string, 9
|
48
68
|
optional :transaction, :bytes, 1
|
49
69
|
end
|
50
70
|
add_message "google.datastore.v1.RollbackResponse" do
|
51
71
|
end
|
52
72
|
add_message "google.datastore.v1.CommitRequest" do
|
53
73
|
optional :project_id, :string, 8
|
74
|
+
optional :database_id, :string, 9
|
54
75
|
optional :mode, :enum, 5, "google.datastore.v1.CommitRequest.Mode"
|
55
76
|
repeated :mutations, :message, 6, "google.datastore.v1.Mutation"
|
56
77
|
oneof :transaction_selector do
|
@@ -69,6 +90,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
69
90
|
end
|
70
91
|
add_message "google.datastore.v1.AllocateIdsRequest" do
|
71
92
|
optional :project_id, :string, 8
|
93
|
+
optional :database_id, :string, 9
|
72
94
|
repeated :keys, :message, 1, "google.datastore.v1.Key"
|
73
95
|
end
|
74
96
|
add_message "google.datastore.v1.AllocateIdsResponse" do
|
@@ -134,6 +156,8 @@ module Google
|
|
134
156
|
LookupResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.LookupResponse").msgclass
|
135
157
|
RunQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RunQueryRequest").msgclass
|
136
158
|
RunQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RunQueryResponse").msgclass
|
159
|
+
RunAggregationQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RunAggregationQueryRequest").msgclass
|
160
|
+
RunAggregationQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RunAggregationQueryResponse").msgclass
|
137
161
|
BeginTransactionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.BeginTransactionRequest").msgclass
|
138
162
|
BeginTransactionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.BeginTransactionResponse").msgclass
|
139
163
|
RollbackRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RollbackRequest").msgclass
|
@@ -43,6 +43,8 @@ module Google
|
|
43
43
|
rpc :Lookup, ::Google::Cloud::Datastore::V1::LookupRequest, ::Google::Cloud::Datastore::V1::LookupResponse
|
44
44
|
# Queries for entities.
|
45
45
|
rpc :RunQuery, ::Google::Cloud::Datastore::V1::RunQueryRequest, ::Google::Cloud::Datastore::V1::RunQueryResponse
|
46
|
+
# Runs an aggregation query.
|
47
|
+
rpc :RunAggregationQuery, ::Google::Cloud::Datastore::V1::RunAggregationQueryRequest, ::Google::Cloud::Datastore::V1::RunAggregationQueryResponse
|
46
48
|
# Begins a new transaction.
|
47
49
|
rpc :BeginTransaction, ::Google::Cloud::Datastore::V1::BeginTransactionRequest, ::Google::Cloud::Datastore::V1::BeginTransactionResponse
|
48
50
|
# Commits a transaction, optionally creating, deleting or modifying some
|
@@ -11,6 +11,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
11
11
|
add_file("google/datastore/v1/entity.proto", :syntax => :proto3) do
|
12
12
|
add_message "google.datastore.v1.PartitionId" do
|
13
13
|
optional :project_id, :string, 2
|
14
|
+
optional :database_id, :string, 3
|
14
15
|
optional :namespace_id, :string, 4
|
15
16
|
end
|
16
17
|
add_message "google.datastore.v1.Key" do
|
@@ -3,6 +3,7 @@
|
|
3
3
|
|
4
4
|
require 'google/protobuf'
|
5
5
|
|
6
|
+
require 'google/api/field_behavior_pb'
|
6
7
|
require 'google/datastore/v1/entity_pb'
|
7
8
|
require 'google/protobuf/timestamp_pb'
|
8
9
|
require 'google/protobuf/wrappers_pb'
|
@@ -32,6 +33,21 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
32
33
|
optional :offset, :int32, 10
|
33
34
|
optional :limit, :message, 12, "google.protobuf.Int32Value"
|
34
35
|
end
|
36
|
+
add_message "google.datastore.v1.AggregationQuery" do
|
37
|
+
repeated :aggregations, :message, 3, "google.datastore.v1.AggregationQuery.Aggregation"
|
38
|
+
oneof :query_type do
|
39
|
+
optional :nested_query, :message, 1, "google.datastore.v1.Query"
|
40
|
+
end
|
41
|
+
end
|
42
|
+
add_message "google.datastore.v1.AggregationQuery.Aggregation" do
|
43
|
+
optional :alias, :string, 7
|
44
|
+
oneof :operator do
|
45
|
+
optional :count, :message, 1, "google.datastore.v1.AggregationQuery.Aggregation.Count"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
add_message "google.datastore.v1.AggregationQuery.Aggregation.Count" do
|
49
|
+
optional :up_to, :message, 1, "google.protobuf.Int64Value"
|
50
|
+
end
|
35
51
|
add_message "google.datastore.v1.KindExpression" do
|
36
52
|
optional :name, :string, 1
|
37
53
|
end
|
@@ -120,6 +136,9 @@ module Google
|
|
120
136
|
EntityResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.EntityResult").msgclass
|
121
137
|
EntityResult::ResultType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.EntityResult.ResultType").enummodule
|
122
138
|
Query = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Query").msgclass
|
139
|
+
AggregationQuery = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AggregationQuery").msgclass
|
140
|
+
AggregationQuery::Aggregation = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AggregationQuery.Aggregation").msgclass
|
141
|
+
AggregationQuery::Aggregation::Count = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.AggregationQuery.Aggregation.Count").msgclass
|
123
142
|
KindExpression = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.KindExpression").msgclass
|
124
143
|
PropertyReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyReference").msgclass
|
125
144
|
Projection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Projection").msgclass
|