google-cloud-datastore-admin-v1 0.4.4 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f695d2eeb23ca141ddb83d2c802e20c4b6a56f321ce7b46b01d88da1bed3243b
4
- data.tar.gz: 194693891682fc2857e65fc247b30e4fcfcd3afd1943718c21a73a6ea4f92054
3
+ metadata.gz: 62097b7a2f08a30340645f58ff6b9d24a31ee7081444e39deabbe6ed1ec110b8
4
+ data.tar.gz: d414f8c5d2a27a239477713cf0d86aa1a8da4a621b00aee01201973d4ba2e529
5
5
  SHA512:
6
- metadata.gz: 4e780df3015ec552862a1081759409a6ad6c3424e2dc52507e344b44394b6b3c546d3eadb7bebfe50236c15ecbef54d0f5d18834aac2373898a12dea25ffc3f7
7
- data.tar.gz: eac744f4d794c6778a58b0bf1a14bf92e91e7189c78422a96720c32df5845cae2f3173911b102bf4d3ddcd22331558d5781f5c75006b513a54da379913a69823
6
+ metadata.gz: 1ac84b87e3b7e2ada5992edb8ce7289c18e3684ef73e36410950679f7cb544ebe716025d4c63471654f70b465c1b38561ae2614f191b64838b4d7c9a6fdcacda
7
+ data.tar.gz: f9f4087fd68084375f245765691f69544609ff1b0afdeba4d078dcf54368252ebb163f744dd861a4438bb36509de29eaf2ef70f36500987f429dadc0a8ad5b53
data/.yardopts CHANGED
@@ -1,5 +1,5 @@
1
1
  --no-private
2
- --title=Firestore in Datastore mode Admin V1 API
2
+ --title="Firestore in Datastore mode Admin V1 API"
3
3
  --exclude _pb\.rb$
4
4
  --markup markdown
5
5
  --markup-provider redcarpet
data/AUTHENTICATION.md CHANGED
@@ -120,15 +120,6 @@ To configure your system for this, simply:
120
120
  **NOTE:** This is _not_ recommended for running in production. The Cloud SDK
121
121
  *should* only be used during development.
122
122
 
123
- [gce-how-to]: https://cloud.google.com/compute/docs/authentication#using
124
- [dev-console]: https://console.cloud.google.com/project
125
-
126
- [enable-apis]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/enable-apis.png
127
-
128
- [create-new-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account.png
129
- [create-new-service-account-existing-keys]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/create-new-service-account-existing-keys.png
130
- [reuse-service-account]: https://raw.githubusercontent.com/GoogleCloudPlatform/gcloud-common/master/authentication/reuse-service-account.png
131
-
132
123
  ## Creating a Service Account
133
124
 
134
125
  Google Cloud requires **Service Account Credentials** to
@@ -139,31 +130,22 @@ If you are not running this client within
139
130
  [Google Cloud Platform environments](#google-cloud-platform-environments), you
140
131
  need a Google Developers service account.
141
132
 
142
- 1. Visit the [Google Developers Console][dev-console].
133
+ 1. Visit the [Google Cloud Console](https://console.cloud.google.com/project).
143
134
  2. Create a new project or click on an existing project.
144
- 3. Activate the slide-out navigation tray and select **API Manager**. From
135
+ 3. Activate the menu in the upper left and select **APIs & Services**. From
145
136
  here, you will enable the APIs that your application requires.
146
137
 
147
- ![Enable the APIs that your application requires][enable-apis]
148
-
149
138
  *Note: You may need to enable billing in order to use these services.*
150
139
 
151
140
  4. Select **Credentials** from the side navigation.
152
141
 
153
- You should see a screen like one of the following.
154
-
155
- ![Create a new service account][create-new-service-account]
156
-
157
- ![Create a new service account With Existing Keys][create-new-service-account-existing-keys]
158
-
159
- Find the "Add credentials" drop down and select "Service account" to be
160
- guided through downloading a new JSON key file.
142
+ Find the "Create credentials" drop down near the top of the page, and select
143
+ "Service account" to be guided through downloading a new JSON key file.
161
144
 
162
145
  If you want to re-use an existing service account, you can easily generate a
163
- new key file. Just select the account you wish to re-use, and click "Generate
164
- new JSON key":
165
-
166
- ![Re-use an existing service account][reuse-service-account]
146
+ new key file. Just select the account you wish to re-use, click the pencil
147
+ tool on the right side to edit the service account, select the **Keys** tab,
148
+ and then select **Add Key**.
167
149
 
168
150
  The key file you download will be used by this library to authenticate API
169
151
  requests and should be stored in a secure location.
data/README.md CHANGED
@@ -37,7 +37,7 @@ request = ::Google::Cloud::Datastore::Admin::V1::ExportEntitiesRequest.new # (re
37
37
  response = client.export_entities request
38
38
  ```
39
39
 
40
- View the [Client Library Documentation](https://googleapis.dev/ruby/google-cloud-datastore-admin-v1/latest)
40
+ View the [Client Library Documentation](https://cloud.google.com/ruby/docs/reference/google-cloud-datastore-admin-v1/latest)
41
41
  for class and method documentation.
42
42
 
43
43
  See also the [Product Documentation](https://cloud.google.com/datastore)
@@ -69,6 +69,11 @@ 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
79
  This library is supported on Ruby 2.5+.
@@ -212,6 +212,7 @@ module Google
212
212
 
213
213
  @operations_client = Operations.new do |config|
214
214
  config.credentials = credentials
215
+ config.quota_project = @quota_project_id
215
216
  config.endpoint = @config.endpoint
216
217
  end
217
218
 
@@ -292,6 +293,28 @@ module Google
292
293
  #
293
294
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
294
295
  #
296
+ # @example Basic example
297
+ # require "google/cloud/datastore/admin/v1"
298
+ #
299
+ # # Create a client object. The client can be reused for multiple calls.
300
+ # client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new
301
+ #
302
+ # # Create a request. To set request fields, pass in keyword arguments.
303
+ # request = Google::Cloud::Datastore::Admin::V1::ExportEntitiesRequest.new
304
+ #
305
+ # # Call the export_entities method.
306
+ # result = client.export_entities request
307
+ #
308
+ # # The returned object is of type Gapic::Operation. You can use this
309
+ # # object to check the status of an operation, cancel it, or wait
310
+ # # for results. Here is how to block until completion:
311
+ # result.wait_until_done! timeout: 60
312
+ # if result.response?
313
+ # p result.response
314
+ # else
315
+ # puts "Error!"
316
+ # end
317
+ #
295
318
  def export_entities request, options = nil
296
319
  raise ::ArgumentError, "request must be provided" if request.nil?
297
320
 
@@ -309,9 +332,11 @@ module Google
309
332
  gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
310
333
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
311
334
 
312
- header_params = {
313
- "project_id" => request.project_id
314
- }
335
+ header_params = {}
336
+ if request.project_id
337
+ header_params["project_id"] = request.project_id
338
+ end
339
+
315
340
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
316
341
  metadata[:"x-goog-request-params"] ||= request_params_header
317
342
 
@@ -386,6 +411,28 @@ module Google
386
411
  #
387
412
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
388
413
  #
414
+ # @example Basic example
415
+ # require "google/cloud/datastore/admin/v1"
416
+ #
417
+ # # Create a client object. The client can be reused for multiple calls.
418
+ # client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new
419
+ #
420
+ # # Create a request. To set request fields, pass in keyword arguments.
421
+ # request = Google::Cloud::Datastore::Admin::V1::ImportEntitiesRequest.new
422
+ #
423
+ # # Call the import_entities method.
424
+ # result = client.import_entities request
425
+ #
426
+ # # The returned object is of type Gapic::Operation. You can use this
427
+ # # object to check the status of an operation, cancel it, or wait
428
+ # # for results. Here is how to block until completion:
429
+ # result.wait_until_done! timeout: 60
430
+ # if result.response?
431
+ # p result.response
432
+ # else
433
+ # puts "Error!"
434
+ # end
435
+ #
389
436
  def import_entities request, options = nil
390
437
  raise ::ArgumentError, "request must be provided" if request.nil?
391
438
 
@@ -403,9 +450,11 @@ module Google
403
450
  gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
404
451
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
405
452
 
406
- header_params = {
407
- "project_id" => request.project_id
408
- }
453
+ header_params = {}
454
+ if request.project_id
455
+ header_params["project_id"] = request.project_id
456
+ end
457
+
409
458
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
410
459
  metadata[:"x-goog-request-params"] ||= request_params_header
411
460
 
@@ -471,6 +520,28 @@ module Google
471
520
  #
472
521
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
473
522
  #
523
+ # @example Basic example
524
+ # require "google/cloud/datastore/admin/v1"
525
+ #
526
+ # # Create a client object. The client can be reused for multiple calls.
527
+ # client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new
528
+ #
529
+ # # Create a request. To set request fields, pass in keyword arguments.
530
+ # request = Google::Cloud::Datastore::Admin::V1::CreateIndexRequest.new
531
+ #
532
+ # # Call the create_index method.
533
+ # result = client.create_index request
534
+ #
535
+ # # The returned object is of type Gapic::Operation. You can use this
536
+ # # object to check the status of an operation, cancel it, or wait
537
+ # # for results. Here is how to block until completion:
538
+ # result.wait_until_done! timeout: 60
539
+ # if result.response?
540
+ # p result.response
541
+ # else
542
+ # puts "Error!"
543
+ # end
544
+ #
474
545
  def create_index request, options = nil
475
546
  raise ::ArgumentError, "request must be provided" if request.nil?
476
547
 
@@ -488,9 +559,11 @@ module Google
488
559
  gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
489
560
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
490
561
 
491
- header_params = {
492
- "project_id" => request.project_id
493
- }
562
+ header_params = {}
563
+ if request.project_id
564
+ header_params["project_id"] = request.project_id
565
+ end
566
+
494
567
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
495
568
  metadata[:"x-goog-request-params"] ||= request_params_header
496
569
 
@@ -551,6 +624,28 @@ module Google
551
624
  #
552
625
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
553
626
  #
627
+ # @example Basic example
628
+ # require "google/cloud/datastore/admin/v1"
629
+ #
630
+ # # Create a client object. The client can be reused for multiple calls.
631
+ # client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new
632
+ #
633
+ # # Create a request. To set request fields, pass in keyword arguments.
634
+ # request = Google::Cloud::Datastore::Admin::V1::DeleteIndexRequest.new
635
+ #
636
+ # # Call the delete_index method.
637
+ # result = client.delete_index request
638
+ #
639
+ # # The returned object is of type Gapic::Operation. You can use this
640
+ # # object to check the status of an operation, cancel it, or wait
641
+ # # for results. Here is how to block until completion:
642
+ # result.wait_until_done! timeout: 60
643
+ # if result.response?
644
+ # p result.response
645
+ # else
646
+ # puts "Error!"
647
+ # end
648
+ #
554
649
  def delete_index request, options = nil
555
650
  raise ::ArgumentError, "request must be provided" if request.nil?
556
651
 
@@ -568,10 +663,14 @@ module Google
568
663
  gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
569
664
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
570
665
 
571
- header_params = {
572
- "project_id" => request.project_id,
573
- "index_id" => request.index_id
574
- }
666
+ header_params = {}
667
+ if request.project_id
668
+ header_params["project_id"] = request.project_id
669
+ end
670
+ if request.index_id
671
+ header_params["index_id"] = request.index_id
672
+ end
673
+
575
674
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
576
675
  metadata[:"x-goog-request-params"] ||= request_params_header
577
676
 
@@ -623,6 +722,21 @@ module Google
623
722
  #
624
723
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
625
724
  #
725
+ # @example Basic example
726
+ # require "google/cloud/datastore/admin/v1"
727
+ #
728
+ # # Create a client object. The client can be reused for multiple calls.
729
+ # client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new
730
+ #
731
+ # # Create a request. To set request fields, pass in keyword arguments.
732
+ # request = Google::Cloud::Datastore::Admin::V1::GetIndexRequest.new
733
+ #
734
+ # # Call the get_index method.
735
+ # result = client.get_index request
736
+ #
737
+ # # The returned object is of type Google::Cloud::Datastore::Admin::V1::Index.
738
+ # p result
739
+ #
626
740
  def get_index request, options = nil
627
741
  raise ::ArgumentError, "request must be provided" if request.nil?
628
742
 
@@ -640,10 +754,14 @@ module Google
640
754
  gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
641
755
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
642
756
 
643
- header_params = {
644
- "project_id" => request.project_id,
645
- "index_id" => request.index_id
646
- }
757
+ header_params = {}
758
+ if request.project_id
759
+ header_params["project_id"] = request.project_id
760
+ end
761
+ if request.index_id
762
+ header_params["index_id"] = request.index_id
763
+ end
764
+
647
765
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
648
766
  metadata[:"x-goog-request-params"] ||= request_params_header
649
767
 
@@ -700,6 +818,27 @@ module Google
700
818
  #
701
819
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
702
820
  #
821
+ # @example Basic example
822
+ # require "google/cloud/datastore/admin/v1"
823
+ #
824
+ # # Create a client object. The client can be reused for multiple calls.
825
+ # client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new
826
+ #
827
+ # # Create a request. To set request fields, pass in keyword arguments.
828
+ # request = Google::Cloud::Datastore::Admin::V1::ListIndexesRequest.new
829
+ #
830
+ # # Call the list_indexes method.
831
+ # result = client.list_indexes request
832
+ #
833
+ # # The returned object is of type Gapic::PagedEnumerable. You can
834
+ # # iterate over all elements by calling #each, and the enumerable
835
+ # # will lazily make API calls to fetch subsequent pages. Other
836
+ # # methods are also available for managing paging directly.
837
+ # result.each do |response|
838
+ # # Each element is of type ::Google::Cloud::Datastore::Admin::V1::Index.
839
+ # p response
840
+ # end
841
+ #
703
842
  def list_indexes request, options = nil
704
843
  raise ::ArgumentError, "request must be provided" if request.nil?
705
844
 
@@ -717,9 +856,11 @@ module Google
717
856
  gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
718
857
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
719
858
 
720
- header_params = {
721
- "project_id" => request.project_id
722
- }
859
+ header_params = {}
860
+ if request.project_id
861
+ header_params["project_id"] = request.project_id
862
+ end
863
+
723
864
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
724
865
  metadata[:"x-goog-request-params"] ||= request_params_header
725
866
 
@@ -144,6 +144,27 @@ module Google
144
144
  #
145
145
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
146
146
  #
147
+ # @example Basic example
148
+ # require "google/longrunning"
149
+ #
150
+ # # Create a client object. The client can be reused for multiple calls.
151
+ # client = Google::Longrunning::Operations::Client.new
152
+ #
153
+ # # Create a request. To set request fields, pass in keyword arguments.
154
+ # request = Google::Longrunning::ListOperationsRequest.new
155
+ #
156
+ # # Call the list_operations method.
157
+ # result = client.list_operations request
158
+ #
159
+ # # The returned object is of type Gapic::PagedEnumerable. You can
160
+ # # iterate over all elements by calling #each, and the enumerable
161
+ # # will lazily make API calls to fetch subsequent pages. Other
162
+ # # methods are also available for managing paging directly.
163
+ # result.each do |response|
164
+ # # Each element is of type ::Google::Longrunning::Operation.
165
+ # p response
166
+ # end
167
+ #
147
168
  def list_operations request, options = nil
148
169
  raise ::ArgumentError, "request must be provided" if request.nil?
149
170
 
@@ -161,9 +182,11 @@ module Google
161
182
  gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
162
183
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
163
184
 
164
- header_params = {
165
- "name" => request.name
166
- }
185
+ header_params = {}
186
+ if request.name
187
+ header_params["name"] = request.name
188
+ end
189
+
167
190
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
168
191
  metadata[:"x-goog-request-params"] ||= request_params_header
169
192
 
@@ -216,6 +239,28 @@ module Google
216
239
  #
217
240
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
218
241
  #
242
+ # @example Basic example
243
+ # require "google/longrunning"
244
+ #
245
+ # # Create a client object. The client can be reused for multiple calls.
246
+ # client = Google::Longrunning::Operations::Client.new
247
+ #
248
+ # # Create a request. To set request fields, pass in keyword arguments.
249
+ # request = Google::Longrunning::GetOperationRequest.new
250
+ #
251
+ # # Call the get_operation method.
252
+ # result = client.get_operation request
253
+ #
254
+ # # The returned object is of type Gapic::Operation. You can use this
255
+ # # object to check the status of an operation, cancel it, or wait
256
+ # # for results. Here is how to block until completion:
257
+ # result.wait_until_done! timeout: 60
258
+ # if result.response?
259
+ # p result.response
260
+ # else
261
+ # puts "Error!"
262
+ # end
263
+ #
219
264
  def get_operation request, options = nil
220
265
  raise ::ArgumentError, "request must be provided" if request.nil?
221
266
 
@@ -233,9 +278,11 @@ module Google
233
278
  gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
234
279
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
235
280
 
236
- header_params = {
237
- "name" => request.name
238
- }
281
+ header_params = {}
282
+ if request.name
283
+ header_params["name"] = request.name
284
+ end
285
+
239
286
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
240
287
  metadata[:"x-goog-request-params"] ||= request_params_header
241
288
 
@@ -288,6 +335,21 @@ module Google
288
335
  #
289
336
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
290
337
  #
338
+ # @example Basic example
339
+ # require "google/longrunning"
340
+ #
341
+ # # Create a client object. The client can be reused for multiple calls.
342
+ # client = Google::Longrunning::Operations::Client.new
343
+ #
344
+ # # Create a request. To set request fields, pass in keyword arguments.
345
+ # request = Google::Longrunning::DeleteOperationRequest.new
346
+ #
347
+ # # Call the delete_operation method.
348
+ # result = client.delete_operation request
349
+ #
350
+ # # The returned object is of type Google::Protobuf::Empty.
351
+ # p result
352
+ #
291
353
  def delete_operation request, options = nil
292
354
  raise ::ArgumentError, "request must be provided" if request.nil?
293
355
 
@@ -305,9 +367,11 @@ module Google
305
367
  gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
306
368
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
307
369
 
308
- header_params = {
309
- "name" => request.name
310
- }
370
+ header_params = {}
371
+ if request.name
372
+ header_params["name"] = request.name
373
+ end
374
+
311
375
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
312
376
  metadata[:"x-goog-request-params"] ||= request_params_header
313
377
 
@@ -365,6 +429,21 @@ module Google
365
429
  #
366
430
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
367
431
  #
432
+ # @example Basic example
433
+ # require "google/longrunning"
434
+ #
435
+ # # Create a client object. The client can be reused for multiple calls.
436
+ # client = Google::Longrunning::Operations::Client.new
437
+ #
438
+ # # Create a request. To set request fields, pass in keyword arguments.
439
+ # request = Google::Longrunning::CancelOperationRequest.new
440
+ #
441
+ # # Call the cancel_operation method.
442
+ # result = client.cancel_operation request
443
+ #
444
+ # # The returned object is of type Google::Protobuf::Empty.
445
+ # p result
446
+ #
368
447
  def cancel_operation request, options = nil
369
448
  raise ::ArgumentError, "request must be provided" if request.nil?
370
449
 
@@ -382,9 +461,11 @@ module Google
382
461
  gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
383
462
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
384
463
 
385
- header_params = {
386
- "name" => request.name
387
- }
464
+ header_params = {}
465
+ if request.name
466
+ header_params["name"] = request.name
467
+ end
468
+
388
469
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
389
470
  metadata[:"x-goog-request-params"] ||= request_params_header
390
471
 
@@ -445,6 +526,28 @@ module Google
445
526
  #
446
527
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
447
528
  #
529
+ # @example Basic example
530
+ # require "google/longrunning"
531
+ #
532
+ # # Create a client object. The client can be reused for multiple calls.
533
+ # client = Google::Longrunning::Operations::Client.new
534
+ #
535
+ # # Create a request. To set request fields, pass in keyword arguments.
536
+ # request = Google::Longrunning::WaitOperationRequest.new
537
+ #
538
+ # # Call the wait_operation method.
539
+ # result = client.wait_operation request
540
+ #
541
+ # # The returned object is of type Gapic::Operation. You can use this
542
+ # # object to check the status of an operation, cancel it, or wait
543
+ # # for results. Here is how to block until completion:
544
+ # result.wait_until_done! timeout: 60
545
+ # if result.response?
546
+ # p result.response
547
+ # else
548
+ # puts "Error!"
549
+ # end
550
+ #
448
551
  def wait_operation request, options = nil
449
552
  raise ::ArgumentError, "request must be provided" if request.nil?
450
553
 
@@ -22,7 +22,7 @@ module Google
22
22
  module Datastore
23
23
  module Admin
24
24
  module V1
25
- VERSION = "0.4.4"
25
+ VERSION = "0.6.0"
26
26
  end
27
27
  end
28
28
  end
@@ -26,6 +26,8 @@ module Google
26
26
  ##
27
27
  # To load this package, including all its services, and instantiate a client:
28
28
  #
29
+ # @example
30
+ #
29
31
  # require "google/cloud/datastore/admin/v1"
30
32
  # client = ::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new
31
33
  #
@@ -7,8 +7,10 @@ require 'google/api/annotations_pb'
7
7
  require 'google/api/client_pb'
8
8
  require 'google/api/field_behavior_pb'
9
9
  require 'google/datastore/admin/v1/index_pb'
10
+ require 'google/datastore/admin/v1/migration_pb'
10
11
  require 'google/longrunning/operations_pb'
11
12
  require 'google/protobuf/timestamp_pb'
13
+
12
14
  Google::Protobuf::DescriptorPool.generated_pool.build do
13
15
  add_file("google/datastore/admin/v1/datastore_admin.proto", :syntax => :proto3) do
14
16
  add_message "google.datastore.admin.v1.CommonMetadata" do
@@ -92,6 +94,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
92
94
  optional :progress_entities, :message, 2, "google.datastore.admin.v1.Progress"
93
95
  optional :index_id, :string, 3
94
96
  end
97
+ add_message "google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata" do
98
+ optional :migration_state, :enum, 1, "google.datastore.admin.v1.MigrationState"
99
+ optional :migration_step, :enum, 2, "google.datastore.admin.v1.MigrationStep"
100
+ end
95
101
  add_enum "google.datastore.admin.v1.OperationType" do
96
102
  value :OPERATION_TYPE_UNSPECIFIED, 0
97
103
  value :EXPORT_ENTITIES, 1
@@ -122,6 +128,7 @@ module Google
122
128
  ListIndexesRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.ListIndexesRequest").msgclass
123
129
  ListIndexesResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.ListIndexesResponse").msgclass
124
130
  IndexOperationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.IndexOperationMetadata").msgclass
131
+ DatastoreFirestoreMigrationMetadata = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.DatastoreFirestoreMigrationMetadata").msgclass
125
132
  OperationType = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.OperationType").enummodule
126
133
  end
127
134
  end
@@ -1,7 +1,7 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # Source: google/datastore/admin/v1/datastore_admin.proto for package 'Google.Cloud.Datastore.Admin.V1'
3
3
  # Original file comments:
4
- # Copyright 2019 Google LLC.
4
+ # Copyright 2021 Google LLC
5
5
  #
6
6
  # Licensed under the Apache License, Version 2.0 (the "License");
7
7
  # you may not use this file except in compliance with the License.
@@ -88,7 +88,7 @@ module Google
88
88
  # but are accessed via service google.longrunning.Operations.
89
89
  class Service
90
90
 
91
- include GRPC::GenericService
91
+ include ::GRPC::GenericService
92
92
 
93
93
  self.marshal_class_method = :encode
94
94
  self.unmarshal_class_method = :decode
@@ -4,7 +4,7 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  require 'google/api/field_behavior_pb'
7
- require 'google/api/annotations_pb'
7
+
8
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
9
  add_file("google/datastore/admin/v1/index.proto", :syntax => :proto3) do
10
10
  add_message "google.datastore.admin.v1.Index" do
@@ -0,0 +1,65 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: google/datastore/admin/v1/migration.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_file("google/datastore/admin/v1/migration.proto", :syntax => :proto3) do
8
+ add_message "google.datastore.admin.v1.MigrationStateEvent" do
9
+ optional :state, :enum, 1, "google.datastore.admin.v1.MigrationState"
10
+ end
11
+ add_message "google.datastore.admin.v1.MigrationProgressEvent" do
12
+ optional :step, :enum, 1, "google.datastore.admin.v1.MigrationStep"
13
+ oneof :step_details do
14
+ optional :prepare_step_details, :message, 2, "google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails"
15
+ optional :redirect_writes_step_details, :message, 3, "google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails"
16
+ end
17
+ end
18
+ add_message "google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails" do
19
+ optional :concurrency_mode, :enum, 1, "google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode"
20
+ end
21
+ add_message "google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails" do
22
+ optional :concurrency_mode, :enum, 1, "google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode"
23
+ end
24
+ add_enum "google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode" do
25
+ value :CONCURRENCY_MODE_UNSPECIFIED, 0
26
+ value :PESSIMISTIC, 1
27
+ value :OPTIMISTIC, 2
28
+ value :OPTIMISTIC_WITH_ENTITY_GROUPS, 3
29
+ end
30
+ add_enum "google.datastore.admin.v1.MigrationState" do
31
+ value :MIGRATION_STATE_UNSPECIFIED, 0
32
+ value :RUNNING, 1
33
+ value :PAUSED, 2
34
+ value :COMPLETE, 3
35
+ end
36
+ add_enum "google.datastore.admin.v1.MigrationStep" do
37
+ value :MIGRATION_STEP_UNSPECIFIED, 0
38
+ value :PREPARE, 6
39
+ value :START, 1
40
+ value :APPLY_WRITES_SYNCHRONOUSLY, 7
41
+ value :COPY_AND_VERIFY, 2
42
+ value :REDIRECT_EVENTUALLY_CONSISTENT_READS, 3
43
+ value :REDIRECT_STRONGLY_CONSISTENT_READS, 4
44
+ value :REDIRECT_WRITES, 5
45
+ end
46
+ end
47
+ end
48
+
49
+ module Google
50
+ module Cloud
51
+ module Datastore
52
+ module Admin
53
+ module V1
54
+ MigrationStateEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.MigrationStateEvent").msgclass
55
+ MigrationProgressEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.MigrationProgressEvent").msgclass
56
+ MigrationProgressEvent::PrepareStepDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.MigrationProgressEvent.PrepareStepDetails").msgclass
57
+ MigrationProgressEvent::RedirectWritesStepDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.MigrationProgressEvent.RedirectWritesStepDetails").msgclass
58
+ MigrationProgressEvent::ConcurrencyMode = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.MigrationProgressEvent.ConcurrencyMode").enummodule
59
+ MigrationState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.MigrationState").enummodule
60
+ MigrationStep = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.MigrationStep").enummodule
61
+ end
62
+ end
63
+ end
64
+ end
65
+ end
@@ -33,11 +33,7 @@ module Google
33
33
  # // For Kubernetes resources, the format is {api group}/{kind}.
34
34
  # option (google.api.resource) = {
35
35
  # type: "pubsub.googleapis.com/Topic"
36
- # name_descriptor: {
37
- # pattern: "projects/{project}/topics/{topic}"
38
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
39
- # parent_name_extractor: "projects/{project}"
40
- # }
36
+ # pattern: "projects/{project}/topics/{topic}"
41
37
  # };
42
38
  # }
43
39
  #
@@ -45,10 +41,7 @@ module Google
45
41
  #
46
42
  # resources:
47
43
  # - type: "pubsub.googleapis.com/Topic"
48
- # name_descriptor:
49
- # - pattern: "projects/{project}/topics/{topic}"
50
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
51
- # parent_name_extractor: "projects/{project}"
44
+ # pattern: "projects/{project}/topics/{topic}"
52
45
  #
53
46
  # Sometimes, resources have multiple patterns, typically because they can
54
47
  # live under multiple parents.
@@ -58,26 +51,10 @@ module Google
58
51
  # message LogEntry {
59
52
  # option (google.api.resource) = {
60
53
  # type: "logging.googleapis.com/LogEntry"
61
- # name_descriptor: {
62
- # pattern: "projects/{project}/logs/{log}"
63
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
64
- # parent_name_extractor: "projects/{project}"
65
- # }
66
- # name_descriptor: {
67
- # pattern: "folders/{folder}/logs/{log}"
68
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
69
- # parent_name_extractor: "folders/{folder}"
70
- # }
71
- # name_descriptor: {
72
- # pattern: "organizations/{organization}/logs/{log}"
73
- # parent_type: "cloudresourcemanager.googleapis.com/Organization"
74
- # parent_name_extractor: "organizations/{organization}"
75
- # }
76
- # name_descriptor: {
77
- # pattern: "billingAccounts/{billing_account}/logs/{log}"
78
- # parent_type: "billing.googleapis.com/BillingAccount"
79
- # parent_name_extractor: "billingAccounts/{billing_account}"
80
- # }
54
+ # pattern: "projects/{project}/logs/{log}"
55
+ # pattern: "folders/{folder}/logs/{log}"
56
+ # pattern: "organizations/{organization}/logs/{log}"
57
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
81
58
  # };
82
59
  # }
83
60
  #
@@ -85,48 +62,10 @@ module Google
85
62
  #
86
63
  # resources:
87
64
  # - type: 'logging.googleapis.com/LogEntry'
88
- # name_descriptor:
89
- # - pattern: "projects/{project}/logs/{log}"
90
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
91
- # parent_name_extractor: "projects/{project}"
92
- # - pattern: "folders/{folder}/logs/{log}"
93
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
94
- # parent_name_extractor: "folders/{folder}"
95
- # - pattern: "organizations/{organization}/logs/{log}"
96
- # parent_type: "cloudresourcemanager.googleapis.com/Organization"
97
- # parent_name_extractor: "organizations/{organization}"
98
- # - pattern: "billingAccounts/{billing_account}/logs/{log}"
99
- # parent_type: "billing.googleapis.com/BillingAccount"
100
- # parent_name_extractor: "billingAccounts/{billing_account}"
101
- #
102
- # For flexible resources, the resource name doesn't contain parent names, but
103
- # the resource itself has parents for policy evaluation.
104
- #
105
- # Example:
106
- #
107
- # message Shelf {
108
- # option (google.api.resource) = {
109
- # type: "library.googleapis.com/Shelf"
110
- # name_descriptor: {
111
- # pattern: "shelves/{shelf}"
112
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
113
- # }
114
- # name_descriptor: {
115
- # pattern: "shelves/{shelf}"
116
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
117
- # }
118
- # };
119
- # }
120
- #
121
- # The ResourceDescriptor Yaml config will look like:
122
- #
123
- # resources:
124
- # - type: 'library.googleapis.com/Shelf'
125
- # name_descriptor:
126
- # - pattern: "shelves/{shelf}"
127
- # parent_type: "cloudresourcemanager.googleapis.com/Project"
128
- # - pattern: "shelves/{shelf}"
129
- # parent_type: "cloudresourcemanager.googleapis.com/Folder"
65
+ # pattern: "projects/{project}/logs/{log}"
66
+ # pattern: "folders/{folder}/logs/{log}"
67
+ # pattern: "organizations/{organization}/logs/{log}"
68
+ # pattern: "billingAccounts/{billing_account}/logs/{log}"
130
69
  # @!attribute [rw] type
131
70
  # @return [::String]
132
71
  # The resource type. It must be in the format of
@@ -367,6 +367,27 @@ module Google
367
367
  extend ::Google::Protobuf::MessageExts::ClassMethods
368
368
  end
369
369
 
370
+ # Metadata for Datastore to Firestore migration operations.
371
+ #
372
+ # The DatastoreFirestoreMigration operation is not started by the end-user via
373
+ # an explicit "creation" method. This is an intentional deviation from the LRO
374
+ # design pattern.
375
+ #
376
+ # This singleton resource can be accessed at:
377
+ # "projects/\\{project_id}/operations/datastore-firestore-migration"
378
+ # @!attribute [rw] migration_state
379
+ # @return [::Google::Cloud::Datastore::Admin::V1::MigrationState]
380
+ # The current state of migration from Cloud Datastore to Cloud Firestore in
381
+ # Datastore mode.
382
+ # @!attribute [rw] migration_step
383
+ # @return [::Google::Cloud::Datastore::Admin::V1::MigrationStep]
384
+ # The current step of migration from Cloud Datastore to Cloud Firestore in
385
+ # Datastore mode.
386
+ class DatastoreFirestoreMigrationMetadata
387
+ include ::Google::Protobuf::MessageExts
388
+ extend ::Google::Protobuf::MessageExts::ClassMethods
389
+ end
390
+
370
391
  # Operation types.
371
392
  module OperationType
372
393
  # Unspecified.
@@ -0,0 +1,136 @@
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 Admin
24
+ module V1
25
+ # An event signifying a change in state of a [migration from Cloud Datastore to
26
+ # Cloud Firestore in Datastore
27
+ # mode](https://cloud.google.com/datastore/docs/upgrade-to-firestore).
28
+ # @!attribute [rw] state
29
+ # @return [::Google::Cloud::Datastore::Admin::V1::MigrationState]
30
+ # The new state of the migration.
31
+ class MigrationStateEvent
32
+ include ::Google::Protobuf::MessageExts
33
+ extend ::Google::Protobuf::MessageExts::ClassMethods
34
+ end
35
+
36
+ # An event signifying the start of a new step in a [migration from Cloud
37
+ # Datastore to Cloud Firestore in Datastore
38
+ # mode](https://cloud.google.com/datastore/docs/upgrade-to-firestore).
39
+ # @!attribute [rw] step
40
+ # @return [::Google::Cloud::Datastore::Admin::V1::MigrationStep]
41
+ # The step that is starting.
42
+ #
43
+ # An event with step set to `START` indicates that the migration
44
+ # has been reverted back to the initial pre-migration state.
45
+ # @!attribute [rw] prepare_step_details
46
+ # @return [::Google::Cloud::Datastore::Admin::V1::MigrationProgressEvent::PrepareStepDetails]
47
+ # Details for the `PREPARE` step.
48
+ # @!attribute [rw] redirect_writes_step_details
49
+ # @return [::Google::Cloud::Datastore::Admin::V1::MigrationProgressEvent::RedirectWritesStepDetails]
50
+ # Details for the `REDIRECT_WRITES` step.
51
+ class MigrationProgressEvent
52
+ include ::Google::Protobuf::MessageExts
53
+ extend ::Google::Protobuf::MessageExts::ClassMethods
54
+
55
+ # Details for the `PREPARE` step.
56
+ # @!attribute [rw] concurrency_mode
57
+ # @return [::Google::Cloud::Datastore::Admin::V1::MigrationProgressEvent::ConcurrencyMode]
58
+ # The concurrency mode this database will use when it reaches the
59
+ # `REDIRECT_WRITES` step.
60
+ class PrepareStepDetails
61
+ include ::Google::Protobuf::MessageExts
62
+ extend ::Google::Protobuf::MessageExts::ClassMethods
63
+ end
64
+
65
+ # Details for the `REDIRECT_WRITES` step.
66
+ # @!attribute [rw] concurrency_mode
67
+ # @return [::Google::Cloud::Datastore::Admin::V1::MigrationProgressEvent::ConcurrencyMode]
68
+ # Ths concurrency mode for this database.
69
+ class RedirectWritesStepDetails
70
+ include ::Google::Protobuf::MessageExts
71
+ extend ::Google::Protobuf::MessageExts::ClassMethods
72
+ end
73
+
74
+ # Concurrency modes for transactions in Cloud Firestore.
75
+ module ConcurrencyMode
76
+ # Unspecified.
77
+ CONCURRENCY_MODE_UNSPECIFIED = 0
78
+
79
+ # Pessimistic concurrency.
80
+ PESSIMISTIC = 1
81
+
82
+ # Optimistic concurrency.
83
+ OPTIMISTIC = 2
84
+
85
+ # Optimistic concurrency with entity groups.
86
+ OPTIMISTIC_WITH_ENTITY_GROUPS = 3
87
+ end
88
+ end
89
+
90
+ # States for a migration.
91
+ module MigrationState
92
+ # Unspecified.
93
+ MIGRATION_STATE_UNSPECIFIED = 0
94
+
95
+ # The migration is running.
96
+ RUNNING = 1
97
+
98
+ # The migration is paused.
99
+ PAUSED = 2
100
+
101
+ # The migration is complete.
102
+ COMPLETE = 3
103
+ end
104
+
105
+ # Steps in a migration.
106
+ module MigrationStep
107
+ # Unspecified.
108
+ MIGRATION_STEP_UNSPECIFIED = 0
109
+
110
+ # Pre-migration: the database is prepared for migration.
111
+ PREPARE = 6
112
+
113
+ # Start of migration.
114
+ START = 1
115
+
116
+ # Writes are applied synchronously to at least one replica.
117
+ APPLY_WRITES_SYNCHRONOUSLY = 7
118
+
119
+ # Data is copied to Cloud Firestore and then verified to match the data in
120
+ # Cloud Datastore.
121
+ COPY_AND_VERIFY = 2
122
+
123
+ # Eventually-consistent reads are redirected to Cloud Firestore.
124
+ REDIRECT_EVENTUALLY_CONSISTENT_READS = 3
125
+
126
+ # Strongly-consistent reads are redirected to Cloud Firestore.
127
+ REDIRECT_STRONGLY_CONSISTENT_READS = 4
128
+
129
+ # Writes are redirected to Cloud Firestore.
130
+ REDIRECT_WRITES = 5
131
+ end
132
+ end
133
+ end
134
+ end
135
+ end
136
+ end
@@ -44,7 +44,7 @@ module Google
44
44
  # foo = any.unpack(Foo.class);
45
45
  # }
46
46
  #
47
- # Example 3: Pack and unpack a message in Python.
47
+ # Example 3: Pack and unpack a message in Python.
48
48
  #
49
49
  # foo = Foo(...)
50
50
  # any = Any()
@@ -54,7 +54,7 @@ module Google
54
54
  # any.Unpack(foo)
55
55
  # ...
56
56
  #
57
- # Example 4: Pack and unpack a message in Go
57
+ # Example 4: Pack and unpack a message in Go
58
58
  #
59
59
  # foo := &pb.Foo{...}
60
60
  # any, err := anypb.New(foo)
@@ -75,7 +75,7 @@ module Google
75
75
  #
76
76
  #
77
77
  # JSON
78
- # ====
78
+ #
79
79
  # The JSON representation of an `Any` value uses the regular
80
80
  # representation of the deserialized, embedded message, with an
81
81
  # additional field `@type` which contains the type URL. Example:
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-cloud-datastore-admin-v1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.6.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: 2021-08-30 00:00:00.000000000 Z
11
+ date: 2022-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: gapic-common
@@ -179,11 +179,13 @@ files:
179
179
  - lib/google/datastore/admin/v1/datastore_admin_pb.rb
180
180
  - lib/google/datastore/admin/v1/datastore_admin_services_pb.rb
181
181
  - lib/google/datastore/admin/v1/index_pb.rb
182
+ - lib/google/datastore/admin/v1/migration_pb.rb
182
183
  - proto_docs/README.md
183
184
  - proto_docs/google/api/field_behavior.rb
184
185
  - proto_docs/google/api/resource.rb
185
186
  - proto_docs/google/datastore/admin/v1/datastore_admin.rb
186
187
  - proto_docs/google/datastore/admin/v1/index.rb
188
+ - proto_docs/google/datastore/admin/v1/migration.rb
187
189
  - proto_docs/google/longrunning/operations.rb
188
190
  - proto_docs/google/protobuf/any.rb
189
191
  - proto_docs/google/protobuf/duration.rb
@@ -209,7 +211,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
209
211
  - !ruby/object:Gem::Version
210
212
  version: '0'
211
213
  requirements: []
212
- rubygems_version: 3.2.17
214
+ rubygems_version: 3.3.14
213
215
  signing_key:
214
216
  specification_version: 4
215
217
  summary: API Client library for the Firestore in Datastore mode Admin V1 API