google-cloud-datastore-admin-v1 0.4.1 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 70e8125d7d78d12f94742fe2be8edf29892ff1ca5f863c8570c11c51dc598855
4
- data.tar.gz: 6cf0cc0c14053e413fa05141b1a8dd865fc854fabf846c48d9c726be6f06c5b8
3
+ metadata.gz: 49649dd73e8047afa2fdd6f4324843531b30001495a5918a28a540aa54806bf9
4
+ data.tar.gz: e5d2e462c04795ae11a6274f91efa852de564dafe4abe653bc96e2a20ebb751c
5
5
  SHA512:
6
- metadata.gz: 58b447806f7bb2e8ad263bd30f5e43eddb24f7e37e8b219986243fa4d3fd48078cc959fbe8657aae69b277497d2ff9d9a8fa6330df073db54c228d906cbd5ea6
7
- data.tar.gz: ffd5c1ed7588ccdb06b2492491fff9555c647a40588b3faaa7f65f9ebdb9eaac4fb94acc0485bbe86fad304d7457e6a02f202ceb1a6ad818f479f11958b8c409
6
+ metadata.gz: 0edb37d1f476ee9107bfdb260f0860465fc28ace395057971e7a54ede247442b1fb28a75ebd8a307922fd141990031c05521ef8440ad1229082a819b37d727c5
7
+ data.tar.gz: a615a1d94825f154fa6505ae4fa083ed454ca60f6db9d7f2e988f27f1edda5288f5ecdf2edeefa7e7e18d00b114c4b30436548a7a8d650bf9a478f3e4f72634c
data/AUTHENTICATION.md CHANGED
@@ -66,11 +66,11 @@ The environment variables that google-cloud-datastore-admin-v1
66
66
  checks for credentials are configured on the service Credentials class (such as
67
67
  {::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Credentials}):
68
68
 
69
- 1. `DATASTORE_CREDENTIALS` - Path to JSON file, or JSON contents
70
- 2. `DATASTORE_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
+ * `DATASTORE_CREDENTIALS` - Path to JSON file, or JSON contents
70
+ * `DATASTORE_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/datastore/admin/v1"
@@ -82,8 +82,8 @@ client = ::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::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/datastore/admin/v1"
@@ -93,7 +93,7 @@ client = ::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new do |c
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/datastore/admin/v1"
data/README.md CHANGED
@@ -9,7 +9,7 @@ https://github.com/googleapis/google-cloud-ruby
9
9
  This gem is a _versioned_ client. It provides basic client classes for a
10
10
  specific version of the Firestore in Datastore mode Admin V1 API. Most users should consider using
11
11
  the main client gem,
12
- [google-cloud-datastore-admin](https://rubygems.org/gems/google-cloud-datastore-admin).
12
+ [google-cloud-datastore](https://rubygems.org/gems/google-cloud-datastore).
13
13
  See the section below titled *Which client should I use?* for more information.
14
14
 
15
15
  ## Installation
@@ -33,7 +33,7 @@ In order to use this library, you first need to go through the following steps:
33
33
  require "google/cloud/datastore/admin/v1"
34
34
 
35
35
  client = ::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new
36
- request = my_create_request
36
+ request = ::Google::Cloud::Datastore::Admin::V1::ExportEntitiesRequest.new # (request fields as keyword arguments...)
37
37
  response = client.export_entities request
38
38
  ```
39
39
 
@@ -83,7 +83,7 @@ about the Ruby support schedule.
83
83
  ## Which client should I use?
84
84
 
85
85
  Most modern Ruby client libraries for Google APIs come in two flavors: the main
86
- client library with a name such as `google-cloud-datastore-admin`,
86
+ client library with a name such as `google-cloud-datastore`,
87
87
  and lower-level _versioned_ client libraries with names such as
88
88
  `google-cloud-datastore-admin-v1`.
89
89
  _In most cases, you should install the main client._
@@ -110,7 +110,7 @@ service version.
110
110
 
111
111
  We recommend that most users install the main client gem for a service. You can
112
112
  identify this gem as the one _without_ a version in its name, e.g.
113
- `google-cloud-datastore-admin`.
113
+ `google-cloud-datastore`.
114
114
  The main client is recommended because it will embody the best practices for
115
115
  accessing the service, and may also provide more convenient interfaces or
116
116
  tighter integration into frameworks and third-party libraries. In addition, the
@@ -100,13 +100,12 @@ module Google
100
100
  # See {::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client::Configuration}
101
101
  # for a description of the configuration fields.
102
102
  #
103
- # ## Example
103
+ # @example
104
104
  #
105
- # To modify the configuration for all DatastoreAdmin clients:
106
- #
107
- # ::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.configure do |config|
108
- # config.timeout = 10.0
109
- # end
105
+ # # Modify the configuration for all DatastoreAdmin clients
106
+ # ::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.configure do |config|
107
+ # config.timeout = 10.0
108
+ # end
110
109
  #
111
110
  # @yield [config] Configure the Client client.
112
111
  # @yieldparam config [Client::Configuration]
@@ -134,18 +133,12 @@ module Google
134
133
 
135
134
  default_config.rpcs.get_index.timeout = 60.0
136
135
  default_config.rpcs.get_index.retry_policy = {
137
- initial_delay: 0.1,
138
- max_delay: 60.0,
139
- multiplier: 1.3,
140
- retry_codes: [14, 4]
136
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
141
137
  }
142
138
 
143
139
  default_config.rpcs.list_indexes.timeout = 60.0
144
140
  default_config.rpcs.list_indexes.retry_policy = {
145
- initial_delay: 0.1,
146
- max_delay: 60.0,
147
- multiplier: 1.3,
148
- retry_codes: [14, 4]
141
+ initial_delay: 0.1, max_delay: 60.0, multiplier: 1.3, retry_codes: [14, 4]
149
142
  }
150
143
 
151
144
  default_config
@@ -177,19 +170,15 @@ module Google
177
170
  ##
178
171
  # Create a new DatastoreAdmin client object.
179
172
  #
180
- # ## Examples
181
- #
182
- # To create a new DatastoreAdmin client with the default
183
- # configuration:
173
+ # @example
184
174
  #
185
- # client = ::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new
175
+ # # Create a client using the default configuration
176
+ # client = ::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new
186
177
  #
187
- # To create a new DatastoreAdmin client with a custom
188
- # configuration:
189
- #
190
- # client = ::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new do |config|
191
- # config.timeout = 10.0
192
- # end
178
+ # # Create a client using a custom configuration
179
+ # client = ::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new do |config|
180
+ # config.timeout = 10.0
181
+ # end
193
182
  #
194
183
  # @yield [config] Configure the DatastoreAdmin client.
195
184
  # @yieldparam config [Client::Configuration]
@@ -209,14 +198,13 @@ module Google
209
198
 
210
199
  # Create credentials
211
200
  credentials = @config.credentials
212
- # 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,
213
202
  # but only if the default endpoint does not have a region prefix.
214
- enable_self_signed_jwt = @config.scope == Client.configure.scope &&
215
- @config.endpoint == Client.configure.endpoint &&
203
+ enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
216
204
  !@config.endpoint.split(".").first.include?("-")
217
205
  credentials ||= Credentials.default scope: @config.scope,
218
206
  enable_self_signed_jwt: enable_self_signed_jwt
219
- if credentials.is_a?(String) || credentials.is_a?(Hash)
207
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
220
208
  credentials = Credentials.new credentials, scope: @config.scope
221
209
  end
222
210
  @quota_project_id = @config.quota_project
@@ -304,6 +292,28 @@ module Google
304
292
  #
305
293
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
306
294
  #
295
+ # @example Basic example
296
+ # require "google/cloud/datastore/admin/v1"
297
+ #
298
+ # # Create a client object. The client can be reused for multiple calls.
299
+ # client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new
300
+ #
301
+ # # Create a request. To set request fields, pass in keyword arguments.
302
+ # request = Google::Cloud::Datastore::Admin::V1::ExportEntitiesRequest.new
303
+ #
304
+ # # Call the export_entities method.
305
+ # result = client.export_entities request
306
+ #
307
+ # # The returned object is of type Gapic::Operation. You can use this
308
+ # # object to check the status of an operation, cancel it, or wait
309
+ # # for results. Here is how to block until completion:
310
+ # result.wait_until_done! timeout: 60
311
+ # if result.response?
312
+ # p result.response
313
+ # else
314
+ # puts "Error!"
315
+ # end
316
+ #
307
317
  def export_entities request, options = nil
308
318
  raise ::ArgumentError, "request must be provided" if request.nil?
309
319
 
@@ -321,16 +331,20 @@ module Google
321
331
  gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
322
332
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
323
333
 
324
- header_params = {
325
- "project_id" => request.project_id
326
- }
334
+ header_params = {}
335
+ if request.project_id
336
+ header_params["project_id"] = request.project_id
337
+ end
338
+
327
339
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
328
340
  metadata[:"x-goog-request-params"] ||= request_params_header
329
341
 
330
342
  options.apply_defaults timeout: @config.rpcs.export_entities.timeout,
331
343
  metadata: metadata,
332
344
  retry_policy: @config.rpcs.export_entities.retry_policy
333
- options.apply_defaults metadata: @config.metadata,
345
+
346
+ options.apply_defaults timeout: @config.timeout,
347
+ metadata: @config.metadata,
334
348
  retry_policy: @config.retry_policy
335
349
 
336
350
  @datastore_admin_stub.call_rpc :export_entities, request, options: options do |response, operation|
@@ -396,6 +410,28 @@ module Google
396
410
  #
397
411
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
398
412
  #
413
+ # @example Basic example
414
+ # require "google/cloud/datastore/admin/v1"
415
+ #
416
+ # # Create a client object. The client can be reused for multiple calls.
417
+ # client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new
418
+ #
419
+ # # Create a request. To set request fields, pass in keyword arguments.
420
+ # request = Google::Cloud::Datastore::Admin::V1::ImportEntitiesRequest.new
421
+ #
422
+ # # Call the import_entities method.
423
+ # result = client.import_entities request
424
+ #
425
+ # # The returned object is of type Gapic::Operation. You can use this
426
+ # # object to check the status of an operation, cancel it, or wait
427
+ # # for results. Here is how to block until completion:
428
+ # result.wait_until_done! timeout: 60
429
+ # if result.response?
430
+ # p result.response
431
+ # else
432
+ # puts "Error!"
433
+ # end
434
+ #
399
435
  def import_entities request, options = nil
400
436
  raise ::ArgumentError, "request must be provided" if request.nil?
401
437
 
@@ -413,16 +449,20 @@ module Google
413
449
  gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
414
450
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
415
451
 
416
- header_params = {
417
- "project_id" => request.project_id
418
- }
452
+ header_params = {}
453
+ if request.project_id
454
+ header_params["project_id"] = request.project_id
455
+ end
456
+
419
457
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
420
458
  metadata[:"x-goog-request-params"] ||= request_params_header
421
459
 
422
460
  options.apply_defaults timeout: @config.rpcs.import_entities.timeout,
423
461
  metadata: metadata,
424
462
  retry_policy: @config.rpcs.import_entities.retry_policy
425
- options.apply_defaults metadata: @config.metadata,
463
+
464
+ options.apply_defaults timeout: @config.timeout,
465
+ metadata: @config.metadata,
426
466
  retry_policy: @config.retry_policy
427
467
 
428
468
  @datastore_admin_stub.call_rpc :import_entities, request, options: options do |response, operation|
@@ -479,6 +519,28 @@ module Google
479
519
  #
480
520
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
481
521
  #
522
+ # @example Basic example
523
+ # require "google/cloud/datastore/admin/v1"
524
+ #
525
+ # # Create a client object. The client can be reused for multiple calls.
526
+ # client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new
527
+ #
528
+ # # Create a request. To set request fields, pass in keyword arguments.
529
+ # request = Google::Cloud::Datastore::Admin::V1::CreateIndexRequest.new
530
+ #
531
+ # # Call the create_index method.
532
+ # result = client.create_index request
533
+ #
534
+ # # The returned object is of type Gapic::Operation. You can use this
535
+ # # object to check the status of an operation, cancel it, or wait
536
+ # # for results. Here is how to block until completion:
537
+ # result.wait_until_done! timeout: 60
538
+ # if result.response?
539
+ # p result.response
540
+ # else
541
+ # puts "Error!"
542
+ # end
543
+ #
482
544
  def create_index request, options = nil
483
545
  raise ::ArgumentError, "request must be provided" if request.nil?
484
546
 
@@ -496,16 +558,20 @@ module Google
496
558
  gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
497
559
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
498
560
 
499
- header_params = {
500
- "project_id" => request.project_id
501
- }
561
+ header_params = {}
562
+ if request.project_id
563
+ header_params["project_id"] = request.project_id
564
+ end
565
+
502
566
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
503
567
  metadata[:"x-goog-request-params"] ||= request_params_header
504
568
 
505
569
  options.apply_defaults timeout: @config.rpcs.create_index.timeout,
506
570
  metadata: metadata,
507
571
  retry_policy: @config.rpcs.create_index.retry_policy
508
- options.apply_defaults metadata: @config.metadata,
572
+
573
+ options.apply_defaults timeout: @config.timeout,
574
+ metadata: @config.metadata,
509
575
  retry_policy: @config.retry_policy
510
576
 
511
577
  @datastore_admin_stub.call_rpc :create_index, request, options: options do |response, operation|
@@ -557,6 +623,28 @@ module Google
557
623
  #
558
624
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
559
625
  #
626
+ # @example Basic example
627
+ # require "google/cloud/datastore/admin/v1"
628
+ #
629
+ # # Create a client object. The client can be reused for multiple calls.
630
+ # client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new
631
+ #
632
+ # # Create a request. To set request fields, pass in keyword arguments.
633
+ # request = Google::Cloud::Datastore::Admin::V1::DeleteIndexRequest.new
634
+ #
635
+ # # Call the delete_index method.
636
+ # result = client.delete_index request
637
+ #
638
+ # # The returned object is of type Gapic::Operation. You can use this
639
+ # # object to check the status of an operation, cancel it, or wait
640
+ # # for results. Here is how to block until completion:
641
+ # result.wait_until_done! timeout: 60
642
+ # if result.response?
643
+ # p result.response
644
+ # else
645
+ # puts "Error!"
646
+ # end
647
+ #
560
648
  def delete_index request, options = nil
561
649
  raise ::ArgumentError, "request must be provided" if request.nil?
562
650
 
@@ -574,17 +662,23 @@ module Google
574
662
  gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
575
663
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
576
664
 
577
- header_params = {
578
- "project_id" => request.project_id,
579
- "index_id" => request.index_id
580
- }
665
+ header_params = {}
666
+ if request.project_id
667
+ header_params["project_id"] = request.project_id
668
+ end
669
+ if request.index_id
670
+ header_params["index_id"] = request.index_id
671
+ end
672
+
581
673
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
582
674
  metadata[:"x-goog-request-params"] ||= request_params_header
583
675
 
584
676
  options.apply_defaults timeout: @config.rpcs.delete_index.timeout,
585
677
  metadata: metadata,
586
678
  retry_policy: @config.rpcs.delete_index.retry_policy
587
- options.apply_defaults metadata: @config.metadata,
679
+
680
+ options.apply_defaults timeout: @config.timeout,
681
+ metadata: @config.metadata,
588
682
  retry_policy: @config.retry_policy
589
683
 
590
684
  @datastore_admin_stub.call_rpc :delete_index, request, options: options do |response, operation|
@@ -627,6 +721,21 @@ module Google
627
721
  #
628
722
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
629
723
  #
724
+ # @example Basic example
725
+ # require "google/cloud/datastore/admin/v1"
726
+ #
727
+ # # Create a client object. The client can be reused for multiple calls.
728
+ # client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new
729
+ #
730
+ # # Create a request. To set request fields, pass in keyword arguments.
731
+ # request = Google::Cloud::Datastore::Admin::V1::GetIndexRequest.new
732
+ #
733
+ # # Call the get_index method.
734
+ # result = client.get_index request
735
+ #
736
+ # # The returned object is of type Google::Cloud::Datastore::Admin::V1::Index.
737
+ # p result
738
+ #
630
739
  def get_index request, options = nil
631
740
  raise ::ArgumentError, "request must be provided" if request.nil?
632
741
 
@@ -644,17 +753,23 @@ module Google
644
753
  gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
645
754
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
646
755
 
647
- header_params = {
648
- "project_id" => request.project_id,
649
- "index_id" => request.index_id
650
- }
756
+ header_params = {}
757
+ if request.project_id
758
+ header_params["project_id"] = request.project_id
759
+ end
760
+ if request.index_id
761
+ header_params["index_id"] = request.index_id
762
+ end
763
+
651
764
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
652
765
  metadata[:"x-goog-request-params"] ||= request_params_header
653
766
 
654
767
  options.apply_defaults timeout: @config.rpcs.get_index.timeout,
655
768
  metadata: metadata,
656
769
  retry_policy: @config.rpcs.get_index.retry_policy
657
- options.apply_defaults metadata: @config.metadata,
770
+
771
+ options.apply_defaults timeout: @config.timeout,
772
+ metadata: @config.metadata,
658
773
  retry_policy: @config.retry_policy
659
774
 
660
775
  @datastore_admin_stub.call_rpc :get_index, request, options: options do |response, operation|
@@ -702,6 +817,27 @@ module Google
702
817
  #
703
818
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
704
819
  #
820
+ # @example Basic example
821
+ # require "google/cloud/datastore/admin/v1"
822
+ #
823
+ # # Create a client object. The client can be reused for multiple calls.
824
+ # client = Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new
825
+ #
826
+ # # Create a request. To set request fields, pass in keyword arguments.
827
+ # request = Google::Cloud::Datastore::Admin::V1::ListIndexesRequest.new
828
+ #
829
+ # # Call the list_indexes method.
830
+ # result = client.list_indexes request
831
+ #
832
+ # # The returned object is of type Gapic::PagedEnumerable. You can
833
+ # # iterate over all elements by calling #each, and the enumerable
834
+ # # will lazily make API calls to fetch subsequent pages. Other
835
+ # # methods are also available for managing paging directly.
836
+ # result.each do |response|
837
+ # # Each element is of type ::Google::Cloud::Datastore::Admin::V1::Index.
838
+ # p response
839
+ # end
840
+ #
705
841
  def list_indexes request, options = nil
706
842
  raise ::ArgumentError, "request must be provided" if request.nil?
707
843
 
@@ -719,16 +855,20 @@ module Google
719
855
  gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
720
856
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
721
857
 
722
- header_params = {
723
- "project_id" => request.project_id
724
- }
858
+ header_params = {}
859
+ if request.project_id
860
+ header_params["project_id"] = request.project_id
861
+ end
862
+
725
863
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
726
864
  metadata[:"x-goog-request-params"] ||= request_params_header
727
865
 
728
866
  options.apply_defaults timeout: @config.rpcs.list_indexes.timeout,
729
867
  metadata: metadata,
730
868
  retry_policy: @config.rpcs.list_indexes.retry_policy
731
- options.apply_defaults metadata: @config.metadata,
869
+
870
+ options.apply_defaults timeout: @config.timeout,
871
+ metadata: @config.metadata,
732
872
  retry_policy: @config.retry_policy
733
873
 
734
874
  @datastore_admin_stub.call_rpc :list_indexes, request, options: options do |response, operation|
@@ -753,22 +893,21 @@ module Google
753
893
  # Configuration can be applied globally to all clients, or to a single client
754
894
  # on construction.
755
895
  #
756
- # # Examples
757
- #
758
- # To modify the global config, setting the timeout for export_entities
759
- # to 20 seconds, and all remaining timeouts to 10 seconds:
760
- #
761
- # ::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.configure do |config|
762
- # config.timeout = 10.0
763
- # config.rpcs.export_entities.timeout = 20.0
764
- # end
765
- #
766
- # To apply the above configuration only to a new client:
767
- #
768
- # client = ::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new do |config|
769
- # config.timeout = 10.0
770
- # config.rpcs.export_entities.timeout = 20.0
771
- # end
896
+ # @example
897
+ #
898
+ # # Modify the global config, setting the timeout for
899
+ # # export_entities to 20 seconds,
900
+ # # and all remaining timeouts to 10 seconds.
901
+ # ::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.configure do |config|
902
+ # config.timeout = 10.0
903
+ # config.rpcs.export_entities.timeout = 20.0
904
+ # end
905
+ #
906
+ # # Apply the above configuration only to a new client.
907
+ # client = ::Google::Cloud::Datastore::Admin::V1::DatastoreAdmin::Client.new do |config|
908
+ # config.timeout = 10.0
909
+ # config.rpcs.export_entities.timeout = 20.0
910
+ # end
772
911
  #
773
912
  # @!attribute [rw] endpoint
774
913
  # The hostname or hostname:port of the service endpoint.
@@ -83,7 +83,7 @@ module Google
83
83
  # Create credentials
84
84
  credentials = @config.credentials
85
85
  credentials ||= Credentials.default scope: @config.scope
86
- if credentials.is_a?(String) || credentials.is_a?(Hash)
86
+ if credentials.is_a?(::String) || credentials.is_a?(::Hash)
87
87
  credentials = Credentials.new credentials, scope: @config.scope
88
88
  end
89
89
  @quota_project_id = @config.quota_project
@@ -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,16 +182,20 @@ 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
 
170
193
  options.apply_defaults timeout: @config.rpcs.list_operations.timeout,
171
194
  metadata: metadata,
172
195
  retry_policy: @config.rpcs.list_operations.retry_policy
173
- options.apply_defaults metadata: @config.metadata,
196
+
197
+ options.apply_defaults timeout: @config.timeout,
198
+ metadata: @config.metadata,
174
199
  retry_policy: @config.retry_policy
175
200
 
176
201
  @operations_stub.call_rpc :list_operations, request, options: options do |response, operation|
@@ -214,6 +239,28 @@ module Google
214
239
  #
215
240
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
216
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
+ #
217
264
  def get_operation request, options = nil
218
265
  raise ::ArgumentError, "request must be provided" if request.nil?
219
266
 
@@ -231,16 +278,20 @@ module Google
231
278
  gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
232
279
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
233
280
 
234
- header_params = {
235
- "name" => request.name
236
- }
281
+ header_params = {}
282
+ if request.name
283
+ header_params["name"] = request.name
284
+ end
285
+
237
286
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
238
287
  metadata[:"x-goog-request-params"] ||= request_params_header
239
288
 
240
289
  options.apply_defaults timeout: @config.rpcs.get_operation.timeout,
241
290
  metadata: metadata,
242
291
  retry_policy: @config.rpcs.get_operation.retry_policy
243
- options.apply_defaults metadata: @config.metadata,
292
+
293
+ options.apply_defaults timeout: @config.timeout,
294
+ metadata: @config.metadata,
244
295
  retry_policy: @config.retry_policy
245
296
 
246
297
  @operations_stub.call_rpc :get_operation, request, options: options do |response, operation|
@@ -284,6 +335,21 @@ module Google
284
335
  #
285
336
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
286
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
+ #
287
353
  def delete_operation request, options = nil
288
354
  raise ::ArgumentError, "request must be provided" if request.nil?
289
355
 
@@ -301,16 +367,20 @@ module Google
301
367
  gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
302
368
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
303
369
 
304
- header_params = {
305
- "name" => request.name
306
- }
370
+ header_params = {}
371
+ if request.name
372
+ header_params["name"] = request.name
373
+ end
374
+
307
375
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
308
376
  metadata[:"x-goog-request-params"] ||= request_params_header
309
377
 
310
378
  options.apply_defaults timeout: @config.rpcs.delete_operation.timeout,
311
379
  metadata: metadata,
312
380
  retry_policy: @config.rpcs.delete_operation.retry_policy
313
- options.apply_defaults metadata: @config.metadata,
381
+
382
+ options.apply_defaults timeout: @config.timeout,
383
+ metadata: @config.metadata,
314
384
  retry_policy: @config.retry_policy
315
385
 
316
386
  @operations_stub.call_rpc :delete_operation, request, options: options do |response, operation|
@@ -359,6 +429,21 @@ module Google
359
429
  #
360
430
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
361
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
+ #
362
447
  def cancel_operation request, options = nil
363
448
  raise ::ArgumentError, "request must be provided" if request.nil?
364
449
 
@@ -376,16 +461,20 @@ module Google
376
461
  gapic_version: ::Google::Cloud::Datastore::Admin::V1::VERSION
377
462
  metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
378
463
 
379
- header_params = {
380
- "name" => request.name
381
- }
464
+ header_params = {}
465
+ if request.name
466
+ header_params["name"] = request.name
467
+ end
468
+
382
469
  request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
383
470
  metadata[:"x-goog-request-params"] ||= request_params_header
384
471
 
385
472
  options.apply_defaults timeout: @config.rpcs.cancel_operation.timeout,
386
473
  metadata: metadata,
387
474
  retry_policy: @config.rpcs.cancel_operation.retry_policy
388
- options.apply_defaults metadata: @config.metadata,
475
+
476
+ options.apply_defaults timeout: @config.timeout,
477
+ metadata: @config.metadata,
389
478
  retry_policy: @config.retry_policy
390
479
 
391
480
  @operations_stub.call_rpc :cancel_operation, request, options: options do |response, operation|
@@ -397,9 +486,9 @@ module Google
397
486
  end
398
487
 
399
488
  ##
400
- # Waits for the specified long-running operation until it is done or reaches
401
- # at most a specified timeout, returning the latest state. If the operation
402
- # is already done, the latest state is immediately returned. If the timeout
489
+ # Waits until the specified long-running operation is done or reaches at most
490
+ # a specified timeout, returning the latest state. If the operation is
491
+ # already done, the latest state is immediately returned. If the timeout
403
492
  # specified is greater than the default HTTP/RPC timeout, the HTTP/RPC
404
493
  # timeout is used. If the server does not support this method, it returns
405
494
  # `google.rpc.Code.UNIMPLEMENTED`.
@@ -437,6 +526,28 @@ module Google
437
526
  #
438
527
  # @raise [::Google::Cloud::Error] if the RPC is aborted.
439
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
+ #
440
551
  def wait_operation request, options = nil
441
552
  raise ::ArgumentError, "request must be provided" if request.nil?
442
553
 
@@ -457,7 +568,9 @@ module Google
457
568
  options.apply_defaults timeout: @config.rpcs.wait_operation.timeout,
458
569
  metadata: metadata,
459
570
  retry_policy: @config.rpcs.wait_operation.retry_policy
460
- options.apply_defaults metadata: @config.metadata,
571
+
572
+ options.apply_defaults timeout: @config.timeout,
573
+ metadata: @config.metadata,
461
574
  retry_policy: @config.retry_policy
462
575
 
463
576
  @operations_stub.call_rpc :wait_operation, request, options: options do |response, operation|
@@ -482,22 +595,21 @@ module Google
482
595
  # Configuration can be applied globally to all clients, or to a single client
483
596
  # on construction.
484
597
  #
485
- # # Examples
486
- #
487
- # To modify the global config, setting the timeout for list_operations
488
- # to 20 seconds, and all remaining timeouts to 10 seconds:
489
- #
490
- # ::Google::Longrunning::Operations::Client.configure do |config|
491
- # config.timeout = 10.0
492
- # config.rpcs.list_operations.timeout = 20.0
493
- # end
494
- #
495
- # To apply the above configuration only to a new client:
496
- #
497
- # client = ::Google::Longrunning::Operations::Client.new do |config|
498
- # config.timeout = 10.0
499
- # config.rpcs.list_operations.timeout = 20.0
500
- # end
598
+ # @example
599
+ #
600
+ # # Modify the global config, setting the timeout for
601
+ # # list_operations to 20 seconds,
602
+ # # and all remaining timeouts to 10 seconds.
603
+ # ::Google::Longrunning::Operations::Client.configure do |config|
604
+ # config.timeout = 10.0
605
+ # config.rpcs.list_operations.timeout = 20.0
606
+ # end
607
+ #
608
+ # # Apply the above configuration only to a new client.
609
+ # client = ::Google::Longrunning::Operations::Client.new do |config|
610
+ # config.timeout = 10.0
611
+ # config.rpcs.list_operations.timeout = 20.0
612
+ # end
501
613
  #
502
614
  # @!attribute [rw] endpoint
503
615
  # The hostname or hostname:port of the service endpoint.
@@ -22,7 +22,7 @@ module Google
22
22
  module Datastore
23
23
  module Admin
24
24
  module V1
25
- VERSION = "0.4.1"
25
+ VERSION = "0.4.5"
26
26
  end
27
27
  end
28
28
  end
@@ -1,14 +1,14 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/datastore/admin/v1/datastore_admin.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'
9
7
  require 'google/datastore/admin/v1/index_pb'
10
8
  require 'google/longrunning/operations_pb'
11
9
  require 'google/protobuf/timestamp_pb'
10
+ require 'google/protobuf'
11
+
12
12
  Google::Protobuf::DescriptorPool.generated_pool.build do
13
13
  add_file("google/datastore/admin/v1/datastore_admin.proto", :syntax => :proto3) do
14
14
  add_message "google.datastore.admin.v1.CommonMetadata" do
@@ -1,10 +1,10 @@
1
1
  # Generated by the protocol buffer compiler. DO NOT EDIT!
2
2
  # source: google/datastore/admin/v1/index.proto
3
3
 
4
- require 'google/protobuf'
5
-
6
4
  require 'google/api/field_behavior_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/datastore/admin/v1/index.proto", :syntax => :proto3) do
10
10
  add_message "google.datastore.admin.v1.Index" 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,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.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-06-17 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
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.5'
19
+ version: '0.7'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: 2.a
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '0.5'
29
+ version: '0.7'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: 2.a
@@ -159,8 +159,7 @@ dependencies:
159
159
  description: Firestore in Datastore mode is a NoSQL document database built for automatic
160
160
  scaling, high performance, and ease of application development. Note that google-cloud-datastore-admin-v1
161
161
  is a version-specific client library. For most uses, we recommend installing the
162
- main client library google-cloud-datastore-admin instead. See the readme for more
163
- details.
162
+ main client library google-cloud-datastore instead. See the readme for more details.
164
163
  email: googleapis-packages@google.com
165
164
  executables: []
166
165
  extensions: []
@@ -180,13 +179,11 @@ files:
180
179
  - lib/google/datastore/admin/v1/datastore_admin_pb.rb
181
180
  - lib/google/datastore/admin/v1/datastore_admin_services_pb.rb
182
181
  - lib/google/datastore/admin/v1/index_pb.rb
183
- - lib/google/datastore/admin/v1/migration_pb.rb
184
182
  - proto_docs/README.md
185
183
  - proto_docs/google/api/field_behavior.rb
186
184
  - proto_docs/google/api/resource.rb
187
185
  - proto_docs/google/datastore/admin/v1/datastore_admin.rb
188
186
  - proto_docs/google/datastore/admin/v1/index.rb
189
- - proto_docs/google/datastore/admin/v1/migration.rb
190
187
  - proto_docs/google/longrunning/operations.rb
191
188
  - proto_docs/google/protobuf/any.rb
192
189
  - proto_docs/google/protobuf/duration.rb
@@ -1,44 +0,0 @@
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
- end
14
- add_enum "google.datastore.admin.v1.MigrationState" do
15
- value :MIGRATION_STATE_UNSPECIFIED, 0
16
- value :RUNNING, 1
17
- value :PAUSED, 2
18
- value :COMPLETE, 3
19
- end
20
- add_enum "google.datastore.admin.v1.MigrationStep" do
21
- value :MIGRATION_STEP_UNSPECIFIED, 0
22
- value :START, 1
23
- value :COPY_AND_VERIFY, 2
24
- value :REDIRECT_EVENTUALLY_CONSISTENT_READS, 3
25
- value :REDIRECT_STRONGLY_CONSISTENT_READS, 4
26
- value :REDIRECT_WRITES, 5
27
- end
28
- end
29
- end
30
-
31
- module Google
32
- module Cloud
33
- module Datastore
34
- module Admin
35
- module V1
36
- MigrationStateEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.MigrationStateEvent").msgclass
37
- MigrationProgressEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.MigrationProgressEvent").msgclass
38
- MigrationState = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.MigrationState").enummodule
39
- MigrationStep = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("google.datastore.admin.v1.MigrationStep").enummodule
40
- end
41
- end
42
- end
43
- end
44
- end
@@ -1,90 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Copyright 2021 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
- class MigrationProgressEvent
46
- include ::Google::Protobuf::MessageExts
47
- extend ::Google::Protobuf::MessageExts::ClassMethods
48
- end
49
-
50
- # States for a migration.
51
- module MigrationState
52
- # Unspecified.
53
- MIGRATION_STATE_UNSPECIFIED = 0
54
-
55
- # The migration is running.
56
- RUNNING = 1
57
-
58
- # The migration is paused.
59
- PAUSED = 2
60
-
61
- # The migration is complete.
62
- COMPLETE = 3
63
- end
64
-
65
- # Steps in a migration.
66
- module MigrationStep
67
- # Unspecified.
68
- MIGRATION_STEP_UNSPECIFIED = 0
69
-
70
- # Start of migration.
71
- START = 1
72
-
73
- # Data is copied to Cloud Firestore and then verified to match the data in
74
- # Cloud Datastore.
75
- COPY_AND_VERIFY = 2
76
-
77
- # Eventually-consistent reads are redirected to Cloud Firestore.
78
- REDIRECT_EVENTUALLY_CONSISTENT_READS = 3
79
-
80
- # Strongly-consistent reads are redirected to Cloud Firestore.
81
- REDIRECT_STRONGLY_CONSISTENT_READS = 4
82
-
83
- # Writes are redirected to Cloud Firestore.
84
- REDIRECT_WRITES = 5
85
- end
86
- end
87
- end
88
- end
89
- end
90
- end