google-cloud-firestore-admin-v1 0.9.0 → 0.11.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: 81e47ddb5eaa9fce2c1f17357eb5cce975f86d1041f1f2910b407fe66b937c55
4
+ data.tar.gz: 36a1477f52a561c65e965f3bd597938b602c10eeca69ede784a88a07b1b0bc53
5
5
  SHA512:
6
- metadata.gz: f033088ffadc96e0ad1ab201745f0b16656bf799ac926afc7d9239aa4c1ce5097f41adf73de2a7a005381af6393da8680b525a4a7c57955f6af205de37a4e5d6
7
- data.tar.gz: cea92f85b56fde40ef31de9a3a9f6282cc9bd7680b812638e88f9b842c3a7b3c505de6b15847c679679604cc008d8db2a045e1ad0b1eec317b20870a6a587f47
6
+ metadata.gz: 54ba9fd6346f66b503cb909dd60bd6a879447062aee3fde3ae49c3128e1f52199db397f0e96c2d61640088764140c978d7780e85577c08422eb94f83a4869290
7
+ data.tar.gz: 825bc0b0b720326721587904c36c1dfff45814f57b0c371b1c683fadddae718730128566359309d5659e61700d9fe629ed90c0041a4f6fd4e3e183551d910deb
@@ -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
@@ -212,7 +212,8 @@ module Google
212
212
  credentials: credentials,
213
213
  endpoint: @config.endpoint,
214
214
  channel_args: @config.channel_args,
215
- interceptors: @config.interceptors
215
+ interceptors: @config.interceptors,
216
+ channel_pool_config: @config.channel_pool
216
217
  )
217
218
  end
218
219
 
@@ -233,9 +234,11 @@ module Google
233
234
  # Service calls
234
235
 
235
236
  ##
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}.
237
+ # Creates a composite index. This returns a
238
+ # {::Google::Longrunning::Operation google.longrunning.Operation} which may be
239
+ # used to track the status of the creation. The metadata for the operation
240
+ # will be the type
241
+ # {::Google::Cloud::Firestore::Admin::V1::IndexOperationMetadata IndexOperationMetadata}.
239
242
  #
240
243
  # @overload create_index(request, options = nil)
241
244
  # Pass arguments to `create_index` via a request object, either of type
@@ -357,8 +360,8 @@ module Google
357
360
  # The number of results to return.
358
361
  # @param page_token [::String]
359
362
  # 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.
363
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_indexes FirestoreAdmin.ListIndexes},
364
+ # that may be used to get the next page of results.
362
365
  #
363
366
  # @yield [response, operation] Access the result along with the RPC operation
364
367
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Index>]
@@ -690,13 +693,16 @@ module Google
690
693
  ##
691
694
  # Updates a field configuration. Currently, field updates apply only to
692
695
  # 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" }`.
696
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#update_field FirestoreAdmin.UpdateField}
697
+ # should provide a field mask to avoid changing any configuration that the
698
+ # caller isn't aware of. The field mask should be specified as: `{ paths:
699
+ # "index_config" }`.
696
700
  #
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}.
701
+ # This call returns a
702
+ # {::Google::Longrunning::Operation google.longrunning.Operation} which may be
703
+ # used to track the status of the field update. The metadata for the
704
+ # operation will be the type
705
+ # {::Google::Cloud::Firestore::Admin::V1::FieldOperationMetadata FieldOperationMetadata}.
700
706
  #
701
707
  # To configure the default field settings for the database, use
702
708
  # the special `Field` with resource name:
@@ -798,10 +804,12 @@ module Google
798
804
  ##
799
805
  # Lists the field configuration and metadata for this database.
800
806
  #
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` .
807
+ # Currently,
808
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields}
809
+ # only supports listing fields that have been explicitly overridden. To issue
810
+ # this query, call
811
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields}
812
+ # with the filter set to `indexConfig.usesAncestorConfig:false` .
805
813
  #
806
814
  # @overload list_fields(request, options = nil)
807
815
  # Pass arguments to `list_fields` via a request object, either of type
@@ -823,16 +831,17 @@ module Google
823
831
  # `projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}`
824
832
  # @param filter [::String]
825
833
  # 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` .
834
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields}
835
+ # only supports listing fields that have been explicitly overridden. To issue
836
+ # this query, call
837
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields}
838
+ # with a filter that includes `indexConfig.usesAncestorConfig:false` .
830
839
  # @param page_size [::Integer]
831
840
  # The number of results to return.
832
841
  # @param page_token [::String]
833
842
  # 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.
843
+ # {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields},
844
+ # that may be used to get the next page of results.
836
845
  #
837
846
  # @yield [response, operation] Access the result along with the RPC operation
838
847
  # @yieldparam response [::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Field>]
@@ -1125,6 +1134,107 @@ module Google
1125
1134
  raise ::Google::Cloud::Error.from_error(e)
1126
1135
  end
1127
1136
 
1137
+ ##
1138
+ # Create a database.
1139
+ #
1140
+ # @overload create_database(request, options = nil)
1141
+ # Pass arguments to `create_database` via a request object, either of type
1142
+ # {::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest} or an equivalent Hash.
1143
+ #
1144
+ # @param request [::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest, ::Hash]
1145
+ # A request object representing the call parameters. Required. To specify no
1146
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1147
+ # @param options [::Gapic::CallOptions, ::Hash]
1148
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1149
+ #
1150
+ # @overload create_database(parent: nil, database: nil, database_id: nil)
1151
+ # Pass arguments to `create_database` via keyword arguments. Note that at
1152
+ # least one keyword argument is required. To specify no parameters, or to keep all
1153
+ # the default parameter values, pass an empty Hash as a request object (see above).
1154
+ #
1155
+ # @param parent [::String]
1156
+ # Required. A parent name of the form
1157
+ # `projects/{project_id}`
1158
+ # @param database [::Google::Cloud::Firestore::Admin::V1::Database, ::Hash]
1159
+ # Required. The Database to create.
1160
+ # @param database_id [::String]
1161
+ # Required. The ID to use for the database, which will become the final
1162
+ # component of the database's resource name.
1163
+ #
1164
+ # The value must be set to "(default)".
1165
+ #
1166
+ # @yield [response, operation] Access the result along with the RPC operation
1167
+ # @yieldparam response [::Gapic::Operation]
1168
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1169
+ #
1170
+ # @return [::Gapic::Operation]
1171
+ #
1172
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1173
+ #
1174
+ # @example Basic example
1175
+ # require "google/cloud/firestore/admin/v1"
1176
+ #
1177
+ # # Create a client object. The client can be reused for multiple calls.
1178
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new
1179
+ #
1180
+ # # Create a request. To set request fields, pass in keyword arguments.
1181
+ # request = Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest.new
1182
+ #
1183
+ # # Call the create_database method.
1184
+ # result = client.create_database request
1185
+ #
1186
+ # # The returned object is of type Gapic::Operation. You can use it to
1187
+ # # check the status of an operation, cancel it, or wait for results.
1188
+ # # Here is how to wait for a response.
1189
+ # result.wait_until_done! timeout: 60
1190
+ # if result.response?
1191
+ # p result.response
1192
+ # else
1193
+ # puts "No response received."
1194
+ # end
1195
+ #
1196
+ def create_database request, options = nil
1197
+ raise ::ArgumentError, "request must be provided" if request.nil?
1198
+
1199
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::CreateDatabaseRequest
1200
+
1201
+ # Converts hash and nil to an options object
1202
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1203
+
1204
+ # Customize the options with defaults
1205
+ metadata = @config.rpcs.create_database.metadata.to_h
1206
+
1207
+ # Set x-goog-api-client and x-goog-user-project headers
1208
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1209
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1210
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION
1211
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1212
+
1213
+ header_params = {}
1214
+ if request.parent
1215
+ header_params["parent"] = request.parent
1216
+ end
1217
+
1218
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1219
+ metadata[:"x-goog-request-params"] ||= request_params_header
1220
+
1221
+ options.apply_defaults timeout: @config.rpcs.create_database.timeout,
1222
+ metadata: metadata,
1223
+ retry_policy: @config.rpcs.create_database.retry_policy
1224
+
1225
+ options.apply_defaults timeout: @config.timeout,
1226
+ metadata: @config.metadata,
1227
+ retry_policy: @config.retry_policy
1228
+
1229
+ @firestore_admin_stub.call_rpc :create_database, request, options: options do |response, operation|
1230
+ response = ::Gapic::Operation.new response, @operations_client, options: options
1231
+ yield response, operation if block_given?
1232
+ return response
1233
+ end
1234
+ rescue ::GRPC::BadStatus => e
1235
+ raise ::Google::Cloud::Error.from_error(e)
1236
+ end
1237
+
1128
1238
  ##
1129
1239
  # Gets information about a database.
1130
1240
  #
@@ -1474,7 +1584,9 @@ module Google
1474
1584
  class Configuration
1475
1585
  extend ::Gapic::Config
1476
1586
 
1477
- config_attr :endpoint, "firestore.googleapis.com", ::String
1587
+ DEFAULT_ENDPOINT = "firestore.googleapis.com"
1588
+
1589
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
1478
1590
  config_attr :credentials, nil do |value|
1479
1591
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
1480
1592
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -1509,6 +1621,14 @@ module Google
1509
1621
  end
1510
1622
  end
1511
1623
 
1624
+ ##
1625
+ # Configuration for the channel pool
1626
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
1627
+ #
1628
+ def channel_pool
1629
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
1630
+ end
1631
+
1512
1632
  ##
1513
1633
  # Configuration RPC class for the FirestoreAdmin API.
1514
1634
  #
@@ -1573,6 +1693,11 @@ module Google
1573
1693
  #
1574
1694
  attr_reader :import_documents
1575
1695
  ##
1696
+ # RPC-specific configuration for `create_database`
1697
+ # @return [::Gapic::Config::Method]
1698
+ #
1699
+ attr_reader :create_database
1700
+ ##
1576
1701
  # RPC-specific configuration for `get_database`
1577
1702
  # @return [::Gapic::Config::Method]
1578
1703
  #
@@ -1608,6 +1733,8 @@ module Google
1608
1733
  @export_documents = ::Gapic::Config::Method.new export_documents_config
1609
1734
  import_documents_config = parent_rpcs.import_documents if parent_rpcs.respond_to? :import_documents
1610
1735
  @import_documents = ::Gapic::Config::Method.new import_documents_config
1736
+ create_database_config = parent_rpcs.create_database if parent_rpcs.respond_to? :create_database
1737
+ @create_database = ::Gapic::Config::Method.new create_database_config
1611
1738
  get_database_config = parent_rpcs.get_database if parent_rpcs.respond_to? :get_database
1612
1739
  @get_database = ::Gapic::Config::Method.new get_database_config
1613
1740
  list_databases_config = parent_rpcs.list_databases if parent_rpcs.respond_to? :list_databases
@@ -94,7 +94,8 @@ module Google
94
94
  credentials: credentials,
95
95
  endpoint: @config.endpoint,
96
96
  channel_args: @config.channel_args,
97
- interceptors: @config.interceptors
97
+ interceptors: @config.interceptors,
98
+ channel_pool_config: @config.channel_pool
98
99
  )
99
100
 
100
101
  # Used by an LRO wrapper for some methods of this service
@@ -665,7 +666,9 @@ module Google
665
666
  class Configuration
666
667
  extend ::Gapic::Config
667
668
 
668
- config_attr :endpoint, "firestore.googleapis.com", ::String
669
+ DEFAULT_ENDPOINT = "firestore.googleapis.com"
670
+
671
+ config_attr :endpoint, DEFAULT_ENDPOINT, ::String
669
672
  config_attr :credentials, nil do |value|
670
673
  allowed = [::String, ::Hash, ::Proc, ::Symbol, ::Google::Auth::Credentials, ::Signet::OAuth2::Client, nil]
671
674
  allowed += [::GRPC::Core::Channel, ::GRPC::Core::ChannelCredentials] if defined? ::GRPC
@@ -700,6 +703,14 @@ module Google
700
703
  end
701
704
  end
702
705
 
706
+ ##
707
+ # Configuration for the channel pool
708
+ # @return [::Gapic::ServiceStub::ChannelPool::Configuration]
709
+ #
710
+ def channel_pool
711
+ @channel_pool ||= ::Gapic::ServiceStub::ChannelPool::Configuration.new
712
+ end
713
+
703
714
  ##
704
715
  # Configuration RPC class for the Operations API.
705
716
  #