google-cloud-firestore-v1 0.10.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -30,16 +30,37 @@ module Google
30
30
  # including transcoding, making the REST call, and deserialing the response.
31
31
  #
32
32
  class ServiceStub
33
- def initialize endpoint:, credentials:
33
+ def initialize endpoint:, endpoint_template:, universe_domain:, credentials:
34
34
  # These require statements are intentionally placed here to initialize
35
35
  # the REST modules only when it's required.
36
36
  require "gapic/rest"
37
37
 
38
- @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint, credentials: credentials,
38
+ @client_stub = ::Gapic::Rest::ClientStub.new endpoint: endpoint,
39
+ endpoint_template: endpoint_template,
40
+ universe_domain: universe_domain,
41
+ credentials: credentials,
39
42
  numeric_enums: true,
40
43
  raise_faraday_errors: false
41
44
  end
42
45
 
46
+ ##
47
+ # The effective universe domain
48
+ #
49
+ # @return [String]
50
+ #
51
+ def universe_domain
52
+ @client_stub.universe_domain
53
+ end
54
+
55
+ ##
56
+ # The effective endpoint
57
+ #
58
+ # @return [String]
59
+ #
60
+ def endpoint
61
+ @client_stub.endpoint
62
+ end
63
+
43
64
  ##
44
65
  # Baseline implementation for the get_document REST call
45
66
  #
@@ -59,7 +80,7 @@ module Google
59
80
 
60
81
  verb, uri, query_string_params, body = ServiceStub.transcode_get_document_request request_pb
61
82
  query_string_params = if query_string_params.any?
62
- query_string_params.to_h { |p| p.split("=", 2) }
83
+ query_string_params.to_h { |p| p.split "=", 2 }
63
84
  else
64
85
  {}
65
86
  end
@@ -97,7 +118,7 @@ module Google
97
118
 
98
119
  verb, uri, query_string_params, body = ServiceStub.transcode_list_documents_request request_pb
99
120
  query_string_params = if query_string_params.any?
100
- query_string_params.to_h { |p| p.split("=", 2) }
121
+ query_string_params.to_h { |p| p.split "=", 2 }
101
122
  else
102
123
  {}
103
124
  end
@@ -135,7 +156,7 @@ module Google
135
156
 
136
157
  verb, uri, query_string_params, body = ServiceStub.transcode_update_document_request request_pb
137
158
  query_string_params = if query_string_params.any?
138
- query_string_params.to_h { |p| p.split("=", 2) }
159
+ query_string_params.to_h { |p| p.split "=", 2 }
139
160
  else
140
161
  {}
141
162
  end
@@ -173,7 +194,7 @@ module Google
173
194
 
174
195
  verb, uri, query_string_params, body = ServiceStub.transcode_delete_document_request request_pb
175
196
  query_string_params = if query_string_params.any?
176
- query_string_params.to_h { |p| p.split("=", 2) }
197
+ query_string_params.to_h { |p| p.split "=", 2 }
177
198
  else
178
199
  {}
179
200
  end
@@ -208,7 +229,7 @@ module Google
208
229
 
209
230
  verb, uri, query_string_params, body = ServiceStub.transcode_batch_get_documents_request request_pb
210
231
  query_string_params = if query_string_params.any?
211
- query_string_params.to_h { |p| p.split("=", 2) }
232
+ query_string_params.to_h { |p| p.split "=", 2 }
212
233
  else
213
234
  {}
214
235
  end
@@ -244,7 +265,7 @@ module Google
244
265
 
245
266
  verb, uri, query_string_params, body = ServiceStub.transcode_begin_transaction_request request_pb
246
267
  query_string_params = if query_string_params.any?
247
- query_string_params.to_h { |p| p.split("=", 2) }
268
+ query_string_params.to_h { |p| p.split "=", 2 }
248
269
  else
249
270
  {}
250
271
  end
@@ -282,7 +303,7 @@ module Google
282
303
 
283
304
  verb, uri, query_string_params, body = ServiceStub.transcode_commit_request request_pb
284
305
  query_string_params = if query_string_params.any?
285
- query_string_params.to_h { |p| p.split("=", 2) }
306
+ query_string_params.to_h { |p| p.split "=", 2 }
286
307
  else
287
308
  {}
288
309
  end
@@ -320,7 +341,7 @@ module Google
320
341
 
321
342
  verb, uri, query_string_params, body = ServiceStub.transcode_rollback_request request_pb
322
343
  query_string_params = if query_string_params.any?
323
- query_string_params.to_h { |p| p.split("=", 2) }
344
+ query_string_params.to_h { |p| p.split "=", 2 }
324
345
  else
325
346
  {}
326
347
  end
@@ -355,7 +376,7 @@ module Google
355
376
 
356
377
  verb, uri, query_string_params, body = ServiceStub.transcode_run_query_request request_pb
357
378
  query_string_params = if query_string_params.any?
358
- query_string_params.to_h { |p| p.split("=", 2) }
379
+ query_string_params.to_h { |p| p.split "=", 2 }
359
380
  else
360
381
  {}
361
382
  end
@@ -388,7 +409,7 @@ module Google
388
409
 
389
410
  verb, uri, query_string_params, body = ServiceStub.transcode_run_aggregation_query_request request_pb
390
411
  query_string_params = if query_string_params.any?
391
- query_string_params.to_h { |p| p.split("=", 2) }
412
+ query_string_params.to_h { |p| p.split "=", 2 }
392
413
  else
393
414
  {}
394
415
  end
@@ -424,7 +445,7 @@ module Google
424
445
 
425
446
  verb, uri, query_string_params, body = ServiceStub.transcode_partition_query_request request_pb
426
447
  query_string_params = if query_string_params.any?
427
- query_string_params.to_h { |p| p.split("=", 2) }
448
+ query_string_params.to_h { |p| p.split "=", 2 }
428
449
  else
429
450
  {}
430
451
  end
@@ -462,7 +483,7 @@ module Google
462
483
 
463
484
  verb, uri, query_string_params, body = ServiceStub.transcode_list_collection_ids_request request_pb
464
485
  query_string_params = if query_string_params.any?
465
- query_string_params.to_h { |p| p.split("=", 2) }
486
+ query_string_params.to_h { |p| p.split "=", 2 }
466
487
  else
467
488
  {}
468
489
  end
@@ -500,7 +521,7 @@ module Google
500
521
 
501
522
  verb, uri, query_string_params, body = ServiceStub.transcode_batch_write_request request_pb
502
523
  query_string_params = if query_string_params.any?
503
- query_string_params.to_h { |p| p.split("=", 2) }
524
+ query_string_params.to_h { |p| p.split "=", 2 }
504
525
  else
505
526
  {}
506
527
  end
@@ -538,7 +559,7 @@ module Google
538
559
 
539
560
  verb, uri, query_string_params, body = ServiceStub.transcode_create_document_request request_pb
540
561
  query_string_params = if query_string_params.any?
541
- query_string_params.to_h { |p| p.split("=", 2) }
562
+ query_string_params.to_h { |p| p.split "=", 2 }
542
563
  else
543
564
  {}
544
565
  end
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Firestore
23
23
  module V1
24
- VERSION = "0.10.0"
24
+ VERSION = "0.11.1"
25
25
  end
26
26
  end
27
27
  end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
3
  # source: google/firestore/v1/aggregation_result.proto
3
4
 
@@ -5,12 +6,32 @@ require 'google/protobuf'
5
6
 
6
7
  require 'google/firestore/v1/document_pb'
7
8
 
8
- Google::Protobuf::DescriptorPool.generated_pool.build do
9
- add_file("google/firestore/v1/aggregation_result.proto", :syntax => :proto3) do
10
- add_message "google.firestore.v1.AggregationResult" do
11
- map :aggregate_fields, :string, :message, 2, "google.firestore.v1.Value"
9
+
10
+ descriptor_data = "\n,google/firestore/v1/aggregation_result.proto\x12\x13google.firestore.v1\x1a\"google/firestore/v1/document.proto\"\xbe\x01\n\x11\x41ggregationResult\x12U\n\x10\x61ggregate_fields\x18\x02 \x03(\x0b\x32;.google.firestore.v1.AggregationResult.AggregateFieldsEntry\x1aR\n\x14\x41ggregateFieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\x42\xce\x01\n\x17\x63om.google.firestore.v1B\x16\x41ggregationResultProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::V1b\x06proto3"
11
+
12
+ pool = Google::Protobuf::DescriptorPool.generated_pool
13
+
14
+ begin
15
+ pool.add_serialized_file(descriptor_data)
16
+ rescue TypeError
17
+ # Compatibility code: will be removed in the next major version.
18
+ require 'google/protobuf/descriptor_pb'
19
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
20
+ parsed.clear_dependency
21
+ serialized = parsed.class.encode(parsed)
22
+ file = pool.add_serialized_file(serialized)
23
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
24
+ imports = [
25
+ ["google.firestore.v1.Value", "google/firestore/v1/document.proto"],
26
+ ]
27
+ imports.each do |type_name, expected_filename|
28
+ import_file = pool.lookup(type_name).file_descriptor
29
+ if import_file.name != expected_filename
30
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
12
31
  end
13
32
  end
33
+ warn "Each proto file must use a consistent fully-qualified name."
34
+ warn "This will become an error in the next major version."
14
35
  end
15
36
 
16
37
  module Google
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
3
+ # source: google/firestore/v1/bloom_filter.proto
4
+
5
+ require 'google/protobuf'
6
+
7
+
8
+ descriptor_data = "\n&google/firestore/v1/bloom_filter.proto\x12\x13google.firestore.v1\".\n\x0b\x42itSequence\x12\x0e\n\x06\x62itmap\x18\x01 \x01(\x0c\x12\x0f\n\x07padding\x18\x02 \x01(\x05\"Q\n\x0b\x42loomFilter\x12.\n\x04\x62its\x18\x01 \x01(\x0b\x32 .google.firestore.v1.BitSequence\x12\x12\n\nhash_count\x18\x02 \x01(\x05\x42\xc8\x01\n\x17\x63om.google.firestore.v1B\x10\x42loomFilterProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::V1b\x06proto3"
9
+
10
+ pool = Google::Protobuf::DescriptorPool.generated_pool
11
+
12
+ begin
13
+ pool.add_serialized_file(descriptor_data)
14
+ rescue TypeError
15
+ # Compatibility code: will be removed in the next major version.
16
+ require 'google/protobuf/descriptor_pb'
17
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
18
+ parsed.clear_dependency
19
+ serialized = parsed.class.encode(parsed)
20
+ file = pool.add_serialized_file(serialized)
21
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
22
+ imports = [
23
+ ]
24
+ imports.each do |type_name, expected_filename|
25
+ import_file = pool.lookup(type_name).file_descriptor
26
+ if import_file.name != expected_filename
27
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
28
+ end
29
+ end
30
+ warn "Each proto file must use a consistent fully-qualified name."
31
+ warn "This will become an error in the next major version."
32
+ end
33
+
34
+ module Google
35
+ module Cloud
36
+ module Firestore
37
+ module V1
38
+ BitSequence = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.BitSequence").msgclass
39
+ BloomFilter = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.firestore.v1.BloomFilter").msgclass
40
+ end
41
+ end
42
+ end
43
+ end
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
3
  # source: google/firestore/v1/common.proto
3
4
 
@@ -5,32 +6,32 @@ require 'google/protobuf'
5
6
 
6
7
  require 'google/protobuf/timestamp_pb'
7
8
 
8
- Google::Protobuf::DescriptorPool.generated_pool.build do
9
- add_file("google/firestore/v1/common.proto", :syntax => :proto3) do
10
- add_message "google.firestore.v1.DocumentMask" do
11
- repeated :field_paths, :string, 1
12
- end
13
- add_message "google.firestore.v1.Precondition" do
14
- oneof :condition_type do
15
- optional :exists, :bool, 1
16
- optional :update_time, :message, 2, "google.protobuf.Timestamp"
17
- end
18
- end
19
- add_message "google.firestore.v1.TransactionOptions" do
20
- oneof :mode do
21
- optional :read_only, :message, 2, "google.firestore.v1.TransactionOptions.ReadOnly"
22
- optional :read_write, :message, 3, "google.firestore.v1.TransactionOptions.ReadWrite"
23
- end
24
- end
25
- add_message "google.firestore.v1.TransactionOptions.ReadWrite" do
26
- optional :retry_transaction, :bytes, 1
27
- end
28
- add_message "google.firestore.v1.TransactionOptions.ReadOnly" do
29
- oneof :consistency_selector do
30
- optional :read_time, :message, 2, "google.protobuf.Timestamp"
31
- end
9
+
10
+ descriptor_data = "\n google/firestore/v1/common.proto\x12\x13google.firestore.v1\x1a\x1fgoogle/protobuf/timestamp.proto\"#\n\x0c\x44ocumentMask\x12\x13\n\x0b\x66ield_paths\x18\x01 \x03(\t\"e\n\x0cPrecondition\x12\x10\n\x06\x65xists\x18\x01 \x01(\x08H\x00\x12\x31\n\x0bupdate_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x10\n\x0e\x63ondition_type\"\xa9\x02\n\x12TransactionOptions\x12\x45\n\tread_only\x18\x02 \x01(\x0b\x32\x30.google.firestore.v1.TransactionOptions.ReadOnlyH\x00\x12G\n\nread_write\x18\x03 \x01(\x0b\x32\x31.google.firestore.v1.TransactionOptions.ReadWriteH\x00\x1a&\n\tReadWrite\x12\x19\n\x11retry_transaction\x18\x01 \x01(\x0c\x1aS\n\x08ReadOnly\x12/\n\tread_time\x18\x02 \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x42\x16\n\x14\x63onsistency_selectorB\x06\n\x04modeB\xc3\x01\n\x17\x63om.google.firestore.v1B\x0b\x43ommonProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::V1b\x06proto3"
11
+
12
+ pool = Google::Protobuf::DescriptorPool.generated_pool
13
+
14
+ begin
15
+ pool.add_serialized_file(descriptor_data)
16
+ rescue TypeError
17
+ # Compatibility code: will be removed in the next major version.
18
+ require 'google/protobuf/descriptor_pb'
19
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
20
+ parsed.clear_dependency
21
+ serialized = parsed.class.encode(parsed)
22
+ file = pool.add_serialized_file(serialized)
23
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
24
+ imports = [
25
+ ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"],
26
+ ]
27
+ imports.each do |type_name, expected_filename|
28
+ import_file = pool.lookup(type_name).file_descriptor
29
+ if import_file.name != expected_filename
30
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
32
31
  end
33
32
  end
33
+ warn "Each proto file must use a consistent fully-qualified name."
34
+ warn "This will become an error in the next major version."
34
35
  end
35
36
 
36
37
  module Google
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
3
  # source: google/firestore/v1/document.proto
3
4
 
@@ -7,36 +8,33 @@ require 'google/protobuf/struct_pb'
7
8
  require 'google/protobuf/timestamp_pb'
8
9
  require 'google/type/latlng_pb'
9
10
 
10
- Google::Protobuf::DescriptorPool.generated_pool.build do
11
- add_file("google/firestore/v1/document.proto", :syntax => :proto3) do
12
- add_message "google.firestore.v1.Document" do
13
- optional :name, :string, 1
14
- map :fields, :string, :message, 2, "google.firestore.v1.Value"
15
- optional :create_time, :message, 3, "google.protobuf.Timestamp"
16
- optional :update_time, :message, 4, "google.protobuf.Timestamp"
17
- end
18
- add_message "google.firestore.v1.Value" do
19
- oneof :value_type do
20
- optional :null_value, :enum, 11, "google.protobuf.NullValue"
21
- optional :boolean_value, :bool, 1
22
- optional :integer_value, :int64, 2
23
- optional :double_value, :double, 3
24
- optional :timestamp_value, :message, 10, "google.protobuf.Timestamp"
25
- optional :string_value, :string, 17
26
- optional :bytes_value, :bytes, 18
27
- optional :reference_value, :string, 5
28
- optional :geo_point_value, :message, 8, "google.type.LatLng"
29
- optional :array_value, :message, 9, "google.firestore.v1.ArrayValue"
30
- optional :map_value, :message, 6, "google.firestore.v1.MapValue"
31
- end
32
- end
33
- add_message "google.firestore.v1.ArrayValue" do
34
- repeated :values, :message, 1, "google.firestore.v1.Value"
35
- end
36
- add_message "google.firestore.v1.MapValue" do
37
- map :fields, :string, :message, 1, "google.firestore.v1.Value"
11
+
12
+ descriptor_data = "\n\"google/firestore/v1/document.proto\x12\x13google.firestore.v1\x1a\x1cgoogle/protobuf/struct.proto\x1a\x1fgoogle/protobuf/timestamp.proto\x1a\x18google/type/latlng.proto\"\x80\x02\n\x08\x44ocument\x12\x0c\n\x04name\x18\x01 \x01(\t\x12\x39\n\x06\x66ields\x18\x02 \x03(\x0b\x32).google.firestore.v1.Document.FieldsEntry\x12/\n\x0b\x63reate_time\x18\x03 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x12/\n\x0bupdate_time\x18\x04 \x01(\x0b\x32\x1a.google.protobuf.Timestamp\x1aI\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\"\xae\x03\n\x05Value\x12\x30\n\nnull_value\x18\x0b \x01(\x0e\x32\x1a.google.protobuf.NullValueH\x00\x12\x17\n\rboolean_value\x18\x01 \x01(\x08H\x00\x12\x17\n\rinteger_value\x18\x02 \x01(\x03H\x00\x12\x16\n\x0c\x64ouble_value\x18\x03 \x01(\x01H\x00\x12\x35\n\x0ftimestamp_value\x18\n \x01(\x0b\x32\x1a.google.protobuf.TimestampH\x00\x12\x16\n\x0cstring_value\x18\x11 \x01(\tH\x00\x12\x15\n\x0b\x62ytes_value\x18\x12 \x01(\x0cH\x00\x12\x19\n\x0freference_value\x18\x05 \x01(\tH\x00\x12.\n\x0fgeo_point_value\x18\x08 \x01(\x0b\x32\x13.google.type.LatLngH\x00\x12\x36\n\x0b\x61rray_value\x18\t \x01(\x0b\x32\x1f.google.firestore.v1.ArrayValueH\x00\x12\x32\n\tmap_value\x18\x06 \x01(\x0b\x32\x1d.google.firestore.v1.MapValueH\x00\x42\x0c\n\nvalue_type\"8\n\nArrayValue\x12*\n\x06values\x18\x01 \x03(\x0b\x32\x1a.google.firestore.v1.Value\"\x90\x01\n\x08MapValue\x12\x39\n\x06\x66ields\x18\x01 \x03(\x0b\x32).google.firestore.v1.MapValue.FieldsEntry\x1aI\n\x0b\x46ieldsEntry\x12\x0b\n\x03key\x18\x01 \x01(\t\x12)\n\x05value\x18\x02 \x01(\x0b\x32\x1a.google.firestore.v1.Value:\x02\x38\x01\x42\xc5\x01\n\x17\x63om.google.firestore.v1B\rDocumentProtoP\x01Z;cloud.google.com/go/firestore/apiv1/firestorepb;firestorepb\xa2\x02\x04GCFS\xaa\x02\x19Google.Cloud.Firestore.V1\xca\x02\x19Google\\Cloud\\Firestore\\V1\xea\x02\x1cGoogle::Cloud::Firestore::V1b\x06proto3"
13
+
14
+ pool = Google::Protobuf::DescriptorPool.generated_pool
15
+
16
+ begin
17
+ pool.add_serialized_file(descriptor_data)
18
+ rescue TypeError
19
+ # Compatibility code: will be removed in the next major version.
20
+ require 'google/protobuf/descriptor_pb'
21
+ parsed = Google::Protobuf::FileDescriptorProto.decode(descriptor_data)
22
+ parsed.clear_dependency
23
+ serialized = parsed.class.encode(parsed)
24
+ file = pool.add_serialized_file(serialized)
25
+ warn "Warning: Protobuf detected an import path issue while loading generated file #{__FILE__}"
26
+ imports = [
27
+ ["google.protobuf.Timestamp", "google/protobuf/timestamp.proto"],
28
+ ["google.type.LatLng", "google/type/latlng.proto"],
29
+ ]
30
+ imports.each do |type_name, expected_filename|
31
+ import_file = pool.lookup(type_name).file_descriptor
32
+ if import_file.name != expected_filename
33
+ warn "- #{file.name} imports #{expected_filename}, but that import was loaded as #{import_file.name}"
38
34
  end
39
35
  end
36
+ warn "Each proto file must use a consistent fully-qualified name."
37
+ warn "This will become an error in the next major version."
40
38
  end
41
39
 
42
40
  module Google