google-cloud-firestore-v1 0.4.1 → 0.4.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dc6cc59ee1cd6fcb3e1191670489901781f9f8cbeffe083cf62eb96fd494fb25
4
- data.tar.gz: c31933eeb5e1822dc5ef08220dabb5591c18734a959e41be3126ae471ca3dc98
3
+ metadata.gz: ed18d4ae4fcf183d7ccfa9bc8943718b32c9a024e0cac4a596ad96183115582b
4
+ data.tar.gz: 94f8c799a2460e0b6a2ea8b8c419cec0dfb2359e2d62af94f9bb7cc48bce51db
5
5
  SHA512:
6
- metadata.gz: 5e244be86c8cb73b4995dd6c6ee5e7d59d008f18ce067f120ff90c34cf8ed54a99943a0d6013cae8603078579748a221737f410dcb1c9ba2bd4004d2b490cd31
7
- data.tar.gz: d60d23d1e1c2285dc113194bfef9d67da2ba529a09329a71294a651abf40dc95f61b827143be6f25b4bf21425d3cf63e07a8fa4b383b3fcc032345d69c1eca22
6
+ metadata.gz: 525f9bf96d470937c512228a38dc08e12565c3cad66697551417945a2b2feecea008519dc5ee528b9e5cca83492878e4741f24e583c13885098ba761b5e43c9b
7
+ data.tar.gz: ca5325bd0d0d92b81674bd4fc7b02cff4b636da9730e721e3601c2f3c935a5303f8d269867ab13b2d800323d8f77d76f89a8cb0873c58b1f82b835d800294c6d
data/AUTHENTICATION.md CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-firestore-v1
66
66
  checks for credentials are configured on the service Credentials class (such as
67
67
  {::Google::Cloud::Firestore::V1::Firestore::Credentials}):
68
68
 
69
- 1. `FIRESTORE_CREDENTIALS` - Path to JSON file, or JSON contents
70
- 2. `FIRESTORE_KEYFILE` - Path to JSON file, or JSON contents
71
- 3. `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
- 4. `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
- 5. `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
69
+ * `FIRESTORE_CREDENTIALS` - Path to JSON file, or JSON contents
70
+ * `FIRESTORE_KEYFILE` - Path to JSON file, or JSON contents
71
+ * `GOOGLE_CLOUD_CREDENTIALS` - Path to JSON file, or JSON contents
72
+ * `GOOGLE_CLOUD_KEYFILE` - Path to JSON file, or JSON contents
73
+ * `GOOGLE_APPLICATION_CREDENTIALS` - Path to JSON file
74
74
 
75
75
  ```ruby
76
76
  require "google/cloud/firestore/v1"
@@ -82,8 +82,8 @@ client = ::Google::Cloud::Firestore::V1::Firestore::Client.new
82
82
 
83
83
  ### Configuration
84
84
 
85
- The **Credentials JSON** can be configured instead of placing them in
86
- environment variables. Either on an individual client initialization:
85
+ The path to the **Credentials JSON** file can be configured instead of storing
86
+ it in an environment variable. Either on an individual client initialization:
87
87
 
88
88
  ```ruby
89
89
  require "google/cloud/firestore/v1"
@@ -93,7 +93,7 @@ client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config|
93
93
  end
94
94
  ```
95
95
 
96
- Or configured globally for all clients:
96
+ Or globally for all clients:
97
97
 
98
98
  ```ruby
99
99
  require "google/cloud/firestore/v1"
data/README.md CHANGED
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
33
33
  require "google/cloud/firestore/v1"
34
34
 
35
35
  client = ::Google::Cloud::Firestore::V1::Firestore::Client.new
36
- request = my_create_request
36
+ request = ::Google::Cloud::Firestore::V1::GetDocumentRequest.new # (request fields as keyword arguments...)
37
37
  response = client.get_document request
38
38
  ```
39
39
 
@@ -46,13 +46,12 @@ module Google
46
46
  # See {::Google::Cloud::Firestore::V1::Firestore::Client::Configuration}
47
47
  # for a description of the configuration fields.
48
48
  #
49
- # ## Example
49
+ # @example
50
50
  #
51
- # To modify the configuration for all Firestore clients:
52
- #
53
- # ::Google::Cloud::Firestore::V1::Firestore::Client.configure do |config|
54
- # config.timeout = 10.0
55
- # end
51
+ # # Modify the configuration for all Firestore clients
52
+ # ::Google::Cloud::Firestore::V1::Firestore::Client.configure do |config|
53
+ # config.timeout = 10.0
54
+ # end
56
55
  #
57
56
  # @yield [config] Configure the Client client.
58
57
  # @yieldparam config [Client::Configuration]
@@ -72,116 +71,74 @@ module Google
72
71
 
73
72
  default_config.rpcs.get_document.timeout = 60.0
74
73
  default_config.rpcs.get_document.retry_policy = {
75
- initial_delay: 0.1,
76
- max_delay: 60.0,
77
- multiplier: 1.3,
78
- retry_codes: [8, 14, 13, 4]
74
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4]
79
75
  }
80
76
 
81
77
  default_config.rpcs.list_documents.timeout = 60.0
82
78
  default_config.rpcs.list_documents.retry_policy = {
83
- initial_delay: 0.1,
84
- max_delay: 60.0,
85
- multiplier: 1.3,
86
- retry_codes: [8, 14, 13, 4]
79
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4]
87
80
  }
88
81
 
89
82
  default_config.rpcs.update_document.timeout = 60.0
90
83
  default_config.rpcs.update_document.retry_policy = {
91
- initial_delay: 0.1,
92
- max_delay: 60.0,
93
- multiplier: 1.3,
94
- retry_codes: [8, 14]
84
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14]
95
85
  }
96
86
 
97
87
  default_config.rpcs.delete_document.timeout = 60.0
98
88
  default_config.rpcs.delete_document.retry_policy = {
99
- initial_delay: 0.1,
100
- max_delay: 60.0,
101
- multiplier: 1.3,
102
- retry_codes: [8, 14, 13, 4]
89
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4]
103
90
  }
104
91
 
105
92
  default_config.rpcs.batch_get_documents.timeout = 300.0
106
93
  default_config.rpcs.batch_get_documents.retry_policy = {
107
- initial_delay: 0.1,
108
- max_delay: 60.0,
109
- multiplier: 1.3,
110
- retry_codes: [8, 14, 13, 4]
94
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4]
111
95
  }
112
96
 
113
97
  default_config.rpcs.begin_transaction.timeout = 60.0
114
98
  default_config.rpcs.begin_transaction.retry_policy = {
115
- initial_delay: 0.1,
116
- max_delay: 60.0,
117
- multiplier: 1.3,
118
- retry_codes: [8, 14, 13, 4]
99
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4]
119
100
  }
120
101
 
121
102
  default_config.rpcs.commit.timeout = 60.0
122
103
  default_config.rpcs.commit.retry_policy = {
123
- initial_delay: 0.1,
124
- max_delay: 60.0,
125
- multiplier: 1.3,
126
- retry_codes: [8, 14]
104
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14]
127
105
  }
128
106
 
129
107
  default_config.rpcs.rollback.timeout = 60.0
130
108
  default_config.rpcs.rollback.retry_policy = {
131
- initial_delay: 0.1,
132
- max_delay: 60.0,
133
- multiplier: 1.3,
134
- retry_codes: [8, 14, 13, 4]
109
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4]
135
110
  }
136
111
 
137
112
  default_config.rpcs.run_query.timeout = 300.0
138
113
  default_config.rpcs.run_query.retry_policy = {
139
- initial_delay: 0.1,
140
- max_delay: 60.0,
141
- multiplier: 1.3,
142
- retry_codes: [8, 14, 13, 4]
114
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4]
143
115
  }
144
116
 
145
117
  default_config.rpcs.partition_query.timeout = 300.0
146
118
  default_config.rpcs.partition_query.retry_policy = {
147
- initial_delay: 0.1,
148
- max_delay: 60.0,
149
- multiplier: 1.3,
150
- retry_codes: [8, 14, 13, 4]
119
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4]
151
120
  }
152
121
 
153
122
  default_config.rpcs.write.timeout = 86_400.0
154
123
 
155
124
  default_config.rpcs.listen.timeout = 86_400.0
156
125
  default_config.rpcs.listen.retry_policy = {
157
- initial_delay: 0.1,
158
- max_delay: 60.0,
159
- multiplier: 1.3,
160
- retry_codes: [8, 14, 13, 4]
126
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4]
161
127
  }
162
128
 
163
129
  default_config.rpcs.list_collection_ids.timeout = 60.0
164
130
  default_config.rpcs.list_collection_ids.retry_policy = {
165
- initial_delay: 0.1,
166
- max_delay: 60.0,
167
- multiplier: 1.3,
168
- retry_codes: [8, 14, 13, 4]
131
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 13, 4]
169
132
  }
170
133
 
171
134
  default_config.rpcs.batch_write.timeout = 60.0
172
135
  default_config.rpcs.batch_write.retry_policy = {
173
- initial_delay: 0.1,
174
- max_delay: 60.0,
175
- multiplier: 1.3,
176
- retry_codes: [8, 14, 10]
136
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14, 10]
177
137
  }
178
138
 
179
139
  default_config.rpcs.create_document.timeout = 60.0
180
140
  default_config.rpcs.create_document.retry_policy = {
181
- initial_delay: 0.1,
182
- max_delay: 60.0,
183
- multiplier: 1.3,
184
- retry_codes: [8, 14]
141
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [8, 14]
185
142
  }
186
143
 
187
144
  default_config
@@ -213,19 +170,15 @@ module Google
213
170
  ##
214
171
  # Create a new Firestore client object.
215
172
  #
216
- # ## Examples
217
- #
218
- # To create a new Firestore client with the default
219
- # configuration:
173
+ # @example
220
174
  #
221
- # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new
175
+ # # Create a client using the default configuration
176
+ # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new
222
177
  #
223
- # To create a new Firestore client with a custom
224
- # configuration:
225
- #
226
- # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config|
227
- # config.timeout = 10.0
228
- # end
178
+ # # Create a client using a custom configuration
179
+ # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config|
180
+ # config.timeout = 10.0
181
+ # end
229
182
  #
230
183
  # @yield [config] Configure the Firestore client.
231
184
  # @yieldparam config [Client::Configuration]
@@ -245,14 +198,13 @@ module Google
245
198
 
246
199
  # Create credentials
247
200
  credentials = @config.credentials
248
- # Use self-signed JWT if the scope and endpoint are unchanged from default,
201
+ # Use self-signed JWT if the endpoint is unchanged from default,
249
202
  # but only if the default endpoint does not have a region prefix.
250
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
251
- @config.endpoint == Client.configure.endpoint &&
203
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
252
204
  !@config.endpoint.split(".").first.include?("-")
253
205
  credentials ||= Credentials.default scope: @config.scope,
254
206
  enable_self_signed_jwt: enable_self_signed_jwt
255
- if credentials.is_a?(String) || credentials.is_a?(Hash)
207
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
256
208
  credentials = Credentials.new credentials, scope: @config.scope
257
209
  end
258
210
  @quota_project_id = @config.quota_project
@@ -309,6 +261,21 @@ module Google
309
261
  #
310
262
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
311
263
  #
264
+ # @example Basic example
265
+ # require "google/cloud/firestore/v1"
266
+ #
267
+ # # Create a client object. The client can be reused for multiple calls.
268
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
269
+ #
270
+ # # Create a request. To set request fields, pass in keyword arguments.
271
+ # request = Google::Cloud::Firestore::V1::GetDocumentRequest.new
272
+ #
273
+ # # Call the get_document method.
274
+ # result = client.get_document request
275
+ #
276
+ # # The returned object is of type Google::Cloud::Firestore::V1::Document.
277
+ # p result
278
+ #
312
279
  def get_document request, options = nil
313
280
  raise ::ArgumentError, "request must be provided" if request.nil?
314
281
 
@@ -326,16 +293,20 @@ module Google
326
293
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
327
294
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
328
295
 
329
- header_params = {
330
- "name" => request.name
331
- }
296
+ header_params = {}
297
+ if request.name
298
+ header_params["name"] = request.name
299
+ end
300
+
332
301
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
333
302
  metadata[:"x-goog-request-params"] ||= request_params_header
334
303
 
335
304
  options.apply_defaults timeout: @config.rpcs.get_document.timeout,
336
305
  metadata: metadata,
337
306
  retry_policy: @config.rpcs.get_document.retry_policy
338
- options.apply_defaults metadata: @config.metadata,
307
+
308
+ options.apply_defaults timeout: @config.timeout,
309
+ metadata: @config.metadata,
339
310
  retry_policy: @config.retry_policy
340
311
 
341
312
  @firestore_stub.call_rpc :get_document, request, options: options do |response, operation|
@@ -407,6 +378,27 @@ module Google
407
378
  #
408
379
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
409
380
  #
381
+ # @example Basic example
382
+ # require "google/cloud/firestore/v1"
383
+ #
384
+ # # Create a client object. The client can be reused for multiple calls.
385
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
386
+ #
387
+ # # Create a request. To set request fields, pass in keyword arguments.
388
+ # request = Google::Cloud::Firestore::V1::ListDocumentsRequest.new
389
+ #
390
+ # # Call the list_documents method.
391
+ # result = client.list_documents request
392
+ #
393
+ # # The returned object is of type Gapic::PagedEnumerable. You can
394
+ # # iterate over all elements by calling #each, and the enumerable
395
+ # # will lazily make API calls to fetch subsequent pages. Other
396
+ # # methods are also available for managing paging directly.
397
+ # result.each do |response|
398
+ # # Each element is of type ::Google::Cloud::Firestore::V1::Document.
399
+ # p response
400
+ # end
401
+ #
410
402
  def list_documents request, options = nil
411
403
  raise ::ArgumentError, "request must be provided" if request.nil?
412
404
 
@@ -424,17 +416,23 @@ module Google
424
416
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
425
417
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
426
418
 
427
- header_params = {
428
- "parent" => request.parent,
429
- "collection_id" => request.collection_id
430
- }
419
+ header_params = {}
420
+ if request.parent
421
+ header_params["parent"] = request.parent
422
+ end
423
+ if request.collection_id
424
+ header_params["collection_id"] = request.collection_id
425
+ end
426
+
431
427
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
432
428
  metadata[:"x-goog-request-params"] ||= request_params_header
433
429
 
434
430
  options.apply_defaults timeout: @config.rpcs.list_documents.timeout,
435
431
  metadata: metadata,
436
432
  retry_policy: @config.rpcs.list_documents.retry_policy
437
- options.apply_defaults metadata: @config.metadata,
433
+
434
+ options.apply_defaults timeout: @config.timeout,
435
+ metadata: @config.metadata,
438
436
  retry_policy: @config.retry_policy
439
437
 
440
438
  @firestore_stub.call_rpc :list_documents, request, options: options do |response, operation|
@@ -492,6 +490,21 @@ module Google
492
490
  #
493
491
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
494
492
  #
493
+ # @example Basic example
494
+ # require "google/cloud/firestore/v1"
495
+ #
496
+ # # Create a client object. The client can be reused for multiple calls.
497
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
498
+ #
499
+ # # Create a request. To set request fields, pass in keyword arguments.
500
+ # request = Google::Cloud::Firestore::V1::UpdateDocumentRequest.new
501
+ #
502
+ # # Call the update_document method.
503
+ # result = client.update_document request
504
+ #
505
+ # # The returned object is of type Google::Cloud::Firestore::V1::Document.
506
+ # p result
507
+ #
495
508
  def update_document request, options = nil
496
509
  raise ::ArgumentError, "request must be provided" if request.nil?
497
510
 
@@ -509,16 +522,20 @@ module Google
509
522
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
510
523
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
511
524
 
512
- header_params = {
513
- "document.name" => request.document.name
514
- }
525
+ header_params = {}
526
+ if request.document&.name
527
+ header_params["document.name"] = request.document.name
528
+ end
529
+
515
530
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
516
531
  metadata[:"x-goog-request-params"] ||= request_params_header
517
532
 
518
533
  options.apply_defaults timeout: @config.rpcs.update_document.timeout,
519
534
  metadata: metadata,
520
535
  retry_policy: @config.rpcs.update_document.retry_policy
521
- options.apply_defaults metadata: @config.metadata,
536
+
537
+ options.apply_defaults timeout: @config.timeout,
538
+ metadata: @config.metadata,
522
539
  retry_policy: @config.retry_policy
523
540
 
524
541
  @firestore_stub.call_rpc :update_document, request, options: options do |response, operation|
@@ -562,6 +579,21 @@ module Google
562
579
  #
563
580
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
564
581
  #
582
+ # @example Basic example
583
+ # require "google/cloud/firestore/v1"
584
+ #
585
+ # # Create a client object. The client can be reused for multiple calls.
586
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
587
+ #
588
+ # # Create a request. To set request fields, pass in keyword arguments.
589
+ # request = Google::Cloud::Firestore::V1::DeleteDocumentRequest.new
590
+ #
591
+ # # Call the delete_document method.
592
+ # result = client.delete_document request
593
+ #
594
+ # # The returned object is of type Google::Protobuf::Empty.
595
+ # p result
596
+ #
565
597
  def delete_document request, options = nil
566
598
  raise ::ArgumentError, "request must be provided" if request.nil?
567
599
 
@@ -579,16 +611,20 @@ module Google
579
611
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
580
612
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
581
613
 
582
- header_params = {
583
- "name" => request.name
584
- }
614
+ header_params = {}
615
+ if request.name
616
+ header_params["name"] = request.name
617
+ end
618
+
585
619
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
586
620
  metadata[:"x-goog-request-params"] ||= request_params_header
587
621
 
588
622
  options.apply_defaults timeout: @config.rpcs.delete_document.timeout,
589
623
  metadata: metadata,
590
624
  retry_policy: @config.rpcs.delete_document.retry_policy
591
- options.apply_defaults metadata: @config.metadata,
625
+
626
+ options.apply_defaults timeout: @config.timeout,
627
+ metadata: @config.metadata,
592
628
  retry_policy: @config.retry_policy
593
629
 
594
630
  @firestore_stub.call_rpc :delete_document, request, options: options do |response, operation|
@@ -652,6 +688,24 @@ module Google
652
688
  #
653
689
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
654
690
  #
691
+ # @example Basic example
692
+ # require "google/cloud/firestore/v1"
693
+ #
694
+ # # Create a client object. The client can be reused for multiple calls.
695
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
696
+ #
697
+ # # Create a request. To set request fields, pass in keyword arguments.
698
+ # request = Google::Cloud::Firestore::V1::BatchGetDocumentsRequest.new
699
+ #
700
+ # # Call the batch_get_documents method.
701
+ # result = client.batch_get_documents request
702
+ #
703
+ # # The returned object is a streamed enumerable yielding elements of
704
+ # # type ::Google::Cloud::Firestore::V1::BatchGetDocumentsResponse.
705
+ # result.each do |response|
706
+ # p response
707
+ # end
708
+ #
655
709
  def batch_get_documents request, options = nil
656
710
  raise ::ArgumentError, "request must be provided" if request.nil?
657
711
 
@@ -669,16 +723,20 @@ module Google
669
723
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
670
724
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
671
725
 
672
- header_params = {
673
- "database" => request.database
674
- }
726
+ header_params = {}
727
+ if request.database
728
+ header_params["database"] = request.database
729
+ end
730
+
675
731
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
676
732
  metadata[:"x-goog-request-params"] ||= request_params_header
677
733
 
678
734
  options.apply_defaults timeout: @config.rpcs.batch_get_documents.timeout,
679
735
  metadata: metadata,
680
736
  retry_policy: @config.rpcs.batch_get_documents.retry_policy
681
- options.apply_defaults metadata: @config.metadata,
737
+
738
+ options.apply_defaults timeout: @config.timeout,
739
+ metadata: @config.metadata,
682
740
  retry_policy: @config.retry_policy
683
741
 
684
742
  @firestore_stub.call_rpc :batch_get_documents, request, options: options do |response, operation|
@@ -722,6 +780,21 @@ module Google
722
780
  #
723
781
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
724
782
  #
783
+ # @example Basic example
784
+ # require "google/cloud/firestore/v1"
785
+ #
786
+ # # Create a client object. The client can be reused for multiple calls.
787
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
788
+ #
789
+ # # Create a request. To set request fields, pass in keyword arguments.
790
+ # request = Google::Cloud::Firestore::V1::BeginTransactionRequest.new
791
+ #
792
+ # # Call the begin_transaction method.
793
+ # result = client.begin_transaction request
794
+ #
795
+ # # The returned object is of type Google::Cloud::Firestore::V1::BeginTransactionResponse.
796
+ # p result
797
+ #
725
798
  def begin_transaction request, options = nil
726
799
  raise ::ArgumentError, "request must be provided" if request.nil?
727
800
 
@@ -739,16 +812,20 @@ module Google
739
812
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
740
813
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
741
814
 
742
- header_params = {
743
- "database" => request.database
744
- }
815
+ header_params = {}
816
+ if request.database
817
+ header_params["database"] = request.database
818
+ end
819
+
745
820
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
746
821
  metadata[:"x-goog-request-params"] ||= request_params_header
747
822
 
748
823
  options.apply_defaults timeout: @config.rpcs.begin_transaction.timeout,
749
824
  metadata: metadata,
750
825
  retry_policy: @config.rpcs.begin_transaction.retry_policy
751
- options.apply_defaults metadata: @config.metadata,
826
+
827
+ options.apply_defaults timeout: @config.timeout,
828
+ metadata: @config.metadata,
752
829
  retry_policy: @config.retry_policy
753
830
 
754
831
  @firestore_stub.call_rpc :begin_transaction, request, options: options do |response, operation|
@@ -795,6 +872,21 @@ module Google
795
872
  #
796
873
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
797
874
  #
875
+ # @example Basic example
876
+ # require "google/cloud/firestore/v1"
877
+ #
878
+ # # Create a client object. The client can be reused for multiple calls.
879
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
880
+ #
881
+ # # Create a request. To set request fields, pass in keyword arguments.
882
+ # request = Google::Cloud::Firestore::V1::CommitRequest.new
883
+ #
884
+ # # Call the commit method.
885
+ # result = client.commit request
886
+ #
887
+ # # The returned object is of type Google::Cloud::Firestore::V1::CommitResponse.
888
+ # p result
889
+ #
798
890
  def commit request, options = nil
799
891
  raise ::ArgumentError, "request must be provided" if request.nil?
800
892
 
@@ -812,16 +904,20 @@ module Google
812
904
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
813
905
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
814
906
 
815
- header_params = {
816
- "database" => request.database
817
- }
907
+ header_params = {}
908
+ if request.database
909
+ header_params["database"] = request.database
910
+ end
911
+
818
912
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
819
913
  metadata[:"x-goog-request-params"] ||= request_params_header
820
914
 
821
915
  options.apply_defaults timeout: @config.rpcs.commit.timeout,
822
916
  metadata: metadata,
823
917
  retry_policy: @config.rpcs.commit.retry_policy
824
- options.apply_defaults metadata: @config.metadata,
918
+
919
+ options.apply_defaults timeout: @config.timeout,
920
+ metadata: @config.metadata,
825
921
  retry_policy: @config.retry_policy
826
922
 
827
923
  @firestore_stub.call_rpc :commit, request, options: options do |response, operation|
@@ -864,6 +960,21 @@ module Google
864
960
  #
865
961
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
866
962
  #
963
+ # @example Basic example
964
+ # require "google/cloud/firestore/v1"
965
+ #
966
+ # # Create a client object. The client can be reused for multiple calls.
967
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
968
+ #
969
+ # # Create a request. To set request fields, pass in keyword arguments.
970
+ # request = Google::Cloud::Firestore::V1::RollbackRequest.new
971
+ #
972
+ # # Call the rollback method.
973
+ # result = client.rollback request
974
+ #
975
+ # # The returned object is of type Google::Protobuf::Empty.
976
+ # p result
977
+ #
867
978
  def rollback request, options = nil
868
979
  raise ::ArgumentError, "request must be provided" if request.nil?
869
980
 
@@ -881,16 +992,20 @@ module Google
881
992
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
882
993
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
883
994
 
884
- header_params = {
885
- "database" => request.database
886
- }
995
+ header_params = {}
996
+ if request.database
997
+ header_params["database"] = request.database
998
+ end
999
+
887
1000
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
888
1001
  metadata[:"x-goog-request-params"] ||= request_params_header
889
1002
 
890
1003
  options.apply_defaults timeout: @config.rpcs.rollback.timeout,
891
1004
  metadata: metadata,
892
1005
  retry_policy: @config.rpcs.rollback.retry_policy
893
- options.apply_defaults metadata: @config.metadata,
1006
+
1007
+ options.apply_defaults timeout: @config.timeout,
1008
+ metadata: @config.metadata,
894
1009
  retry_policy: @config.retry_policy
895
1010
 
896
1011
  @firestore_stub.call_rpc :rollback, request, options: options do |response, operation|
@@ -947,6 +1062,24 @@ module Google
947
1062
  #
948
1063
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
949
1064
  #
1065
+ # @example Basic example
1066
+ # require "google/cloud/firestore/v1"
1067
+ #
1068
+ # # Create a client object. The client can be reused for multiple calls.
1069
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1070
+ #
1071
+ # # Create a request. To set request fields, pass in keyword arguments.
1072
+ # request = Google::Cloud::Firestore::V1::RunQueryRequest.new
1073
+ #
1074
+ # # Call the run_query method.
1075
+ # result = client.run_query request
1076
+ #
1077
+ # # The returned object is a streamed enumerable yielding elements of
1078
+ # # type ::Google::Cloud::Firestore::V1::RunQueryResponse.
1079
+ # result.each do |response|
1080
+ # p response
1081
+ # end
1082
+ #
950
1083
  def run_query request, options = nil
951
1084
  raise ::ArgumentError, "request must be provided" if request.nil?
952
1085
 
@@ -964,16 +1097,20 @@ module Google
964
1097
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
965
1098
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
966
1099
 
967
- header_params = {
968
- "parent" => request.parent
969
- }
1100
+ header_params = {}
1101
+ if request.parent
1102
+ header_params["parent"] = request.parent
1103
+ end
1104
+
970
1105
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
971
1106
  metadata[:"x-goog-request-params"] ||= request_params_header
972
1107
 
973
1108
  options.apply_defaults timeout: @config.rpcs.run_query.timeout,
974
1109
  metadata: metadata,
975
1110
  retry_policy: @config.rpcs.run_query.retry_policy
976
- options.apply_defaults metadata: @config.metadata,
1111
+
1112
+ options.apply_defaults timeout: @config.timeout,
1113
+ metadata: @config.metadata,
977
1114
  retry_policy: @config.retry_policy
978
1115
 
979
1116
  @firestore_stub.call_rpc :run_query, request, options: options do |response, operation|
@@ -1054,6 +1191,27 @@ module Google
1054
1191
  #
1055
1192
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1056
1193
  #
1194
+ # @example Basic example
1195
+ # require "google/cloud/firestore/v1"
1196
+ #
1197
+ # # Create a client object. The client can be reused for multiple calls.
1198
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1199
+ #
1200
+ # # Create a request. To set request fields, pass in keyword arguments.
1201
+ # request = Google::Cloud::Firestore::V1::PartitionQueryRequest.new
1202
+ #
1203
+ # # Call the partition_query method.
1204
+ # result = client.partition_query request
1205
+ #
1206
+ # # The returned object is of type Gapic::PagedEnumerable. You can
1207
+ # # iterate over all elements by calling #each, and the enumerable
1208
+ # # will lazily make API calls to fetch subsequent pages. Other
1209
+ # # methods are also available for managing paging directly.
1210
+ # result.each do |response|
1211
+ # # Each element is of type ::Google::Cloud::Firestore::V1::Cursor.
1212
+ # p response
1213
+ # end
1214
+ #
1057
1215
  def partition_query request, options = nil
1058
1216
  raise ::ArgumentError, "request must be provided" if request.nil?
1059
1217
 
@@ -1071,16 +1229,20 @@ module Google
1071
1229
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
1072
1230
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1073
1231
 
1074
- header_params = {
1075
- "parent" => request.parent
1076
- }
1232
+ header_params = {}
1233
+ if request.parent
1234
+ header_params["parent"] = request.parent
1235
+ end
1236
+
1077
1237
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1078
1238
  metadata[:"x-goog-request-params"] ||= request_params_header
1079
1239
 
1080
1240
  options.apply_defaults timeout: @config.rpcs.partition_query.timeout,
1081
1241
  metadata: metadata,
1082
1242
  retry_policy: @config.rpcs.partition_query.retry_policy
1083
- options.apply_defaults metadata: @config.metadata,
1243
+
1244
+ options.apply_defaults timeout: @config.timeout,
1245
+ metadata: @config.metadata,
1084
1246
  retry_policy: @config.retry_policy
1085
1247
 
1086
1248
  @firestore_stub.call_rpc :partition_query, request, options: options do |response, operation|
@@ -1108,6 +1270,30 @@ module Google
1108
1270
  #
1109
1271
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1110
1272
  #
1273
+ # @example Basic example
1274
+ # require "google/cloud/firestore/v1"
1275
+ #
1276
+ # # Create a client object. The client can be reused for multiple calls.
1277
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1278
+ #
1279
+ # # Create an input stream
1280
+ # input = Gapic::StreamInput.new
1281
+ #
1282
+ # # Call the write method to start streaming.
1283
+ # output = client.write input
1284
+ #
1285
+ # # Send requests on the stream. For each request, pass in keyword
1286
+ # # arguments to set fields. Be sure to close the stream when done.
1287
+ # input << Google::Cloud::Firestore::V1::WriteRequest.new
1288
+ # input << Google::Cloud::Firestore::V1::WriteRequest.new
1289
+ # input.close
1290
+ #
1291
+ # # Handle streamed responses. These may be interleaved with inputs.
1292
+ # # Each response is of type ::Google::Cloud::Firestore::V1::WriteResponse.
1293
+ # output.each do |response|
1294
+ # p response
1295
+ # end
1296
+ #
1111
1297
  def write request, options = nil
1112
1298
  unless request.is_a? ::Enumerable
1113
1299
  raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum
@@ -1133,7 +1319,9 @@ module Google
1133
1319
  options.apply_defaults timeout: @config.rpcs.write.timeout,
1134
1320
  metadata: metadata,
1135
1321
  retry_policy: @config.rpcs.write.retry_policy
1136
- options.apply_defaults metadata: @config.metadata,
1322
+
1323
+ options.apply_defaults timeout: @config.timeout,
1324
+ metadata: @config.metadata,
1137
1325
  retry_policy: @config.retry_policy
1138
1326
 
1139
1327
  @firestore_stub.call_rpc :write, request, options: options do |response, operation|
@@ -1160,6 +1348,30 @@ module Google
1160
1348
  #
1161
1349
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1162
1350
  #
1351
+ # @example Basic example
1352
+ # require "google/cloud/firestore/v1"
1353
+ #
1354
+ # # Create a client object. The client can be reused for multiple calls.
1355
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1356
+ #
1357
+ # # Create an input stream
1358
+ # input = Gapic::StreamInput.new
1359
+ #
1360
+ # # Call the listen method to start streaming.
1361
+ # output = client.listen input
1362
+ #
1363
+ # # Send requests on the stream. For each request, pass in keyword
1364
+ # # arguments to set fields. Be sure to close the stream when done.
1365
+ # input << Google::Cloud::Firestore::V1::ListenRequest.new
1366
+ # input << Google::Cloud::Firestore::V1::ListenRequest.new
1367
+ # input.close
1368
+ #
1369
+ # # Handle streamed responses. These may be interleaved with inputs.
1370
+ # # Each response is of type ::Google::Cloud::Firestore::V1::ListenResponse.
1371
+ # output.each do |response|
1372
+ # p response
1373
+ # end
1374
+ #
1163
1375
  def listen request, options = nil
1164
1376
  unless request.is_a? ::Enumerable
1165
1377
  raise ::ArgumentError, "request must be an Enumerable" unless request.respond_to? :to_enum
@@ -1185,7 +1397,9 @@ module Google
1185
1397
  options.apply_defaults timeout: @config.rpcs.listen.timeout,
1186
1398
  metadata: metadata,
1187
1399
  retry_policy: @config.rpcs.listen.retry_policy
1188
- options.apply_defaults metadata: @config.metadata,
1400
+
1401
+ options.apply_defaults timeout: @config.timeout,
1402
+ metadata: @config.metadata,
1189
1403
  retry_policy: @config.retry_policy
1190
1404
 
1191
1405
  @firestore_stub.call_rpc :listen, request, options: options do |response, operation|
@@ -1233,6 +1447,21 @@ module Google
1233
1447
  #
1234
1448
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1235
1449
  #
1450
+ # @example Basic example
1451
+ # require "google/cloud/firestore/v1"
1452
+ #
1453
+ # # Create a client object. The client can be reused for multiple calls.
1454
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1455
+ #
1456
+ # # Create a request. To set request fields, pass in keyword arguments.
1457
+ # request = Google::Cloud::Firestore::V1::ListCollectionIdsRequest.new
1458
+ #
1459
+ # # Call the list_collection_ids method.
1460
+ # result = client.list_collection_ids request
1461
+ #
1462
+ # # The returned object is of type Google::Cloud::Firestore::V1::ListCollectionIdsResponse.
1463
+ # p result
1464
+ #
1236
1465
  def list_collection_ids request, options = nil
1237
1466
  raise ::ArgumentError, "request must be provided" if request.nil?
1238
1467
 
@@ -1250,16 +1479,20 @@ module Google
1250
1479
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
1251
1480
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1252
1481
 
1253
- header_params = {
1254
- "parent" => request.parent
1255
- }
1482
+ header_params = {}
1483
+ if request.parent
1484
+ header_params["parent"] = request.parent
1485
+ end
1486
+
1256
1487
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1257
1488
  metadata[:"x-goog-request-params"] ||= request_params_header
1258
1489
 
1259
1490
  options.apply_defaults timeout: @config.rpcs.list_collection_ids.timeout,
1260
1491
  metadata: metadata,
1261
1492
  retry_policy: @config.rpcs.list_collection_ids.retry_policy
1262
- options.apply_defaults metadata: @config.metadata,
1493
+
1494
+ options.apply_defaults timeout: @config.timeout,
1495
+ metadata: @config.metadata,
1263
1496
  retry_policy: @config.retry_policy
1264
1497
 
1265
1498
  @firestore_stub.call_rpc :list_collection_ids, request, options: options do |response, operation|
@@ -1316,6 +1549,21 @@ module Google
1316
1549
  #
1317
1550
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1318
1551
  #
1552
+ # @example Basic example
1553
+ # require "google/cloud/firestore/v1"
1554
+ #
1555
+ # # Create a client object. The client can be reused for multiple calls.
1556
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1557
+ #
1558
+ # # Create a request. To set request fields, pass in keyword arguments.
1559
+ # request = Google::Cloud::Firestore::V1::BatchWriteRequest.new
1560
+ #
1561
+ # # Call the batch_write method.
1562
+ # result = client.batch_write request
1563
+ #
1564
+ # # The returned object is of type Google::Cloud::Firestore::V1::BatchWriteResponse.
1565
+ # p result
1566
+ #
1319
1567
  def batch_write request, options = nil
1320
1568
  raise ::ArgumentError, "request must be provided" if request.nil?
1321
1569
 
@@ -1333,16 +1581,20 @@ module Google
1333
1581
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
1334
1582
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1335
1583
 
1336
- header_params = {
1337
- "database" => request.database
1338
- }
1584
+ header_params = {}
1585
+ if request.database
1586
+ header_params["database"] = request.database
1587
+ end
1588
+
1339
1589
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1340
1590
  metadata[:"x-goog-request-params"] ||= request_params_header
1341
1591
 
1342
1592
  options.apply_defaults timeout: @config.rpcs.batch_write.timeout,
1343
1593
  metadata: metadata,
1344
1594
  retry_policy: @config.rpcs.batch_write.retry_policy
1345
- options.apply_defaults metadata: @config.metadata,
1595
+
1596
+ options.apply_defaults timeout: @config.timeout,
1597
+ metadata: @config.metadata,
1346
1598
  retry_policy: @config.retry_policy
1347
1599
 
1348
1600
  @firestore_stub.call_rpc :batch_write, request, options: options do |response, operation|
@@ -1397,6 +1649,21 @@ module Google
1397
1649
  #
1398
1650
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
1399
1651
  #
1652
+ # @example Basic example
1653
+ # require "google/cloud/firestore/v1"
1654
+ #
1655
+ # # Create a client object. The client can be reused for multiple calls.
1656
+ # client = Google::Cloud::Firestore::V1::Firestore::Client.new
1657
+ #
1658
+ # # Create a request. To set request fields, pass in keyword arguments.
1659
+ # request = Google::Cloud::Firestore::V1::CreateDocumentRequest.new
1660
+ #
1661
+ # # Call the create_document method.
1662
+ # result = client.create_document request
1663
+ #
1664
+ # # The returned object is of type Google::Cloud::Firestore::V1::Document.
1665
+ # p result
1666
+ #
1400
1667
  def create_document request, options = nil
1401
1668
  raise ::ArgumentError, "request must be provided" if request.nil?
1402
1669
 
@@ -1414,17 +1681,23 @@ module Google
1414
1681
  gapic_version: ::Google::Cloud::Firestore::V1::VERSION
1415
1682
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1416
1683
 
1417
- header_params = {
1418
- "parent" => request.parent,
1419
- "collection_id" => request.collection_id
1420
- }
1684
+ header_params = {}
1685
+ if request.parent
1686
+ header_params["parent"] = request.parent
1687
+ end
1688
+ if request.collection_id
1689
+ header_params["collection_id"] = request.collection_id
1690
+ end
1691
+
1421
1692
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1422
1693
  metadata[:"x-goog-request-params"] ||= request_params_header
1423
1694
 
1424
1695
  options.apply_defaults timeout: @config.rpcs.create_document.timeout,
1425
1696
  metadata: metadata,
1426
1697
  retry_policy: @config.rpcs.create_document.retry_policy
1427
- options.apply_defaults metadata: @config.metadata,
1698
+
1699
+ options.apply_defaults timeout: @config.timeout,
1700
+ metadata: @config.metadata,
1428
1701
  retry_policy: @config.retry_policy
1429
1702
 
1430
1703
  @firestore_stub.call_rpc :create_document, request, options: options do |response, operation|
@@ -1448,22 +1721,21 @@ module Google
1448
1721
  # Configuration can be applied globally to all clients, or to a single client
1449
1722
  # on construction.
1450
1723
  #
1451
- # # Examples
1452
- #
1453
- # To modify the global config, setting the timeout for get_document
1454
- # to 20 seconds, and all remaining timeouts to 10 seconds:
1455
- #
1456
- # ::Google::Cloud::Firestore::V1::Firestore::Client.configure do |config|
1457
- # config.timeout = 10.0
1458
- # config.rpcs.get_document.timeout = 20.0
1459
- # end
1460
- #
1461
- # To apply the above configuration only to a new client:
1462
- #
1463
- # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config|
1464
- # config.timeout = 10.0
1465
- # config.rpcs.get_document.timeout = 20.0
1466
- # end
1724
+ # @example
1725
+ #
1726
+ # # Modify the global config, setting the timeout for
1727
+ # # get_document to 20 seconds,
1728
+ # # and all remaining timeouts to 10 seconds.
1729
+ # ::Google::Cloud::Firestore::V1::Firestore::Client.configure do |config|
1730
+ # config.timeout = 10.0
1731
+ # config.rpcs.get_document.timeout = 20.0
1732
+ # end
1733
+ #
1734
+ # # Apply the above configuration only to a new client.
1735
+ # client = ::Google::Cloud::Firestore::V1::Firestore::Client.new do |config|
1736
+ # config.timeout = 10.0
1737
+ # config.rpcs.get_document.timeout = 20.0
1738
+ # end
1467
1739
  #
1468
1740
  # @!attribute [rw] endpoint
1469
1741
  # The hostname or hostname:port of the service endpoint.
@@ -21,7 +21,7 @@ module Google
21
21
  module Cloud
22
22
  module Firestore
23
23
  module V1
24
- VERSION = "0.4.1"
24
+ VERSION = "0.4.5"
25
25
  end
26
26
  end
27
27
  end
@@ -1,10 +1,10 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/firestore/v1/common.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/protobuf/timestamp_pb'
7
5
  require 'google/api/annotations_pb'
6
+ require 'google/protobuf'
7
+
8
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
9
  add_file("google/firestore/v1/common.proto", :syntax => :proto3) do
10
10
  add_message "google.firestore.v1.DocumentMask" do
@@ -1,12 +1,12 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/firestore/v1/document.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/protobuf/struct_pb'
7
5
  require 'google/protobuf/timestamp_pb'
8
6
  require 'google/type/latlng_pb'
9
7
  require 'google/api/annotations_pb'
8
+ require 'google/protobuf'
9
+
10
10
  Google::Protobuf::DescriptorPool.generated_pool.build do
11
11
  add_file("google/firestore/v1/document.proto", :syntax => :proto3) do
12
12
  add_message "google.firestore.v1.Document" do
@@ -1,8 +1,6 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/firestore/v1/firestore.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/annotations_pb'
7
5
  require 'google/api/client_pb'
8
6
  require 'google/api/field_behavior_pb'
@@ -13,6 +11,8 @@ require 'google/firestore/v1/write_pb'
13
11
  require 'google/protobuf/empty_pb'
14
12
  require 'google/protobuf/timestamp_pb'
15
13
  require 'google/rpc/status_pb'
14
+ require 'google/protobuf'
15
+
16
16
  Google::Protobuf::DescriptorPool.generated_pool.build do
17
17
  add_file("google/firestore/v1/firestore.proto", :syntax => :proto3) do
18
18
  add_message "google.firestore.v1.GetDocumentRequest" do
@@ -36,7 +36,7 @@ module Google
36
36
  # building truly serverless apps.
37
37
  class Service
38
38
 
39
- include GRPC::GenericService
39
+ include ::GRPC::GenericService
40
40
 
41
41
  self.marshal_class_method = :encode
42
42
  self.unmarshal_class_method = :decode
@@ -1,11 +1,11 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/firestore/v1/query.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/firestore/v1/document_pb'
7
5
  require 'google/protobuf/wrappers_pb'
8
6
  require 'google/api/annotations_pb'
7
+ require 'google/protobuf'
8
+
9
9
  Google::Protobuf::DescriptorPool.generated_pool.build do
10
10
  add_file("google/firestore/v1/query.proto", :syntax => :proto3) do
11
11
  add_message "google.firestore.v1.StructuredQuery" do
@@ -1,12 +1,12 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/firestore/v1/write.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/firestore/v1/common_pb'
7
5
  require 'google/firestore/v1/document_pb'
8
6
  require 'google/protobuf/timestamp_pb'
9
7
  require 'google/api/annotations_pb'
8
+ require 'google/protobuf'
9
+
10
10
  Google::Protobuf::DescriptorPool.generated_pool.build do
11
11
  add_file("google/firestore/v1/write.proto", :syntax => :proto3) do
12
12
  add_message "google.firestore.v1.Write" do
@@ -57,9 +57,15 @@ module Google
57
57
 
58
58
  # Denotes that a (repeated) field is an unordered list.
59
59
  # This indicates that the service may provide the elements of the list
60
- # in any arbitrary order, rather than the order the user originally
60
+ # in any arbitrary order, rather than the order the user originally
61
61
  # provided. Additionally, the list's order may or may not be stable.
62
62
  UNORDERED_LIST = 6
63
+
64
+ # Denotes that this field returns a non-empty default value if not set.
65
+ # This indicates that if the user provides the empty value in a request,
66
+ # a non-empty value will be returned. The user will not be aware of what
67
+ # non-empty value to expect.
68
+ NON_EMPTY_DEFAULT = 7
63
69
  end
64
70
  end
65
71
  end
metadata CHANGED
@@ -1,29 +1,35 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-firestore-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Google LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-16 00:00:00.000000000 Z
11
+ date: 2021-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - "~>"
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0.7'
20
+ - - "<"
18
21
  - !ruby/object:Gem::Version
19
- version: '0.4'
22
+ version: 2.a
20
23
  type: :runtime
21
24
  prerelease: false
22
25
  version_requirements: !ruby/object:Gem::Requirement
23
26
  requirements:
24
- - - "~>"
27
+ - - ">="
28
+ - !ruby/object:Gem::Version
29
+ version: '0.7'
30
+ - - "<"
25
31
  - !ruby/object:Gem::Version
26
- version: '0.4'
32
+ version: 2.a
27
33
  - !ruby/object:Gem::Dependency
28
34
  name: google-cloud-errors
29
35
  requirement: !ruby/object:Gem::Requirement
@@ -209,7 +215,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
215
  - !ruby/object:Gem::Version
210
216
  version: '0'
211
217
  requirements: []
212
- rubygems_version: 3.2.13
218
+ rubygems_version: 3.2.17
213
219
  signing_key:
214
220
  specification_version: 4
215
221
  summary: API Client library for the Cloud Firestore V1 API