google-cloud-datastore-v1 0.5.0 → 0.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/AUTHENTICATION.md +1 -1
- data/README.md +10 -5
- data/lib/google/cloud/datastore/v1/datastore/client.rb +154 -8
- data/lib/google/cloud/datastore/v1/version.rb +1 -1
- data/lib/google/datastore/v1/aggregation_result_pb.rb +32 -0
- data/lib/google/datastore/v1/datastore_pb.rb +25 -1
- data/lib/google/datastore/v1/datastore_services_pb.rb +2 -0
- data/lib/google/datastore/v1/entity_pb.rb +3 -1
- data/lib/google/datastore/v1/query_pb.rb +21 -1
- data/proto_docs/google/datastore/v1/aggregation_result.rb +73 -0
- data/proto_docs/google/datastore/v1/datastore.rb +83 -3
- data/proto_docs/google/datastore/v1/entity.rb +15 -0
- data/proto_docs/google/datastore/v1/query.rb +94 -1
- data/proto_docs/google/protobuf/struct.rb +2 -2
- metadata +14 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9037ce9b9a83196dc252e29b5210dd7aa5e36c75e9015e5cd685ffa66b4a8294
|
4
|
+
data.tar.gz: 932f181b9b2726f89ffa2f59c2b6de3f8d39608c17900ea64cb6ad7a05b24cee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc98b055ee9214faa13ff29a42fabad5857d8c2b50e7ca76d85d251db574ed5a95a6fc34e39dd9920351dccfa9b2637c0886d66a29a6abf51ca49266def389a6
|
7
|
+
data.tar.gz: 962be531e28ceae5ca7c621c68b5ec0e2c33a89d3128ad649d14472cb1af02b8abec6978e912d8f0d4d11928542d8dd161239c693902965a1ae7d14d03b4251f
|
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
@@ -69,16 +69,21 @@ module GRPC
|
|
69
69
|
end
|
70
70
|
```
|
71
71
|
|
72
|
+
|
73
|
+
## Google Cloud Samples
|
74
|
+
|
75
|
+
To browse ready to use code samples check [Google Cloud Samples](https://cloud.google.com/docs/samples).
|
76
|
+
|
72
77
|
## Supported Ruby Versions
|
73
78
|
|
74
|
-
This library is supported on Ruby 2.
|
79
|
+
This library is supported on Ruby 2.6+.
|
75
80
|
|
76
81
|
Google provides official support for Ruby versions that are actively supported
|
77
82
|
by Ruby Core—that is, Ruby versions that are either in normal maintenance or
|
78
|
-
in security maintenance, and not end of life.
|
79
|
-
|
80
|
-
|
81
|
-
|
83
|
+
in security maintenance, and not end of life. Older versions of Ruby _may_
|
84
|
+
still work, but are unsupported and not recommended. See
|
85
|
+
https://www.ruby-lang.org/en/downloads/branches/ for details about the Ruby
|
86
|
+
support schedule.
|
82
87
|
|
83
88
|
## Which client should I use?
|
84
89
|
|
@@ -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>]
|
@@ -272,13 +282,18 @@ module Google
|
|
272
282
|
# @param options [::Gapic::CallOptions, ::Hash]
|
273
283
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
274
284
|
#
|
275
|
-
# @overload run_query(project_id: nil, partition_id: nil, read_options: nil, query: nil, gql_query: nil)
|
285
|
+
# @overload run_query(project_id: nil, database_id: nil, partition_id: nil, read_options: nil, query: nil, gql_query: nil)
|
276
286
|
# Pass arguments to `run_query` via keyword arguments. Note that at
|
277
287
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
278
288
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
279
289
|
#
|
280
290
|
# @param project_id [::String]
|
281
291
|
# Required. The ID of the project against which to make the request.
|
292
|
+
# @param database_id [::String]
|
293
|
+
# The ID of the database against which to make the request.
|
294
|
+
#
|
295
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
296
|
+
# database.
|
282
297
|
# @param partition_id [::Google::Cloud::Datastore::V1::PartitionId, ::Hash]
|
283
298
|
# Entities are partitioned into subsets, identified by a partition ID.
|
284
299
|
# Queries are scoped to a single partition.
|
@@ -289,7 +304,7 @@ module Google
|
|
289
304
|
# @param query [::Google::Cloud::Datastore::V1::Query, ::Hash]
|
290
305
|
# The query to run.
|
291
306
|
# @param gql_query [::Google::Cloud::Datastore::V1::GqlQuery, ::Hash]
|
292
|
-
# The GQL query to run.
|
307
|
+
# The GQL query to run. This query must be a non-aggregation query.
|
293
308
|
#
|
294
309
|
# @yield [response, operation] Access the result along with the RPC operation
|
295
310
|
# @yieldparam response [::Google::Cloud::Datastore::V1::RunQueryResponse]
|
@@ -355,6 +370,107 @@ module Google
|
|
355
370
|
raise ::Google::Cloud::Error.from_error(e)
|
356
371
|
end
|
357
372
|
|
373
|
+
##
|
374
|
+
# Runs an aggregation query.
|
375
|
+
#
|
376
|
+
# @overload run_aggregation_query(request, options = nil)
|
377
|
+
# Pass arguments to `run_aggregation_query` via a request object, either of type
|
378
|
+
# {::Google::Cloud::Datastore::V1::RunAggregationQueryRequest} or an equivalent Hash.
|
379
|
+
#
|
380
|
+
# @param request [::Google::Cloud::Datastore::V1::RunAggregationQueryRequest, ::Hash]
|
381
|
+
# A request object representing the call parameters. Required. To specify no
|
382
|
+
# parameters, or to keep all the default parameter values, pass an empty Hash.
|
383
|
+
# @param options [::Gapic::CallOptions, ::Hash]
|
384
|
+
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
385
|
+
#
|
386
|
+
# @overload run_aggregation_query(project_id: nil, database_id: nil, partition_id: nil, read_options: nil, aggregation_query: nil, gql_query: nil)
|
387
|
+
# Pass arguments to `run_aggregation_query` via keyword arguments. Note that at
|
388
|
+
# least one keyword argument is required. To specify no parameters, or to keep all
|
389
|
+
# the default parameter values, pass an empty Hash as a request object (see above).
|
390
|
+
#
|
391
|
+
# @param project_id [::String]
|
392
|
+
# Required. The ID of the project against which to make the request.
|
393
|
+
# @param database_id [::String]
|
394
|
+
# The ID of the database against which to make the request.
|
395
|
+
#
|
396
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
397
|
+
# database.
|
398
|
+
# @param partition_id [::Google::Cloud::Datastore::V1::PartitionId, ::Hash]
|
399
|
+
# Entities are partitioned into subsets, identified by a partition ID.
|
400
|
+
# Queries are scoped to a single partition.
|
401
|
+
# This partition ID is normalized with the standard default context
|
402
|
+
# partition ID.
|
403
|
+
# @param read_options [::Google::Cloud::Datastore::V1::ReadOptions, ::Hash]
|
404
|
+
# The options for this query.
|
405
|
+
# @param aggregation_query [::Google::Cloud::Datastore::V1::AggregationQuery, ::Hash]
|
406
|
+
# The query to run.
|
407
|
+
# @param gql_query [::Google::Cloud::Datastore::V1::GqlQuery, ::Hash]
|
408
|
+
# The GQL query to run. This query must be an aggregation query.
|
409
|
+
#
|
410
|
+
# @yield [response, operation] Access the result along with the RPC operation
|
411
|
+
# @yieldparam response [::Google::Cloud::Datastore::V1::RunAggregationQueryResponse]
|
412
|
+
# @yieldparam operation [::GRPC::ActiveCall::Operation]
|
413
|
+
#
|
414
|
+
# @return [::Google::Cloud::Datastore::V1::RunAggregationQueryResponse]
|
415
|
+
#
|
416
|
+
# @raise [::Google::Cloud::Error] if the RPC is aborted.
|
417
|
+
#
|
418
|
+
# @example Basic example
|
419
|
+
# require "google/cloud/datastore/v1"
|
420
|
+
#
|
421
|
+
# # Create a client object. The client can be reused for multiple calls.
|
422
|
+
# client = Google::Cloud::Datastore::V1::Datastore::Client.new
|
423
|
+
#
|
424
|
+
# # Create a request. To set request fields, pass in keyword arguments.
|
425
|
+
# request = Google::Cloud::Datastore::V1::RunAggregationQueryRequest.new
|
426
|
+
#
|
427
|
+
# # Call the run_aggregation_query method.
|
428
|
+
# result = client.run_aggregation_query request
|
429
|
+
#
|
430
|
+
# # The returned object is of type Google::Cloud::Datastore::V1::RunAggregationQueryResponse.
|
431
|
+
# p result
|
432
|
+
#
|
433
|
+
def run_aggregation_query request, options = nil
|
434
|
+
raise ::ArgumentError, "request must be provided" if request.nil?
|
435
|
+
|
436
|
+
request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Datastore::V1::RunAggregationQueryRequest
|
437
|
+
|
438
|
+
# Converts hash and nil to an options object
|
439
|
+
options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
|
440
|
+
|
441
|
+
# Customize the options with defaults
|
442
|
+
metadata = @config.rpcs.run_aggregation_query.metadata.to_h
|
443
|
+
|
444
|
+
# Set x-goog-api-client and x-goog-user-project headers
|
445
|
+
metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
|
446
|
+
lib_name: @config.lib_name, lib_version: @config.lib_version,
|
447
|
+
gapic_version: ::Google::Cloud::Datastore::V1::VERSION
|
448
|
+
metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
|
449
|
+
|
450
|
+
header_params = {}
|
451
|
+
if request.project_id
|
452
|
+
header_params["project_id"] = request.project_id
|
453
|
+
end
|
454
|
+
|
455
|
+
request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
|
456
|
+
metadata[:"x-goog-request-params"] ||= request_params_header
|
457
|
+
|
458
|
+
options.apply_defaults timeout: @config.rpcs.run_aggregation_query.timeout,
|
459
|
+
metadata: metadata,
|
460
|
+
retry_policy: @config.rpcs.run_aggregation_query.retry_policy
|
461
|
+
|
462
|
+
options.apply_defaults timeout: @config.timeout,
|
463
|
+
metadata: @config.metadata,
|
464
|
+
retry_policy: @config.retry_policy
|
465
|
+
|
466
|
+
@datastore_stub.call_rpc :run_aggregation_query, request, options: options do |response, operation|
|
467
|
+
yield response, operation if block_given?
|
468
|
+
return response
|
469
|
+
end
|
470
|
+
rescue ::GRPC::BadStatus => e
|
471
|
+
raise ::Google::Cloud::Error.from_error(e)
|
472
|
+
end
|
473
|
+
|
358
474
|
##
|
359
475
|
# Begins a new transaction.
|
360
476
|
#
|
@@ -368,13 +484,18 @@ module Google
|
|
368
484
|
# @param options [::Gapic::CallOptions, ::Hash]
|
369
485
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
370
486
|
#
|
371
|
-
# @overload begin_transaction(project_id: nil, transaction_options: nil)
|
487
|
+
# @overload begin_transaction(project_id: nil, database_id: nil, transaction_options: nil)
|
372
488
|
# Pass arguments to `begin_transaction` via keyword arguments. Note that at
|
373
489
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
374
490
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
375
491
|
#
|
376
492
|
# @param project_id [::String]
|
377
493
|
# Required. The ID of the project against which to make the request.
|
494
|
+
# @param database_id [::String]
|
495
|
+
# The ID of the database against which to make the request.
|
496
|
+
#
|
497
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
498
|
+
# database.
|
378
499
|
# @param transaction_options [::Google::Cloud::Datastore::V1::TransactionOptions, ::Hash]
|
379
500
|
# Options for a new transaction.
|
380
501
|
#
|
@@ -456,13 +577,18 @@ module Google
|
|
456
577
|
# @param options [::Gapic::CallOptions, ::Hash]
|
457
578
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
458
579
|
#
|
459
|
-
# @overload commit(project_id: nil, mode: nil, transaction: nil, mutations: nil)
|
580
|
+
# @overload commit(project_id: nil, database_id: nil, mode: nil, transaction: nil, mutations: nil)
|
460
581
|
# Pass arguments to `commit` via keyword arguments. Note that at
|
461
582
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
462
583
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
463
584
|
#
|
464
585
|
# @param project_id [::String]
|
465
586
|
# Required. The ID of the project against which to make the request.
|
587
|
+
# @param database_id [::String]
|
588
|
+
# The ID of the database against which to make the request.
|
589
|
+
#
|
590
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
591
|
+
# database.
|
466
592
|
# @param mode [::Google::Cloud::Datastore::V1::CommitRequest::Mode]
|
467
593
|
# The type of commit to perform. Defaults to `TRANSACTIONAL`.
|
468
594
|
# @param transaction [::String]
|
@@ -561,13 +687,18 @@ module Google
|
|
561
687
|
# @param options [::Gapic::CallOptions, ::Hash]
|
562
688
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
563
689
|
#
|
564
|
-
# @overload rollback(project_id: nil, transaction: nil)
|
690
|
+
# @overload rollback(project_id: nil, database_id: nil, transaction: nil)
|
565
691
|
# Pass arguments to `rollback` via keyword arguments. Note that at
|
566
692
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
567
693
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
568
694
|
#
|
569
695
|
# @param project_id [::String]
|
570
696
|
# Required. The ID of the project against which to make the request.
|
697
|
+
# @param database_id [::String]
|
698
|
+
# The ID of the database against which to make the request.
|
699
|
+
#
|
700
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
701
|
+
# database.
|
571
702
|
# @param transaction [::String]
|
572
703
|
# Required. The transaction identifier, returned by a call to
|
573
704
|
# {::Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction Datastore.BeginTransaction}.
|
@@ -650,13 +781,18 @@ module Google
|
|
650
781
|
# @param options [::Gapic::CallOptions, ::Hash]
|
651
782
|
# Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
|
652
783
|
#
|
653
|
-
# @overload allocate_ids(project_id: nil, keys: nil)
|
784
|
+
# @overload allocate_ids(project_id: nil, database_id: nil, keys: nil)
|
654
785
|
# Pass arguments to `allocate_ids` via keyword arguments. Note that at
|
655
786
|
# least one keyword argument is required. To specify no parameters, or to keep all
|
656
787
|
# the default parameter values, pass an empty Hash as a request object (see above).
|
657
788
|
#
|
658
789
|
# @param project_id [::String]
|
659
790
|
# Required. The ID of the project against which to make the request.
|
791
|
+
# @param database_id [::String]
|
792
|
+
# The ID of the database against which to make the request.
|
793
|
+
#
|
794
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
795
|
+
# database.
|
660
796
|
# @param keys [::Array<::Google::Cloud::Datastore::V1::Key, ::Hash>]
|
661
797
|
# Required. A list of keys with incomplete key paths for which to allocate IDs.
|
662
798
|
# No key may be reserved/read-only.
|
@@ -747,7 +883,10 @@ module Google
|
|
747
883
|
# @param project_id [::String]
|
748
884
|
# Required. The ID of the project against which to make the request.
|
749
885
|
# @param database_id [::String]
|
750
|
-
#
|
886
|
+
# The ID of the database against which to make the request.
|
887
|
+
#
|
888
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
889
|
+
# database.
|
751
890
|
# @param keys [::Array<::Google::Cloud::Datastore::V1::Key, ::Hash>]
|
752
891
|
# Required. A list of keys with complete key paths whose numeric IDs should not be
|
753
892
|
# auto-allocated.
|
@@ -962,6 +1101,11 @@ module Google
|
|
962
1101
|
#
|
963
1102
|
attr_reader :run_query
|
964
1103
|
##
|
1104
|
+
# RPC-specific configuration for `run_aggregation_query`
|
1105
|
+
# @return [::Gapic::Config::Method]
|
1106
|
+
#
|
1107
|
+
attr_reader :run_aggregation_query
|
1108
|
+
##
|
965
1109
|
# RPC-specific configuration for `begin_transaction`
|
966
1110
|
# @return [::Gapic::Config::Method]
|
967
1111
|
#
|
@@ -993,6 +1137,8 @@ module Google
|
|
993
1137
|
@lookup = ::Gapic::Config::Method.new lookup_config
|
994
1138
|
run_query_config = parent_rpcs.run_query if parent_rpcs.respond_to? :run_query
|
995
1139
|
@run_query = ::Gapic::Config::Method.new run_query_config
|
1140
|
+
run_aggregation_query_config = parent_rpcs.run_aggregation_query if parent_rpcs.respond_to? :run_aggregation_query
|
1141
|
+
@run_aggregation_query = ::Gapic::Config::Method.new run_aggregation_query_config
|
996
1142
|
begin_transaction_config = parent_rpcs.begin_transaction if parent_rpcs.respond_to? :begin_transaction
|
997
1143
|
@begin_transaction = ::Gapic::Config::Method.new begin_transaction_config
|
998
1144
|
commit_config = parent_rpcs.commit if parent_rpcs.respond_to? :commit
|
@@ -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
|
@@ -1,18 +1,21 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# source: google/datastore/v1/datastore.proto
|
3
3
|
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
4
6
|
require 'google/api/annotations_pb'
|
5
7
|
require 'google/api/client_pb'
|
6
8
|
require 'google/api/field_behavior_pb'
|
9
|
+
require 'google/datastore/v1/aggregation_result_pb'
|
7
10
|
require 'google/datastore/v1/entity_pb'
|
8
11
|
require 'google/datastore/v1/query_pb'
|
9
12
|
require 'google/protobuf/timestamp_pb'
|
10
|
-
require 'google/protobuf'
|
11
13
|
|
12
14
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
13
15
|
add_file("google/datastore/v1/datastore.proto", :syntax => :proto3) do
|
14
16
|
add_message "google.datastore.v1.LookupRequest" do
|
15
17
|
optional :project_id, :string, 8
|
18
|
+
optional :database_id, :string, 9
|
16
19
|
optional :read_options, :message, 1, "google.datastore.v1.ReadOptions"
|
17
20
|
repeated :keys, :message, 3, "google.datastore.v1.Key"
|
18
21
|
end
|
@@ -24,6 +27,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
24
27
|
end
|
25
28
|
add_message "google.datastore.v1.RunQueryRequest" do
|
26
29
|
optional :project_id, :string, 8
|
30
|
+
optional :database_id, :string, 9
|
27
31
|
optional :partition_id, :message, 2, "google.datastore.v1.PartitionId"
|
28
32
|
optional :read_options, :message, 1, "google.datastore.v1.ReadOptions"
|
29
33
|
oneof :query_type do
|
@@ -35,8 +39,23 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
35
39
|
optional :batch, :message, 1, "google.datastore.v1.QueryResultBatch"
|
36
40
|
optional :query, :message, 2, "google.datastore.v1.Query"
|
37
41
|
end
|
42
|
+
add_message "google.datastore.v1.RunAggregationQueryRequest" do
|
43
|
+
optional :project_id, :string, 8
|
44
|
+
optional :database_id, :string, 9
|
45
|
+
optional :partition_id, :message, 2, "google.datastore.v1.PartitionId"
|
46
|
+
optional :read_options, :message, 1, "google.datastore.v1.ReadOptions"
|
47
|
+
oneof :query_type do
|
48
|
+
optional :aggregation_query, :message, 3, "google.datastore.v1.AggregationQuery"
|
49
|
+
optional :gql_query, :message, 7, "google.datastore.v1.GqlQuery"
|
50
|
+
end
|
51
|
+
end
|
52
|
+
add_message "google.datastore.v1.RunAggregationQueryResponse" do
|
53
|
+
optional :batch, :message, 1, "google.datastore.v1.AggregationResultBatch"
|
54
|
+
optional :query, :message, 2, "google.datastore.v1.AggregationQuery"
|
55
|
+
end
|
38
56
|
add_message "google.datastore.v1.BeginTransactionRequest" do
|
39
57
|
optional :project_id, :string, 8
|
58
|
+
optional :database_id, :string, 9
|
40
59
|
optional :transaction_options, :message, 10, "google.datastore.v1.TransactionOptions"
|
41
60
|
end
|
42
61
|
add_message "google.datastore.v1.BeginTransactionResponse" do
|
@@ -44,12 +63,14 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
44
63
|
end
|
45
64
|
add_message "google.datastore.v1.RollbackRequest" do
|
46
65
|
optional :project_id, :string, 8
|
66
|
+
optional :database_id, :string, 9
|
47
67
|
optional :transaction, :bytes, 1
|
48
68
|
end
|
49
69
|
add_message "google.datastore.v1.RollbackResponse" do
|
50
70
|
end
|
51
71
|
add_message "google.datastore.v1.CommitRequest" do
|
52
72
|
optional :project_id, :string, 8
|
73
|
+
optional :database_id, :string, 9
|
53
74
|
optional :mode, :enum, 5, "google.datastore.v1.CommitRequest.Mode"
|
54
75
|
repeated :mutations, :message, 6, "google.datastore.v1.Mutation"
|
55
76
|
oneof :transaction_selector do
|
@@ -68,6 +89,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
68
89
|
end
|
69
90
|
add_message "google.datastore.v1.AllocateIdsRequest" do
|
70
91
|
optional :project_id, :string, 8
|
92
|
+
optional :database_id, :string, 9
|
71
93
|
repeated :keys, :message, 1, "google.datastore.v1.Key"
|
72
94
|
end
|
73
95
|
add_message "google.datastore.v1.AllocateIdsResponse" do
|
@@ -133,6 +155,8 @@ module Google
|
|
133
155
|
LookupResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.LookupResponse").msgclass
|
134
156
|
RunQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RunQueryRequest").msgclass
|
135
157
|
RunQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RunQueryResponse").msgclass
|
158
|
+
RunAggregationQueryRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RunAggregationQueryRequest").msgclass
|
159
|
+
RunAggregationQueryResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.RunAggregationQueryResponse").msgclass
|
136
160
|
BeginTransactionRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.BeginTransactionRequest").msgclass
|
137
161
|
BeginTransactionResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.BeginTransactionResponse").msgclass
|
138
162
|
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
|
@@ -1,15 +1,17 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# source: google/datastore/v1/entity.proto
|
3
3
|
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
4
6
|
require 'google/protobuf/struct_pb'
|
5
7
|
require 'google/protobuf/timestamp_pb'
|
6
8
|
require 'google/type/latlng_pb'
|
7
|
-
require 'google/protobuf'
|
8
9
|
|
9
10
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
10
11
|
add_file("google/datastore/v1/entity.proto", :syntax => :proto3) do
|
11
12
|
add_message "google.datastore.v1.PartitionId" do
|
12
13
|
optional :project_id, :string, 2
|
14
|
+
optional :database_id, :string, 3
|
13
15
|
optional :namespace_id, :string, 4
|
14
16
|
end
|
15
17
|
add_message "google.datastore.v1.Key" do
|
@@ -1,10 +1,12 @@
|
|
1
1
|
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
2
2
|
# source: google/datastore/v1/query.proto
|
3
3
|
|
4
|
+
require 'google/protobuf'
|
5
|
+
|
6
|
+
require 'google/api/field_behavior_pb'
|
4
7
|
require 'google/datastore/v1/entity_pb'
|
5
8
|
require 'google/protobuf/timestamp_pb'
|
6
9
|
require 'google/protobuf/wrappers_pb'
|
7
|
-
require 'google/protobuf'
|
8
10
|
|
9
11
|
Google::Protobuf::DescriptorPool.generated_pool.build do
|
10
12
|
add_file("google/datastore/v1/query.proto", :syntax => :proto3) do
|
@@ -31,6 +33,21 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
|
|
31
33
|
optional :offset, :int32, 10
|
32
34
|
optional :limit, :message, 12, "google.protobuf.Int32Value"
|
33
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
|
34
51
|
add_message "google.datastore.v1.KindExpression" do
|
35
52
|
optional :name, :string, 1
|
36
53
|
end
|
@@ -119,6 +136,9 @@ module Google
|
|
119
136
|
EntityResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.EntityResult").msgclass
|
120
137
|
EntityResult::ResultType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.EntityResult.ResultType").enummodule
|
121
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
|
122
142
|
KindExpression = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.KindExpression").msgclass
|
123
143
|
PropertyReference = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.PropertyReference").msgclass
|
124
144
|
Projection = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.v1.Projection").msgclass
|
@@ -0,0 +1,73 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
# Copyright 2022 Google LLC
|
4
|
+
#
|
5
|
+
# Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
# you may not use this file except in compliance with the License.
|
7
|
+
# You may obtain a copy of the License at
|
8
|
+
#
|
9
|
+
# https://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
#
|
11
|
+
# Unless required by applicable law or agreed to in writing, software
|
12
|
+
# distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
# See the License for the specific language governing permissions and
|
15
|
+
# limitations under the License.
|
16
|
+
|
17
|
+
# Auto-generated by gapic-generator-ruby. DO NOT EDIT!
|
18
|
+
|
19
|
+
|
20
|
+
module Google
|
21
|
+
module Cloud
|
22
|
+
module Datastore
|
23
|
+
module V1
|
24
|
+
# The result of a single bucket from a Datastore aggregation query.
|
25
|
+
#
|
26
|
+
# The keys of `aggregate_properties` are the same for all results in an
|
27
|
+
# aggregation query, unlike entity queries which can have different fields
|
28
|
+
# present for each result.
|
29
|
+
# @!attribute [rw] aggregate_properties
|
30
|
+
# @return [::Google::Protobuf::Map{::String => ::Google::Cloud::Datastore::V1::Value}]
|
31
|
+
# The result of the aggregation functions, ex: `COUNT(*) AS total_entities`.
|
32
|
+
#
|
33
|
+
# The key is the {::Google::Cloud::Datastore::V1::AggregationQuery::Aggregation#alias alias}
|
34
|
+
# assigned to the aggregation function on input and the size of this map
|
35
|
+
# equals the number of aggregation functions in the query.
|
36
|
+
class AggregationResult
|
37
|
+
include ::Google::Protobuf::MessageExts
|
38
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
39
|
+
|
40
|
+
# @!attribute [rw] key
|
41
|
+
# @return [::String]
|
42
|
+
# @!attribute [rw] value
|
43
|
+
# @return [::Google::Cloud::Datastore::V1::Value]
|
44
|
+
class AggregatePropertiesEntry
|
45
|
+
include ::Google::Protobuf::MessageExts
|
46
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# A batch of aggregation results produced by an aggregation query.
|
51
|
+
# @!attribute [rw] aggregation_results
|
52
|
+
# @return [::Array<::Google::Cloud::Datastore::V1::AggregationResult>]
|
53
|
+
# The aggregation results for this batch.
|
54
|
+
# @!attribute [rw] more_results
|
55
|
+
# @return [::Google::Cloud::Datastore::V1::QueryResultBatch::MoreResultsType]
|
56
|
+
# The state of the query after the current batch.
|
57
|
+
# Only COUNT(*) aggregations are supported in the initial launch. Therefore,
|
58
|
+
# expected result type is limited to `NO_MORE_RESULTS`.
|
59
|
+
# @!attribute [rw] read_time
|
60
|
+
# @return [::Google::Protobuf::Timestamp]
|
61
|
+
# Read timestamp this batch was returned from.
|
62
|
+
#
|
63
|
+
# In a single transaction, subsequent query result batches for the same query
|
64
|
+
# can have a greater timestamp. Each batch's read timestamp
|
65
|
+
# is valid for all preceding batches.
|
66
|
+
class AggregationResultBatch
|
67
|
+
include ::Google::Protobuf::MessageExts
|
68
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
73
|
+
end
|
@@ -25,6 +25,12 @@ module Google
|
|
25
25
|
# @!attribute [rw] project_id
|
26
26
|
# @return [::String]
|
27
27
|
# Required. The ID of the project against which to make the request.
|
28
|
+
# @!attribute [rw] database_id
|
29
|
+
# @return [::String]
|
30
|
+
# The ID of the database against which to make the request.
|
31
|
+
#
|
32
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
33
|
+
# database.
|
28
34
|
# @!attribute [rw] read_options
|
29
35
|
# @return [::Google::Cloud::Datastore::V1::ReadOptions]
|
30
36
|
# The options for this lookup request.
|
@@ -64,6 +70,12 @@ module Google
|
|
64
70
|
# @!attribute [rw] project_id
|
65
71
|
# @return [::String]
|
66
72
|
# Required. The ID of the project against which to make the request.
|
73
|
+
# @!attribute [rw] database_id
|
74
|
+
# @return [::String]
|
75
|
+
# The ID of the database against which to make the request.
|
76
|
+
#
|
77
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
78
|
+
# database.
|
67
79
|
# @!attribute [rw] partition_id
|
68
80
|
# @return [::Google::Cloud::Datastore::V1::PartitionId]
|
69
81
|
# Entities are partitioned into subsets, identified by a partition ID.
|
@@ -78,7 +90,7 @@ module Google
|
|
78
90
|
# The query to run.
|
79
91
|
# @!attribute [rw] gql_query
|
80
92
|
# @return [::Google::Cloud::Datastore::V1::GqlQuery]
|
81
|
-
# The GQL query to run.
|
93
|
+
# The GQL query to run. This query must be a non-aggregation query.
|
82
94
|
class RunQueryRequest
|
83
95
|
include ::Google::Protobuf::MessageExts
|
84
96
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -96,10 +108,58 @@ module Google
|
|
96
108
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
97
109
|
end
|
98
110
|
|
111
|
+
# The request for {::Google::Cloud::Datastore::V1::Datastore::Client#run_aggregation_query Datastore.RunAggregationQuery}.
|
112
|
+
# @!attribute [rw] project_id
|
113
|
+
# @return [::String]
|
114
|
+
# Required. The ID of the project against which to make the request.
|
115
|
+
# @!attribute [rw] database_id
|
116
|
+
# @return [::String]
|
117
|
+
# The ID of the database against which to make the request.
|
118
|
+
#
|
119
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
120
|
+
# database.
|
121
|
+
# @!attribute [rw] partition_id
|
122
|
+
# @return [::Google::Cloud::Datastore::V1::PartitionId]
|
123
|
+
# Entities are partitioned into subsets, identified by a partition ID.
|
124
|
+
# Queries are scoped to a single partition.
|
125
|
+
# This partition ID is normalized with the standard default context
|
126
|
+
# partition ID.
|
127
|
+
# @!attribute [rw] read_options
|
128
|
+
# @return [::Google::Cloud::Datastore::V1::ReadOptions]
|
129
|
+
# The options for this query.
|
130
|
+
# @!attribute [rw] aggregation_query
|
131
|
+
# @return [::Google::Cloud::Datastore::V1::AggregationQuery]
|
132
|
+
# The query to run.
|
133
|
+
# @!attribute [rw] gql_query
|
134
|
+
# @return [::Google::Cloud::Datastore::V1::GqlQuery]
|
135
|
+
# The GQL query to run. This query must be an aggregation query.
|
136
|
+
class RunAggregationQueryRequest
|
137
|
+
include ::Google::Protobuf::MessageExts
|
138
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
139
|
+
end
|
140
|
+
|
141
|
+
# The response for {::Google::Cloud::Datastore::V1::Datastore::Client#run_aggregation_query Datastore.RunAggregationQuery}.
|
142
|
+
# @!attribute [rw] batch
|
143
|
+
# @return [::Google::Cloud::Datastore::V1::AggregationResultBatch]
|
144
|
+
# A batch of aggregation results. Always present.
|
145
|
+
# @!attribute [rw] query
|
146
|
+
# @return [::Google::Cloud::Datastore::V1::AggregationQuery]
|
147
|
+
# The parsed form of the `GqlQuery` from the request, if it was set.
|
148
|
+
class RunAggregationQueryResponse
|
149
|
+
include ::Google::Protobuf::MessageExts
|
150
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
151
|
+
end
|
152
|
+
|
99
153
|
# The request for {::Google::Cloud::Datastore::V1::Datastore::Client#begin_transaction Datastore.BeginTransaction}.
|
100
154
|
# @!attribute [rw] project_id
|
101
155
|
# @return [::String]
|
102
156
|
# Required. The ID of the project against which to make the request.
|
157
|
+
# @!attribute [rw] database_id
|
158
|
+
# @return [::String]
|
159
|
+
# The ID of the database against which to make the request.
|
160
|
+
#
|
161
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
162
|
+
# database.
|
103
163
|
# @!attribute [rw] transaction_options
|
104
164
|
# @return [::Google::Cloud::Datastore::V1::TransactionOptions]
|
105
165
|
# Options for a new transaction.
|
@@ -121,6 +181,12 @@ module Google
|
|
121
181
|
# @!attribute [rw] project_id
|
122
182
|
# @return [::String]
|
123
183
|
# Required. The ID of the project against which to make the request.
|
184
|
+
# @!attribute [rw] database_id
|
185
|
+
# @return [::String]
|
186
|
+
# The ID of the database against which to make the request.
|
187
|
+
#
|
188
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
189
|
+
# database.
|
124
190
|
# @!attribute [rw] transaction
|
125
191
|
# @return [::String]
|
126
192
|
# Required. The transaction identifier, returned by a call to
|
@@ -141,6 +207,12 @@ module Google
|
|
141
207
|
# @!attribute [rw] project_id
|
142
208
|
# @return [::String]
|
143
209
|
# Required. The ID of the project against which to make the request.
|
210
|
+
# @!attribute [rw] database_id
|
211
|
+
# @return [::String]
|
212
|
+
# The ID of the database against which to make the request.
|
213
|
+
#
|
214
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
215
|
+
# database.
|
144
216
|
# @!attribute [rw] mode
|
145
217
|
# @return [::Google::Cloud::Datastore::V1::CommitRequest::Mode]
|
146
218
|
# The type of commit to perform. Defaults to `TRANSACTIONAL`.
|
@@ -204,6 +276,12 @@ module Google
|
|
204
276
|
# @!attribute [rw] project_id
|
205
277
|
# @return [::String]
|
206
278
|
# Required. The ID of the project against which to make the request.
|
279
|
+
# @!attribute [rw] database_id
|
280
|
+
# @return [::String]
|
281
|
+
# The ID of the database against which to make the request.
|
282
|
+
#
|
283
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
284
|
+
# database.
|
207
285
|
# @!attribute [rw] keys
|
208
286
|
# @return [::Array<::Google::Cloud::Datastore::V1::Key>]
|
209
287
|
# Required. A list of keys with incomplete key paths for which to allocate IDs.
|
@@ -229,7 +307,10 @@ module Google
|
|
229
307
|
# Required. The ID of the project against which to make the request.
|
230
308
|
# @!attribute [rw] database_id
|
231
309
|
# @return [::String]
|
232
|
-
#
|
310
|
+
# The ID of the database against which to make the request.
|
311
|
+
#
|
312
|
+
# '(default)' is not allowed; please use empty string '' to refer the default
|
313
|
+
# database.
|
233
314
|
# @!attribute [rw] keys
|
234
315
|
# @return [::Array<::Google::Cloud::Datastore::V1::Key>]
|
235
316
|
# Required. A list of keys with complete key paths whose numeric IDs should not be
|
@@ -308,7 +389,6 @@ module Google
|
|
308
389
|
# @!attribute [rw] read_consistency
|
309
390
|
# @return [::Google::Cloud::Datastore::V1::ReadOptions::ReadConsistency]
|
310
391
|
# The non-transactional read consistency to use.
|
311
|
-
# Cannot be set to `STRONG` for global queries.
|
312
392
|
# @!attribute [rw] transaction
|
313
393
|
# @return [::String]
|
314
394
|
# The identifier of the transaction in which to read. A
|
@@ -43,6 +43,10 @@ module Google
|
|
43
43
|
# @!attribute [rw] project_id
|
44
44
|
# @return [::String]
|
45
45
|
# The ID of the project to which the entities belong.
|
46
|
+
# @!attribute [rw] database_id
|
47
|
+
# @return [::String]
|
48
|
+
# If not empty, the ID of the database to which the entities
|
49
|
+
# belong.
|
46
50
|
# @!attribute [rw] namespace_id
|
47
51
|
# @return [::String]
|
48
52
|
# If not empty, the ID of the namespace to which the entities belong.
|
@@ -89,20 +93,31 @@ module Google
|
|
89
93
|
# @!attribute [rw] kind
|
90
94
|
# @return [::String]
|
91
95
|
# The kind of the entity.
|
96
|
+
#
|
92
97
|
# A kind matching regex `__.*__` is reserved/read-only.
|
93
98
|
# A kind must not contain more than 1500 bytes when UTF-8 encoded.
|
94
99
|
# Cannot be `""`.
|
100
|
+
#
|
101
|
+
# Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are
|
102
|
+
# encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the
|
103
|
+
# bytes.
|
95
104
|
# @!attribute [rw] id
|
96
105
|
# @return [::Integer]
|
97
106
|
# The auto-allocated ID of the entity.
|
107
|
+
#
|
98
108
|
# Never equal to zero. Values less than zero are discouraged and may not
|
99
109
|
# be supported in the future.
|
100
110
|
# @!attribute [rw] name
|
101
111
|
# @return [::String]
|
102
112
|
# The name of the entity.
|
113
|
+
#
|
103
114
|
# A name matching regex `__.*__` is reserved/read-only.
|
104
115
|
# A name must not be more than 1500 bytes when UTF-8 encoded.
|
105
116
|
# Cannot be `""`.
|
117
|
+
#
|
118
|
+
# Must be valid UTF-8 bytes. Legacy values that are not valid UTF-8 are
|
119
|
+
# encoded as `__bytes<X>__` where `<X>` is the base-64 encoding of the
|
120
|
+
# bytes.
|
106
121
|
class PathElement
|
107
122
|
include ::Google::Protobuf::MessageExts
|
108
123
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -116,6 +116,96 @@ module Google
|
|
116
116
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
117
117
|
end
|
118
118
|
|
119
|
+
# Datastore query for running an aggregation over a {::Google::Cloud::Datastore::V1::Query Query}.
|
120
|
+
# @!attribute [rw] nested_query
|
121
|
+
# @return [::Google::Cloud::Datastore::V1::Query]
|
122
|
+
# Nested query for aggregation
|
123
|
+
# @!attribute [rw] aggregations
|
124
|
+
# @return [::Array<::Google::Cloud::Datastore::V1::AggregationQuery::Aggregation>]
|
125
|
+
# Optional. Series of aggregations to apply over the results of the `nested_query`.
|
126
|
+
#
|
127
|
+
# Requires:
|
128
|
+
#
|
129
|
+
# * A minimum of one and maximum of five aggregations per query.
|
130
|
+
class AggregationQuery
|
131
|
+
include ::Google::Protobuf::MessageExts
|
132
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
133
|
+
|
134
|
+
# Defines a aggregation that produces a single result.
|
135
|
+
# @!attribute [rw] count
|
136
|
+
# @return [::Google::Cloud::Datastore::V1::AggregationQuery::Aggregation::Count]
|
137
|
+
# Count aggregator.
|
138
|
+
# @!attribute [rw] alias
|
139
|
+
# @return [::String]
|
140
|
+
# Optional. Optional name of the property to store the result of the aggregation.
|
141
|
+
#
|
142
|
+
# If not provided, Datastore will pick a default name following the format
|
143
|
+
# `property_<incremental_id++>`. For example:
|
144
|
+
#
|
145
|
+
# ```
|
146
|
+
# AGGREGATE
|
147
|
+
# COUNT_UP_TO(1) AS count_up_to_1,
|
148
|
+
# COUNT_UP_TO(2),
|
149
|
+
# COUNT_UP_TO(3) AS count_up_to_3,
|
150
|
+
# COUNT_UP_TO(4)
|
151
|
+
# OVER (
|
152
|
+
# ...
|
153
|
+
# );
|
154
|
+
# ```
|
155
|
+
#
|
156
|
+
# becomes:
|
157
|
+
#
|
158
|
+
# ```
|
159
|
+
# AGGREGATE
|
160
|
+
# COUNT_UP_TO(1) AS count_up_to_1,
|
161
|
+
# COUNT_UP_TO(2) AS property_1,
|
162
|
+
# COUNT_UP_TO(3) AS count_up_to_3,
|
163
|
+
# COUNT_UP_TO(4) AS property_2
|
164
|
+
# OVER (
|
165
|
+
# ...
|
166
|
+
# );
|
167
|
+
# ```
|
168
|
+
#
|
169
|
+
# Requires:
|
170
|
+
#
|
171
|
+
# * Must be unique across all aggregation aliases.
|
172
|
+
# * Conform to {::Google::Cloud::Datastore::V1::Entity#properties entity property name} limitations.
|
173
|
+
class Aggregation
|
174
|
+
include ::Google::Protobuf::MessageExts
|
175
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
176
|
+
|
177
|
+
# Count of entities that match the query.
|
178
|
+
#
|
179
|
+
# The `COUNT(*)` aggregation function operates on the entire entity
|
180
|
+
# so it does not require a field reference.
|
181
|
+
# @!attribute [rw] up_to
|
182
|
+
# @return [::Google::Protobuf::Int64Value]
|
183
|
+
# Optional. Optional constraint on the maximum number of entities to count.
|
184
|
+
#
|
185
|
+
# This provides a way to set an upper bound on the number of entities
|
186
|
+
# to scan, limiting latency and cost.
|
187
|
+
#
|
188
|
+
# Unspecified is interpreted as no bound.
|
189
|
+
#
|
190
|
+
# If a zero value is provided, a count result of zero should always be
|
191
|
+
# expected.
|
192
|
+
#
|
193
|
+
# High-Level Example:
|
194
|
+
#
|
195
|
+
# ```
|
196
|
+
# AGGREGATE COUNT_UP_TO(1000) OVER ( SELECT * FROM k );
|
197
|
+
# ```
|
198
|
+
#
|
199
|
+
# Requires:
|
200
|
+
#
|
201
|
+
# * Must be non-negative when present.
|
202
|
+
class Count
|
203
|
+
include ::Google::Protobuf::MessageExts
|
204
|
+
extend ::Google::Protobuf::MessageExts::ClassMethods
|
205
|
+
end
|
206
|
+
end
|
207
|
+
end
|
208
|
+
|
119
209
|
# A representation of a kind.
|
120
210
|
# @!attribute [rw] name
|
121
211
|
# @return [::String]
|
@@ -187,7 +277,10 @@ module Google
|
|
187
277
|
# @!attribute [rw] filters
|
188
278
|
# @return [::Array<::Google::Cloud::Datastore::V1::Filter>]
|
189
279
|
# The list of filters to combine.
|
190
|
-
#
|
280
|
+
#
|
281
|
+
# Requires:
|
282
|
+
#
|
283
|
+
# * At least one filter is present.
|
191
284
|
class CompositeFilter
|
192
285
|
include ::Google::Protobuf::MessageExts
|
193
286
|
extend ::Google::Protobuf::MessageExts::ClassMethods
|
@@ -46,8 +46,8 @@ module Google
|
|
46
46
|
|
47
47
|
# `Value` represents a dynamically typed value which can be either
|
48
48
|
# null, a number, a string, a boolean, a recursive struct value, or a
|
49
|
-
# list of values. A producer of value is expected to set one of
|
50
|
-
# variants
|
49
|
+
# list of values. A producer of value is expected to set one of these
|
50
|
+
# variants. Absence of any variant indicates an error.
|
51
51
|
#
|
52
52
|
# The JSON representation for `Value` is JSON value.
|
53
53
|
# @!attribute [rw] null_value
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: google-cloud-datastore-v1
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Google LLC
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gapic-common
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.12'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: 2.a
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '0.
|
29
|
+
version: '0.12'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: 2.a
|
@@ -50,28 +50,28 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: 1.
|
53
|
+
version: 1.26.1
|
54
54
|
type: :development
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: 1.
|
60
|
+
version: 1.26.1
|
61
61
|
- !ruby/object:Gem::Dependency
|
62
62
|
name: minitest
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
65
|
- - "~>"
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version: '5.
|
67
|
+
version: '5.16'
|
68
68
|
type: :development
|
69
69
|
prerelease: false
|
70
70
|
version_requirements: !ruby/object:Gem::Requirement
|
71
71
|
requirements:
|
72
72
|
- - "~>"
|
73
73
|
- !ruby/object:Gem::Version
|
74
|
-
version: '5.
|
74
|
+
version: '5.16'
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: minitest-focus
|
77
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -106,14 +106,14 @@ dependencies:
|
|
106
106
|
requirements:
|
107
107
|
- - ">="
|
108
108
|
- !ruby/object:Gem::Version
|
109
|
-
version: '
|
109
|
+
version: '13.0'
|
110
110
|
type: :development
|
111
111
|
prerelease: false
|
112
112
|
version_requirements: !ruby/object:Gem::Requirement
|
113
113
|
requirements:
|
114
114
|
- - ">="
|
115
115
|
- !ruby/object:Gem::Version
|
116
|
-
version: '
|
116
|
+
version: '13.0'
|
117
117
|
- !ruby/object:Gem::Dependency
|
118
118
|
name: redcarpet
|
119
119
|
requirement: !ruby/object:Gem::Requirement
|
@@ -175,6 +175,7 @@ files:
|
|
175
175
|
- lib/google/cloud/datastore/v1/datastore/client.rb
|
176
176
|
- lib/google/cloud/datastore/v1/datastore/credentials.rb
|
177
177
|
- lib/google/cloud/datastore/v1/version.rb
|
178
|
+
- lib/google/datastore/v1/aggregation_result_pb.rb
|
178
179
|
- lib/google/datastore/v1/datastore_pb.rb
|
179
180
|
- lib/google/datastore/v1/datastore_services_pb.rb
|
180
181
|
- lib/google/datastore/v1/entity_pb.rb
|
@@ -182,6 +183,7 @@ files:
|
|
182
183
|
- proto_docs/README.md
|
183
184
|
- proto_docs/google/api/field_behavior.rb
|
184
185
|
- proto_docs/google/api/resource.rb
|
186
|
+
- proto_docs/google/datastore/v1/aggregation_result.rb
|
185
187
|
- proto_docs/google/datastore/v1/datastore.rb
|
186
188
|
- proto_docs/google/datastore/v1/entity.rb
|
187
189
|
- proto_docs/google/datastore/v1/query.rb
|
@@ -201,14 +203,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
201
203
|
requirements:
|
202
204
|
- - ">="
|
203
205
|
- !ruby/object:Gem::Version
|
204
|
-
version: '2.
|
206
|
+
version: '2.6'
|
205
207
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
206
208
|
requirements:
|
207
209
|
- - ">="
|
208
210
|
- !ruby/object:Gem::Version
|
209
211
|
version: '0'
|
210
212
|
requirements: []
|
211
|
-
rubygems_version: 3.3.
|
213
|
+
rubygems_version: 3.3.14
|
212
214
|
signing_key:
|
213
215
|
specification_version: 4
|
214
216
|
summary: API Client library for the Firestore in Datastore mode V1 API
|