google-cloud-firestore-admin-v1 0.9.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -181,7 +181,7 @@ module Google
181
181
  credentials = @config.credentials
182
182
  # Use self-signed JWT if the endpoint is unchanged from default,
183
183
  # but only if the default endpoint does not have a region prefix.
184
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
184
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
185
185
  !@config.endpoint.split(".").first.include?("-")
186
186
  credentials ||= Credentials.default scope: @config.scope,
187
187
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -224,9 +224,11 @@ module Google
224
224
  # Service calls
225
225
 
226
226
  ##
227
- # Creates a composite index. This returns a {::Google::Longrunning::Operation google.longrunning.Operation}
228
- # which may be used to track the status of the creation. The metadata for
229
- # the operation will be the type {::Google::Cloud::Firestore::Admin::V1::IndexOperationMetadata IndexOperationMetadata}.
227
+ # Creates a composite index. This returns a
228
+ # {::Google::Longrunning::Operation google.longrunning.Operation} which may be
229
+ # used to track the status of the creation. The metadata for the operation
230
+ # will be the type
231
+ # {::Google::Cloud::Firestore::Admin::V1::IndexOperationMetadata IndexOperationMetadata}.
230
232
  #
231
233
  # @overload create_index(request, options = nil)
232
234
  # Pass arguments to `create_index` via a request object, either of type
@@ -255,6 +257,29 @@ module Google
255
257
  # @return [::Gapic::Operation]
256
258
  #
257
259
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
260
+ #
261
+ # @example Basic example
262
+ # require "google/cloud/firestore/admin/v1"
263
+ #
264
+ # # Create a client object. The client can be reused for multiple calls.
265
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
266
+ #
267
+ # # Create a request. To set request fields, pass in keyword arguments.
268
+ # request = Google::Cloud::Firestore::Admin::V1::CreateIndexRequest.new
269
+ #
270
+ # # Call the create_index method.
271
+ # result = client.create_index request
272
+ #
273
+ # # The returned object is of type Gapic::Operation. You can use it to
274
+ # # check the status of an operation, cancel it, or wait for results.
275
+ # # Here is how to wait for a response.
276
+ # result.wait_until_done! timeout: 60
277
+ # if result.response?
278
+ # p result.response
279
+ # else
280
+ # puts "No response received."
281
+ # end
282
+ #
258
283
  def create_index request, options = nil
259
284
  raise ::ArgumentError, "request must be provided" if request.nil?
260
285
 
@@ -318,8 +343,8 @@ module Google
318
343
  # The number of results to return.
319
344
  # @param page_token [::String]
320
345
  # A page token, returned from a previous call to
321
- # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_indexes FirestoreAdmin.ListIndexes}, that may be used to get the next
322
- # page of results.
346
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_indexes FirestoreAdmin.ListIndexes},
347
+ # that may be used to get the next page of results.
323
348
  # @yield [result, operation] Access the result along with the TransportOperation object
324
349
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Index>]
325
350
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -327,6 +352,26 @@ module Google
327
352
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Index>]
328
353
  #
329
354
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
355
+ #
356
+ # @example Basic example
357
+ # require "google/cloud/firestore/admin/v1"
358
+ #
359
+ # # Create a client object. The client can be reused for multiple calls.
360
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
361
+ #
362
+ # # Create a request. To set request fields, pass in keyword arguments.
363
+ # request = Google::Cloud::Firestore::Admin::V1::ListIndexesRequest.new
364
+ #
365
+ # # Call the list_indexes method.
366
+ # result = client.list_indexes request
367
+ #
368
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
369
+ # # over elements, and API calls will be issued to fetch pages as needed.
370
+ # result.each do |item|
371
+ # # Each element is of type ::Google::Cloud::Firestore::Admin::V1::Index.
372
+ # p item
373
+ # end
374
+ #
330
375
  def list_indexes request, options = nil
331
376
  raise ::ArgumentError, "request must be provided" if request.nil?
332
377
 
@@ -391,6 +436,22 @@ module Google
391
436
  # @return [::Google::Cloud::Firestore::Admin::V1::Index]
392
437
  #
393
438
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
439
+ #
440
+ # @example Basic example
441
+ # require "google/cloud/firestore/admin/v1"
442
+ #
443
+ # # Create a client object. The client can be reused for multiple calls.
444
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
445
+ #
446
+ # # Create a request. To set request fields, pass in keyword arguments.
447
+ # request = Google::Cloud::Firestore::Admin::V1::GetIndexRequest.new
448
+ #
449
+ # # Call the get_index method.
450
+ # result = client.get_index request
451
+ #
452
+ # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Index.
453
+ # p result
454
+ #
394
455
  def get_index request, options = nil
395
456
  raise ::ArgumentError, "request must be provided" if request.nil?
396
457
 
@@ -454,6 +515,22 @@ module Google
454
515
  # @return [::Google::Protobuf::Empty]
455
516
  #
456
517
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
518
+ #
519
+ # @example Basic example
520
+ # require "google/cloud/firestore/admin/v1"
521
+ #
522
+ # # Create a client object. The client can be reused for multiple calls.
523
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
524
+ #
525
+ # # Create a request. To set request fields, pass in keyword arguments.
526
+ # request = Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest.new
527
+ #
528
+ # # Call the delete_index method.
529
+ # result = client.delete_index request
530
+ #
531
+ # # The returned object is of type Google::Protobuf::Empty.
532
+ # p result
533
+ #
457
534
  def delete_index request, options = nil
458
535
  raise ::ArgumentError, "request must be provided" if request.nil?
459
536
 
@@ -517,6 +594,22 @@ module Google
517
594
  # @return [::Google::Cloud::Firestore::Admin::V1::Field]
518
595
  #
519
596
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
597
+ #
598
+ # @example Basic example
599
+ # require "google/cloud/firestore/admin/v1"
600
+ #
601
+ # # Create a client object. The client can be reused for multiple calls.
602
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
603
+ #
604
+ # # Create a request. To set request fields, pass in keyword arguments.
605
+ # request = Google::Cloud::Firestore::Admin::V1::GetFieldRequest.new
606
+ #
607
+ # # Call the get_field method.
608
+ # result = client.get_field request
609
+ #
610
+ # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Field.
611
+ # p result
612
+ #
520
613
  def get_field request, options = nil
521
614
  raise ::ArgumentError, "request must be provided" if request.nil?
522
615
 
@@ -555,13 +648,16 @@ module Google
555
648
  ##
556
649
  # Updates a field configuration. Currently, field updates apply only to
557
650
  # single field index configuration. However, calls to
558
- # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#update_field FirestoreAdmin.UpdateField} should provide a field mask to avoid
559
- # changing any configuration that the caller isn't aware of. The field mask
560
- # should be specified as: `{ paths: "index_config" }`.
651
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#update_field FirestoreAdmin.UpdateField}
652
+ # should provide a field mask to avoid changing any configuration that the
653
+ # caller isn't aware of. The field mask should be specified as: `{ paths:
654
+ # "index_config" }`.
561
655
  #
562
- # This call returns a {::Google::Longrunning::Operation google.longrunning.Operation} which may be used to
563
- # track the status of the field update. The metadata for
564
- # the operation will be the type {::Google::Cloud::Firestore::Admin::V1::FieldOperationMetadata FieldOperationMetadata}.
656
+ # This call returns a
657
+ # {::Google::Longrunning::Operation google.longrunning.Operation} which may be
658
+ # used to track the status of the field update. The metadata for the
659
+ # operation will be the type
660
+ # {::Google::Cloud::Firestore::Admin::V1::FieldOperationMetadata FieldOperationMetadata}.
565
661
  #
566
662
  # To configure the default field settings for the database, use
567
663
  # the special `Field` with resource name:
@@ -594,6 +690,29 @@ module Google
594
690
  # @return [::Gapic::Operation]
595
691
  #
596
692
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
693
+ #
694
+ # @example Basic example
695
+ # require "google/cloud/firestore/admin/v1"
696
+ #
697
+ # # Create a client object. The client can be reused for multiple calls.
698
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
699
+ #
700
+ # # Create a request. To set request fields, pass in keyword arguments.
701
+ # request = Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest.new
702
+ #
703
+ # # Call the update_field method.
704
+ # result = client.update_field request
705
+ #
706
+ # # The returned object is of type Gapic::Operation. You can use it to
707
+ # # check the status of an operation, cancel it, or wait for results.
708
+ # # Here is how to wait for a response.
709
+ # result.wait_until_done! timeout: 60
710
+ # if result.response?
711
+ # p result.response
712
+ # else
713
+ # puts "No response received."
714
+ # end
715
+ #
597
716
  def update_field request, options = nil
598
717
  raise ::ArgumentError, "request must be provided" if request.nil?
599
718
 
@@ -633,10 +752,12 @@ module Google
633
752
  ##
634
753
  # Lists the field configuration and metadata for this database.
635
754
  #
636
- # Currently, {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields} only supports listing fields
637
- # that have been explicitly overridden. To issue this query, call
638
- # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields} with the filter set to
639
- # `indexConfig.usesAncestorConfig:false` .
755
+ # Currently,
756
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields}
757
+ # only supports listing fields that have been explicitly overridden. To issue
758
+ # this query, call
759
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields}
760
+ # with the filter set to `indexConfig.usesAncestorConfig:false` .
640
761
  #
641
762
  # @overload list_fields(request, options = nil)
642
763
  # Pass arguments to `list_fields` via a request object, either of type
@@ -658,16 +779,17 @@ module Google
658
779
  # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
659
780
  # @param filter [::String]
660
781
  # The filter to apply to list results. Currently,
661
- # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields} only supports listing fields
662
- # that have been explicitly overridden. To issue this query, call
663
- # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields} with a filter that includes
664
- # `indexConfig.usesAncestorConfig:false` .
782
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields}
783
+ # only supports listing fields that have been explicitly overridden. To issue
784
+ # this query, call
785
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields}
786
+ # with a filter that includes `indexConfig.usesAncestorConfig:false` .
665
787
  # @param page_size [::Integer]
666
788
  # The number of results to return.
667
789
  # @param page_token [::String]
668
790
  # A page token, returned from a previous call to
669
- # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields}, that may be used to get the next
670
- # page of results.
791
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields},
792
+ # that may be used to get the next page of results.
671
793
  # @yield [result, operation] Access the result along with the TransportOperation object
672
794
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Field>]
673
795
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -675,6 +797,26 @@ module Google
675
797
  # @return [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Field>]
676
798
  #
677
799
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
800
+ #
801
+ # @example Basic example
802
+ # require "google/cloud/firestore/admin/v1"
803
+ #
804
+ # # Create a client object. The client can be reused for multiple calls.
805
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
806
+ #
807
+ # # Create a request. To set request fields, pass in keyword arguments.
808
+ # request = Google::Cloud::Firestore::Admin::V1::ListFieldsRequest.new
809
+ #
810
+ # # Call the list_fields method.
811
+ # result = client.list_fields request
812
+ #
813
+ # # The returned object is of type Gapic::PagedEnumerable. You can iterate
814
+ # # over elements, and API calls will be issued to fetch pages as needed.
815
+ # result.each do |item|
816
+ # # Each element is of type ::Google::Cloud::Firestore::Admin::V1::Field.
817
+ # p item
818
+ # end
819
+ #
678
820
  def list_fields request, options = nil
679
821
  raise ::ArgumentError, "request must be provided" if request.nil?
680
822
 
@@ -760,6 +902,29 @@ module Google
760
902
  # @return [::Gapic::Operation]
761
903
  #
762
904
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
905
+ #
906
+ # @example Basic example
907
+ # require "google/cloud/firestore/admin/v1"
908
+ #
909
+ # # Create a client object. The client can be reused for multiple calls.
910
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
911
+ #
912
+ # # Create a request. To set request fields, pass in keyword arguments.
913
+ # request = Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest.new
914
+ #
915
+ # # Call the export_documents method.
916
+ # result = client.export_documents request
917
+ #
918
+ # # The returned object is of type Gapic::Operation. You can use it to
919
+ # # check the status of an operation, cancel it, or wait for results.
920
+ # # Here is how to wait for a response.
921
+ # result.wait_until_done! timeout: 60
922
+ # if result.response?
923
+ # p result.response
924
+ # else
925
+ # puts "No response received."
926
+ # end
927
+ #
763
928
  def export_documents request, options = nil
764
929
  raise ::ArgumentError, "request must be provided" if request.nil?
765
930
 
@@ -837,6 +1002,29 @@ module Google
837
1002
  # @return [::Gapic::Operation]
838
1003
  #
839
1004
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1005
+ #
1006
+ # @example Basic example
1007
+ # require "google/cloud/firestore/admin/v1"
1008
+ #
1009
+ # # Create a client object. The client can be reused for multiple calls.
1010
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
1011
+ #
1012
+ # # Create a request. To set request fields, pass in keyword arguments.
1013
+ # request = Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest.new
1014
+ #
1015
+ # # Call the import_documents method.
1016
+ # result = client.import_documents request
1017
+ #
1018
+ # # The returned object is of type Gapic::Operation. You can use it to
1019
+ # # check the status of an operation, cancel it, or wait for results.
1020
+ # # Here is how to wait for a response.
1021
+ # result.wait_until_done! timeout: 60
1022
+ # if result.response?
1023
+ # p result.response
1024
+ # else
1025
+ # puts "No response received."
1026
+ # end
1027
+ #
840
1028
  def import_documents request, options = nil
841
1029
  raise ::ArgumentError, "request must be provided" if request.nil?
842
1030
 
@@ -873,6 +1061,100 @@ module Google
873
1061
  raise ::Google::Cloud::Error.from_error(e)
874
1062
  end
875
1063
 
1064
+ ##
1065
+ # Create a database.
1066
+ #
1067
+ # @overload create_database(request, options = nil)
1068
+ # Pass arguments to `create_database` via a request object, either of type
1069
+ # {::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest} or an equivalent Hash.
1070
+ #
1071
+ # @param request [::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest, ::Hash]
1072
+ # A request object representing the call parameters. Required. To specify no
1073
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1074
+ # @param options [::Gapic::CallOptions, ::Hash]
1075
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1076
+ #
1077
+ # @overload create_database(parent: nil, database: nil, database_id: nil)
1078
+ # Pass arguments to `create_database` via keyword arguments. Note that at
1079
+ # least one keyword argument is required. To specify no parameters, or to keep all
1080
+ # the default parameter values, pass an empty Hash as a request object (see above).
1081
+ #
1082
+ # @param parent [::String]
1083
+ # Required. A parent name of the form
1084
+ # `projects/{project_id}`
1085
+ # @param database [::Google::Cloud::Firestore::Admin::V1::Database, ::Hash]
1086
+ # Required. The Database to create.
1087
+ # @param database_id [::String]
1088
+ # Required. The ID to use for the database, which will become the final
1089
+ # component of the database's resource name.
1090
+ #
1091
+ # The value must be set to "(default)".
1092
+ # @yield [result, operation] Access the result along with the TransportOperation object
1093
+ # @yieldparam result [::Gapic::Operation]
1094
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1095
+ #
1096
+ # @return [::Gapic::Operation]
1097
+ #
1098
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1099
+ #
1100
+ # @example Basic example
1101
+ # require "google/cloud/firestore/admin/v1"
1102
+ #
1103
+ # # Create a client object. The client can be reused for multiple calls.
1104
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
1105
+ #
1106
+ # # Create a request. To set request fields, pass in keyword arguments.
1107
+ # request = Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest.new
1108
+ #
1109
+ # # Call the create_database method.
1110
+ # result = client.create_database request
1111
+ #
1112
+ # # The returned object is of type Gapic::Operation. You can use it to
1113
+ # # check the status of an operation, cancel it, or wait for results.
1114
+ # # Here is how to wait for a response.
1115
+ # result.wait_until_done! timeout: 60
1116
+ # if result.response?
1117
+ # p result.response
1118
+ # else
1119
+ # puts "No response received."
1120
+ # end
1121
+ #
1122
+ def create_database request, options = nil
1123
+ raise ::ArgumentError, "request must be provided" if request.nil?
1124
+
1125
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest
1126
+
1127
+ # Converts hash and nil to an options object
1128
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1129
+
1130
+ # Customize the options with defaults
1131
+ call_metadata = @config.rpcs.create_database.metadata.to_h
1132
+
1133
+ # Set x-goog-api-client and x-goog-user-project headers
1134
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1135
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1136
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION,
1137
+ transports_version_send: [:rest]
1138
+
1139
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1140
+
1141
+ options.apply_defaults timeout: @config.rpcs.create_database.timeout,
1142
+ metadata: call_metadata,
1143
+ retry_policy: @config.rpcs.create_database.retry_policy
1144
+
1145
+ options.apply_defaults timeout: @config.timeout,
1146
+ metadata: @config.metadata,
1147
+ retry_policy: @config.retry_policy
1148
+
1149
+ @firestore_admin_stub.create_database request, options do |result, operation|
1150
+ result = ::Gapic::Operation.new result, @operations_client, options: options
1151
+ yield result, operation if block_given?
1152
+ return result
1153
+ end
1154
+ rescue ::Gapic::Rest::Error => e
1155
+ raise ::Google::Cloud::Error.from_error(e)
1156
+ end
1157
+
876
1158
  ##
877
1159
  # Gets information about a database.
878
1160
  #
@@ -901,6 +1183,22 @@ module Google
901
1183
  # @return [::Google::Cloud::Firestore::Admin::V1::Database]
902
1184
  #
903
1185
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1186
+ #
1187
+ # @example Basic example
1188
+ # require "google/cloud/firestore/admin/v1"
1189
+ #
1190
+ # # Create a client object. The client can be reused for multiple calls.
1191
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
1192
+ #
1193
+ # # Create a request. To set request fields, pass in keyword arguments.
1194
+ # request = Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest.new
1195
+ #
1196
+ # # Call the get_database method.
1197
+ # result = client.get_database request
1198
+ #
1199
+ # # The returned object is of type Google::Cloud::Firestore::Admin::V1::Database.
1200
+ # p result
1201
+ #
904
1202
  def get_database request, options = nil
905
1203
  raise ::ArgumentError, "request must be provided" if request.nil?
906
1204
 
@@ -964,6 +1262,22 @@ module Google
964
1262
  # @return [::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse]
965
1263
  #
966
1264
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1265
+ #
1266
+ # @example Basic example
1267
+ # require "google/cloud/firestore/admin/v1"
1268
+ #
1269
+ # # Create a client object. The client can be reused for multiple calls.
1270
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
1271
+ #
1272
+ # # Create a request. To set request fields, pass in keyword arguments.
1273
+ # request = Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest.new
1274
+ #
1275
+ # # Call the list_databases method.
1276
+ # result = client.list_databases request
1277
+ #
1278
+ # # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse.
1279
+ # p result
1280
+ #
967
1281
  def list_databases request, options = nil
968
1282
  raise ::ArgumentError, "request must be provided" if request.nil?
969
1283
 
@@ -1028,6 +1342,29 @@ module Google
1028
1342
  # @return [::Gapic::Operation]
1029
1343
  #
1030
1344
  # @raise [::Google::Cloud::Error] if the REST call is aborted.
1345
+ #
1346
+ # @example Basic example
1347
+ # require "google/cloud/firestore/admin/v1"
1348
+ #
1349
+ # # Create a client object. The client can be reused for multiple calls.
1350
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client.new
1351
+ #
1352
+ # # Create a request. To set request fields, pass in keyword arguments.
1353
+ # request = Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest.new
1354
+ #
1355
+ # # Call the update_database method.
1356
+ # result = client.update_database request
1357
+ #
1358
+ # # The returned object is of type Gapic::Operation. You can use it to
1359
+ # # check the status of an operation, cancel it, or wait for results.
1360
+ # # Here is how to wait for a response.
1361
+ # result.wait_until_done! timeout: 60
1362
+ # if result.response?
1363
+ # p result.response
1364
+ # else
1365
+ # puts "No response received."
1366
+ # end
1367
+ #
1031
1368
  def update_database request, options = nil
1032
1369
  raise ::ArgumentError, "request must be provided" if request.nil?
1033
1370
 
@@ -1137,7 +1474,9 @@ module Google
1137
1474
  class Configuration
1138
1475
  extend ::Gapic::Config
1139
1476
 
1140
- config_attr :endpoint, "firestore.googleapis.com", ::String
1477
+ DEFAULT_ENDPOINT = "firestore.googleapis.com"
1478
+
1479
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1141
1480
  config_attr :credentials, nil do |value|
1142
1481
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1143
1482
  allowed.any? { |klass| klass === value }
@@ -1233,6 +1572,11 @@ module Google
1233
1572
  #
1234
1573
  attr_reader :import_documents
1235
1574
  ##
1575
+ # RPC-specific configuration for `create_database`
1576
+ # @return [::Gapic::Config::Method]
1577
+ #
1578
+ attr_reader :create_database
1579
+ ##
1236
1580
  # RPC-specific configuration for `get_database`
1237
1581
  # @return [::Gapic::Config::Method]
1238
1582
  #
@@ -1268,6 +1612,8 @@ module Google
1268
1612
  @export_documents = ::Gapic::Config::Method.new export_documents_config
1269
1613
  import_documents_config = parent_rpcs.import_documents if parent_rpcs.respond_to? :import_documents
1270
1614
  @import_documents = ::Gapic::Config::Method.new import_documents_config
1615
+ create_database_config = parent_rpcs.create_database if parent_rpcs.respond_to? :create_database
1616
+ @create_database = ::Gapic::Config::Method.new create_database_config
1271
1617
  get_database_config = parent_rpcs.get_database if parent_rpcs.respond_to? :get_database
1272
1618
  @get_database = ::Gapic::Config::Method.new get_database_config
1273
1619
  list_databases_config = parent_rpcs.list_databases if parent_rpcs.respond_to? :list_databases