google-cloud-firestore-admin-v1 0.9.0 → 0.10.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: 44272042c309e5302eec5551cd6a25645a0b73d4cc0beec3f9adf8670bb41248
4
- data.tar.gz: 2d6525b835a1fa295c255479e83f4212aa309dd3427178109d7aa49bd71dcaf4
3
+ metadata.gz: a64d7cdb932ca8be336d7ea367239c9cd58507c78f670afb04517640bca20d11
4
+ data.tar.gz: 2dd3a5fe84f5c060a8331741de3f96d545b4b542564a55252bd92a9e2be36de6
5
5
  SHA512:
6
- metadata.gz: f033088ffadc96e0ad1ab201745f0b16656bf799ac926afc7d9239aa4c1ce5097f41adf73de2a7a005381af6393da8680b525a4a7c57955f6af205de37a4e5d6
7
- data.tar.gz: cea92f85b56fde40ef31de9a3a9f6282cc9bd7680b812638e88f9b842c3a7b3c505de6b15847c679679604cc008d8db2a045e1ad0b1eec317b20870a6a587f47
6
+ metadata.gz: ea66969fbd3c8cdf2eb7b4056e00bc4489b70303b006e4364e5f8784eb16c3462ef2f7e0688ee0f09141e0d6ffc2a737b85dbfa7817c0624ee0bd6bde215cf5d
7
+ data.tar.gz: 750f3c69dbb5678ebfb72976ebec7b114b2f91a28eb4b19e84d13402ec1e3c9e896649846b0dff54dadf6910b54ac6c6d58cc2d004ae31c8328253ddb1880202
@@ -185,7 +185,7 @@ module Google
185
185
  credentials = @config.credentials
186
186
  # Use self-signed JWT if the endpoint is unchanged from default,
187
187
  # but only if the default endpoint does not have a region prefix.
188
- enable_self_signed_jwt = @config.endpoint == Client.configure.endpoint &&
188
+ enable_self_signed_jwt = @config.endpoint == Configuration::DEFAULT_ENDPOINT &&
189
189
  !@config.endpoint.split(".").first.include?("-")
190
190
  credentials ||= Credentials.default scope: @config.scope,
191
191
  enable_self_signed_jwt: enable_self_signed_jwt
@@ -233,9 +233,11 @@ module Google
233
233
  # Service calls
234
234
 
235
235
  ##
236
- # Creates a composite index. This returns a {::Google::Longrunning::Operation google.longrunning.Operation}
237
- # which may be used to track the status of the creation. The metadata for
238
- # the operation will be the type {::Google::Cloud::Firestore::Admin::V1::IndexOperationMetadata IndexOperationMetadata}.
236
+ # Creates a composite index. This returns a
237
+ # {::Google::Longrunning::Operation google.longrunning.Operation} which may be
238
+ # used to track the status of the creation. The metadata for the operation
239
+ # will be the type
240
+ # {::Google::Cloud::Firestore::Admin::V1::IndexOperationMetadata IndexOperationMetadata}.
239
241
  #
240
242
  # @overload create_index(request, options = nil)
241
243
  # Pass arguments to `create_index` via a request object, either of type
@@ -357,8 +359,8 @@ module Google
357
359
  # The number of results to return.
358
360
  # @param page_token [::String]
359
361
  # A page token, returned from a previous call to
360
- # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_indexes FirestoreAdmin.ListIndexes}, that may be used to get the next
361
- # page of results.
362
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_indexes FirestoreAdmin.ListIndexes},
363
+ # that may be used to get the next page of results.
362
364
  #
363
365
  # @yield [response, operation] Access the result along with the RPC operation
364
366
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Index>]
@@ -690,13 +692,16 @@ module Google
690
692
  ##
691
693
  # Updates a field configuration. Currently, field updates apply only to
692
694
  # single field index configuration. However, calls to
693
- # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_field FirestoreAdmin.UpdateField} should provide a field mask to avoid
694
- # changing any configuration that the caller isn't aware of. The field mask
695
- # should be specified as: `{ paths: "index_config" }`.
695
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_field FirestoreAdmin.UpdateField}
696
+ # should provide a field mask to avoid changing any configuration that the
697
+ # caller isn't aware of. The field mask should be specified as: `{ paths:
698
+ # "index_config" }`.
696
699
  #
697
- # This call returns a {::Google::Longrunning::Operation google.longrunning.Operation} which may be used to
698
- # track the status of the field update. The metadata for
699
- # the operation will be the type {::Google::Cloud::Firestore::Admin::V1::FieldOperationMetadata FieldOperationMetadata}.
700
+ # This call returns a
701
+ # {::Google::Longrunning::Operation google.longrunning.Operation} which may be
702
+ # used to track the status of the field update. The metadata for the
703
+ # operation will be the type
704
+ # {::Google::Cloud::Firestore::Admin::V1::FieldOperationMetadata FieldOperationMetadata}.
700
705
  #
701
706
  # To configure the default field settings for the database, use
702
707
  # the special `Field` with resource name:
@@ -798,10 +803,12 @@ module Google
798
803
  ##
799
804
  # Lists the field configuration and metadata for this database.
800
805
  #
801
- # Currently, {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields} only supports listing fields
802
- # that have been explicitly overridden. To issue this query, call
803
- # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields} with the filter set to
804
- # `indexConfig.usesAncestorConfig:false` .
806
+ # Currently,
807
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields}
808
+ # only supports listing fields that have been explicitly overridden. To issue
809
+ # this query, call
810
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields}
811
+ # with the filter set to `indexConfig.usesAncestorConfig:false` .
805
812
  #
806
813
  # @overload list_fields(request, options = nil)
807
814
  # Pass arguments to `list_fields` via a request object, either of type
@@ -823,16 +830,17 @@ module Google
823
830
  # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
824
831
  # @param filter [::String]
825
832
  # The filter to apply to list results. Currently,
826
- # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields} only supports listing fields
827
- # that have been explicitly overridden. To issue this query, call
828
- # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields} with a filter that includes
829
- # `indexConfig.usesAncestorConfig:false` .
833
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields}
834
+ # only supports listing fields that have been explicitly overridden. To issue
835
+ # this query, call
836
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields}
837
+ # with a filter that includes `indexConfig.usesAncestorConfig:false` .
830
838
  # @param page_size [::Integer]
831
839
  # The number of results to return.
832
840
  # @param page_token [::String]
833
841
  # A page token, returned from a previous call to
834
- # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields}, that may be used to get the next
835
- # page of results.
842
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields},
843
+ # that may be used to get the next page of results.
836
844
  #
837
845
  # @yield [response, operation] Access the result along with the RPC operation
838
846
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Field>]
@@ -1125,6 +1133,107 @@ module Google
1125
1133
  raise ::Google::Cloud::Error.from_error(e)
1126
1134
  end
1127
1135
 
1136
+ ##
1137
+ # Create a database.
1138
+ #
1139
+ # @overload create_database(request, options = nil)
1140
+ # Pass arguments to `create_database` via a request object, either of type
1141
+ # {::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest} or an equivalent Hash.
1142
+ #
1143
+ # @param request [::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest, ::Hash]
1144
+ # A request object representing the call parameters. Required. To specify no
1145
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1146
+ # @param options [::Gapic::CallOptions, ::Hash]
1147
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1148
+ #
1149
+ # @overload create_database(parent: nil, database: nil, database_id: nil)
1150
+ # Pass arguments to `create_database` via keyword arguments. Note that at
1151
+ # least one keyword argument is required. To specify no parameters, or to keep all
1152
+ # the default parameter values, pass an empty Hash as a request object (see above).
1153
+ #
1154
+ # @param parent [::String]
1155
+ # Required. A parent name of the form
1156
+ # `projects/{project_id}`
1157
+ # @param database [::Google::Cloud::Firestore::Admin::V1::Database, ::Hash]
1158
+ # Required. The Database to create.
1159
+ # @param database_id [::String]
1160
+ # Required. The ID to use for the database, which will become the final
1161
+ # component of the database's resource name.
1162
+ #
1163
+ # The value must be set to "(default)".
1164
+ #
1165
+ # @yield [response, operation] Access the result along with the RPC operation
1166
+ # @yieldparam response [::Gapic::Operation]
1167
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1168
+ #
1169
+ # @return [::Gapic::Operation]
1170
+ #
1171
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1172
+ #
1173
+ # @example Basic example
1174
+ # require "google/cloud/firestore/admin/v1"
1175
+ #
1176
+ # # Create a client object. The client can be reused for multiple calls.
1177
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new
1178
+ #
1179
+ # # Create a request. To set request fields, pass in keyword arguments.
1180
+ # request = Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest.new
1181
+ #
1182
+ # # Call the create_database method.
1183
+ # result = client.create_database request
1184
+ #
1185
+ # # The returned object is of type Gapic::Operation. You can use it to
1186
+ # # check the status of an operation, cancel it, or wait for results.
1187
+ # # Here is how to wait for a response.
1188
+ # result.wait_until_done! timeout: 60
1189
+ # if result.response?
1190
+ # p result.response
1191
+ # else
1192
+ # puts "No response received."
1193
+ # end
1194
+ #
1195
+ def create_database request, options = nil
1196
+ raise ::ArgumentError, "request must be provided" if request.nil?
1197
+
1198
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest
1199
+
1200
+ # Converts hash and nil to an options object
1201
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1202
+
1203
+ # Customize the options with defaults
1204
+ metadata = @config.rpcs.create_database.metadata.to_h
1205
+
1206
+ # Set x-goog-api-client and x-goog-user-project headers
1207
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1208
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1209
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION
1210
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1211
+
1212
+ header_params = {}
1213
+ if request.parent
1214
+ header_params["parent"] = request.parent
1215
+ end
1216
+
1217
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1218
+ metadata[:"x-goog-request-params"] ||= request_params_header
1219
+
1220
+ options.apply_defaults timeout: @config.rpcs.create_database.timeout,
1221
+ metadata: metadata,
1222
+ retry_policy: @config.rpcs.create_database.retry_policy
1223
+
1224
+ options.apply_defaults timeout: @config.timeout,
1225
+ metadata: @config.metadata,
1226
+ retry_policy: @config.retry_policy
1227
+
1228
+ @firestore_admin_stub.call_rpc :create_database, request, options: options do |response, operation|
1229
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1230
+ yield response, operation if block_given?
1231
+ return response
1232
+ end
1233
+ rescue ::GRPC::BadStatus => e
1234
+ raise ::Google::Cloud::Error.from_error(e)
1235
+ end
1236
+
1128
1237
  ##
1129
1238
  # Gets information about a database.
1130
1239
  #
@@ -1474,7 +1583,9 @@ module Google
1474
1583
  class Configuration
1475
1584
  extend ::Gapic::Config
1476
1585
 
1477
- config_attr :endpoint, "firestore.googleapis.com", ::String
1586
+ DEFAULT_ENDPOINT = "firestore.googleapis.com"
1587
+
1588
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1478
1589
  config_attr :credentials, nil do |value|
1479
1590
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1480
1591
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -1573,6 +1684,11 @@ module Google
1573
1684
  #
1574
1685
  attr_reader :import_documents
1575
1686
  ##
1687
+ # RPC-specific configuration for `create_database`
1688
+ # @return [::Gapic::Config::Method]
1689
+ #
1690
+ attr_reader :create_database
1691
+ ##
1576
1692
  # RPC-specific configuration for `get_database`
1577
1693
  # @return [::Gapic::Config::Method]
1578
1694
  #
@@ -1608,6 +1724,8 @@ module Google
1608
1724
  @export_documents = ::Gapic::Config::Method.new export_documents_config
1609
1725
  import_documents_config = parent_rpcs.import_documents if parent_rpcs.respond_to? :import_documents
1610
1726
  @import_documents = ::Gapic::Config::Method.new import_documents_config
1727
+ create_database_config = parent_rpcs.create_database if parent_rpcs.respond_to? :create_database
1728
+ @create_database = ::Gapic::Config::Method.new create_database_config
1611
1729
  get_database_config = parent_rpcs.get_database if parent_rpcs.respond_to? :get_database
1612
1730
  @get_database = ::Gapic::Config::Method.new get_database_config
1613
1731
  list_databases_config = parent_rpcs.list_databases if parent_rpcs.respond_to? :list_databases
@@ -665,7 +665,9 @@ module Google
665
665
  class Configuration
666
666
  extend ::Gapic::Config
667
667
 
668
- config_attr :endpoint, "firestore.googleapis.com", ::String
668
+ DEFAULT_ENDPOINT = "firestore.googleapis.com"
669
+
670
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
669
671
  config_attr :credentials, nil do |value|
670
672
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
671
673
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -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
@@ -318,8 +320,8 @@ module Google
318
320
  # The number of results to return.
319
321
  # @param page_token [::String]
320
322
  # 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.
323
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_indexes FirestoreAdmin.ListIndexes},
324
+ # that may be used to get the next page of results.
323
325
  # @yield [result, operation] Access the result along with the TransportOperation object
324
326
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Index>]
325
327
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -555,13 +557,16 @@ module Google
555
557
  ##
556
558
  # Updates a field configuration. Currently, field updates apply only to
557
559
  # 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" }`.
560
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#update_field FirestoreAdmin.UpdateField}
561
+ # should provide a field mask to avoid changing any configuration that the
562
+ # caller isn't aware of. The field mask should be specified as: `{ paths:
563
+ # "index_config" }`.
561
564
  #
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}.
565
+ # This call returns a
566
+ # {::Google::Longrunning::Operation google.longrunning.Operation} which may be
567
+ # used to track the status of the field update. The metadata for the
568
+ # operation will be the type
569
+ # {::Google::Cloud::Firestore::Admin::V1::FieldOperationMetadata FieldOperationMetadata}.
565
570
  #
566
571
  # To configure the default field settings for the database, use
567
572
  # the special `Field` with resource name:
@@ -633,10 +638,12 @@ module Google
633
638
  ##
634
639
  # Lists the field configuration and metadata for this database.
635
640
  #
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` .
641
+ # Currently,
642
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields}
643
+ # only supports listing fields that have been explicitly overridden. To issue
644
+ # this query, call
645
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields}
646
+ # with the filter set to `indexConfig.usesAncestorConfig:false` .
640
647
  #
641
648
  # @overload list_fields(request, options = nil)
642
649
  # Pass arguments to `list_fields` via a request object, either of type
@@ -658,16 +665,17 @@ module Google
658
665
  # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
659
666
  # @param filter [::String]
660
667
  # 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` .
668
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields}
669
+ # only supports listing fields that have been explicitly overridden. To issue
670
+ # this query, call
671
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields}
672
+ # with a filter that includes `indexConfig.usesAncestorConfig:false` .
665
673
  # @param page_size [::Integer]
666
674
  # The number of results to return.
667
675
  # @param page_token [::String]
668
676
  # 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.
677
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Rest::Client#list_fields FirestoreAdmin.ListFields},
678
+ # that may be used to get the next page of results.
671
679
  # @yield [result, operation] Access the result along with the TransportOperation object
672
680
  # @yieldparam result [::Gapic::Rest::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Field>]
673
681
  # @yieldparam operation [::Gapic::Rest::TransportOperation]
@@ -873,6 +881,77 @@ module Google
873
881
  raise ::Google::Cloud::Error.from_error(e)
874
882
  end
875
883
 
884
+ ##
885
+ # Create a database.
886
+ #
887
+ # @overload create_database(request, options = nil)
888
+ # Pass arguments to `create_database` via a request object, either of type
889
+ # {::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest} or an equivalent Hash.
890
+ #
891
+ # @param request [::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest, ::Hash]
892
+ # A request object representing the call parameters. Required. To specify no
893
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
894
+ # @param options [::Gapic::CallOptions, ::Hash]
895
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
896
+ #
897
+ # @overload create_database(parent: nil, database: nil, database_id: nil)
898
+ # Pass arguments to `create_database` via keyword arguments. Note that at
899
+ # least one keyword argument is required. To specify no parameters, or to keep all
900
+ # the default parameter values, pass an empty Hash as a request object (see above).
901
+ #
902
+ # @param parent [::String]
903
+ # Required. A parent name of the form
904
+ # `projects/{project_id}`
905
+ # @param database [::Google::Cloud::Firestore::Admin::V1::Database, ::Hash]
906
+ # Required. The Database to create.
907
+ # @param database_id [::String]
908
+ # Required. The ID to use for the database, which will become the final
909
+ # component of the database's resource name.
910
+ #
911
+ # The value must be set to "(default)".
912
+ # @yield [result, operation] Access the result along with the TransportOperation object
913
+ # @yieldparam result [::Gapic::Operation]
914
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
915
+ #
916
+ # @return [::Gapic::Operation]
917
+ #
918
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
919
+ def create_database request, options = nil
920
+ raise ::ArgumentError, "request must be provided" if request.nil?
921
+
922
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest
923
+
924
+ # Converts hash and nil to an options object
925
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
926
+
927
+ # Customize the options with defaults
928
+ call_metadata = @config.rpcs.create_database.metadata.to_h
929
+
930
+ # Set x-goog-api-client and x-goog-user-project headers
931
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
932
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
933
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION,
934
+ transports_version_send: [:rest]
935
+
936
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
937
+
938
+ options.apply_defaults timeout: @config.rpcs.create_database.timeout,
939
+ metadata: call_metadata,
940
+ retry_policy: @config.rpcs.create_database.retry_policy
941
+
942
+ options.apply_defaults timeout: @config.timeout,
943
+ metadata: @config.metadata,
944
+ retry_policy: @config.retry_policy
945
+
946
+ @firestore_admin_stub.create_database request, options do |result, operation|
947
+ result = ::Gapic::Operation.new result, @operations_client, options: options
948
+ yield result, operation if block_given?
949
+ return result
950
+ end
951
+ rescue ::Gapic::Rest::Error => e
952
+ raise ::Google::Cloud::Error.from_error(e)
953
+ end
954
+
876
955
  ##
877
956
  # Gets information about a database.
878
957
  #
@@ -1137,7 +1216,9 @@ module Google
1137
1216
  class Configuration
1138
1217
  extend ::Gapic::Config
1139
1218
 
1140
- config_attr :endpoint, "firestore.googleapis.com", ::String
1219
+ DEFAULT_ENDPOINT = "firestore.googleapis.com"
1220
+
1221
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1141
1222
  config_attr :credentials, nil do |value|
1142
1223
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1143
1224
  allowed.any? { |klass| klass === value }
@@ -1233,6 +1314,11 @@ module Google
1233
1314
  #
1234
1315
  attr_reader :import_documents
1235
1316
  ##
1317
+ # RPC-specific configuration for `create_database`
1318
+ # @return [::Gapic::Config::Method]
1319
+ #
1320
+ attr_reader :create_database
1321
+ ##
1236
1322
  # RPC-specific configuration for `get_database`
1237
1323
  # @return [::Gapic::Config::Method]
1238
1324
  #
@@ -1268,6 +1354,8 @@ module Google
1268
1354
  @export_documents = ::Gapic::Config::Method.new export_documents_config
1269
1355
  import_documents_config = parent_rpcs.import_documents if parent_rpcs.respond_to? :import_documents
1270
1356
  @import_documents = ::Gapic::Config::Method.new import_documents_config
1357
+ create_database_config = parent_rpcs.create_database if parent_rpcs.respond_to? :create_database
1358
+ @create_database = ::Gapic::Config::Method.new create_database_config
1271
1359
  get_database_config = parent_rpcs.get_database if parent_rpcs.respond_to? :get_database
1272
1360
  @get_database = ::Gapic::Config::Method.new get_database_config
1273
1361
  list_databases_config = parent_rpcs.list_databases if parent_rpcs.respond_to? :list_databases
@@ -447,7 +447,9 @@ module Google
447
447
  class Configuration
448
448
  extend ::Gapic::Config
449
449
 
450
- config_attr :endpoint, "firestore.googleapis.com", ::String
450
+ DEFAULT_ENDPOINT = "firestore.googleapis.com"
451
+
452
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
451
453
  config_attr :credentials, nil do |value|
452
454
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
453
455
  allowed.any? { |klass| klass === value }
@@ -568,7 +570,7 @@ module Google
568
570
 
569
571
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_list_operations_request request_pb
570
572
  query_string_params = if query_string_params.any?
571
- query_string_params.to_h { |p| p.split("=", 2) }
573
+ query_string_params.to_h { |p| p.split "=", 2 }
572
574
  else
573
575
  {}
574
576
  end
@@ -606,7 +608,7 @@ module Google
606
608
 
607
609
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_get_operation_request request_pb
608
610
  query_string_params = if query_string_params.any?
609
- query_string_params.to_h { |p| p.split("=", 2) }
611
+ query_string_params.to_h { |p| p.split "=", 2 }
610
612
  else
611
613
  {}
612
614
  end
@@ -644,7 +646,7 @@ module Google
644
646
 
645
647
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_delete_operation_request request_pb
646
648
  query_string_params = if query_string_params.any?
647
- query_string_params.to_h { |p| p.split("=", 2) }
649
+ query_string_params.to_h { |p| p.split "=", 2 }
648
650
  else
649
651
  {}
650
652
  end
@@ -682,7 +684,7 @@ module Google
682
684
 
683
685
  verb, uri, query_string_params, body = OperationsServiceStub.transcode_cancel_operation_request request_pb
684
686
  query_string_params = if query_string_params.any?
685
- query_string_params.to_h { |p| p.split("=", 2) }
687
+ query_string_params.to_h { |p| p.split "=", 2 }
686
688
  else
687
689
  {}
688
690
  end