lib/google/cloud/firestore/admin/v1/firestore_admin/client.rb in google-cloud-firestore-admin-v1-0.12.0 vs lib/google/cloud/firestore/admin/v1/firestore_admin/client.rb in google-cloud-firestore-admin-v1-0.13.0
- old
+ new
@@ -807,11 +807,12 @@
# Currently,
# {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields}
# only supports listing fields that have been explicitly overridden. To issue
# this query, call
# {::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client#list_fields FirestoreAdmin.ListFields}
- # with the filter set to `indexConfig.usesAncestorConfig:false` .
+ # with the filter set to `indexConfig.usesAncestorConfig:false or
+ # `ttlConfig:*`.
#
# @overload list_fields(request, options = nil)
# Pass arguments to `list_fields` via a request object, either of type
# {::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest} or an equivalent Hash.
#
@@ -953,11 +954,11 @@
# choosing a name, be sure to consider Google Cloud Storage naming
# guidelines: https://cloud.google.com/storage/docs/naming.
# If the URI is a bucket (without a namespace path), a prefix will be
# generated based on the start time.
# @param namespace_ids [::Array<::String>]
- # Unspecified means all namespaces. This is the preferred
+ # An empty list represents all namespaces. This is the preferred
# usage for databases that don't use namespaces.
#
# An empty string element represents the default namespace. This should be
# used if the database has data in non-default namespaces, but doesn't want
# to include them. Each namespace in this list must be unique.
@@ -1075,11 +1076,11 @@
# This must match the output_uri_prefix of an ExportDocumentsResponse from
# an export that has completed successfully.
# See:
# {::Google::Cloud::Firestore::Admin::V1::ExportDocumentsResponse#output_uri_prefix google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix}.
# @param namespace_ids [::Array<::String>]
- # Unspecified means all namespaces. This is the preferred
+ # An empty list represents all namespaces. This is the preferred
# usage for databases that don't use namespaces.
#
# An empty string element represents the default namespace. This should be
# used if the database has data in non-default namespaces, but doesn't want
# to include them. Each namespace in this list must be unique.
@@ -1181,12 +1182,16 @@
# Required. The Database to create.
# @param database_id [::String]
# Required. The ID to use for the database, which will become the final
# component of the database's resource name.
#
- # The value must be set to "(default)".
+ # This value should be 4-63 characters. Valid characters are /[a-z][0-9]-/
+ # with first character a letter and the last a letter or a number. Must not
+ # be UUID-like /[0-9a-f]\\{8}(-[0-9a-f]\\{4})\\{3}-[0-9a-f]\\{12}/.
#
+ # "(default)" database id is also valid.
+ #
# @yield [response, operation] Access the result along with the RPC operation
# @yieldparam response [::Gapic::Operation]
# @yieldparam operation [::GRPC::ActiveCall::Operation]
#
# @return [::Gapic::Operation]
@@ -1523,10 +1528,108 @@
rescue ::GRPC::BadStatus => e
raise ::Google::Cloud::Error.from_error(e)
end
##
+ # Deletes a database.
+ #
+ # @overload delete_database(request, options = nil)
+ # Pass arguments to `delete_database` via a request object, either of type
+ # {::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest} or an equivalent Hash.
+ #
+ # @param request [::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest, ::Hash]
+ # A request object representing the call parameters. Required. To specify no
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
+ # @param options [::Gapic::CallOptions, ::Hash]
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
+ #
+ # @overload delete_database(name: nil, etag: nil)
+ # Pass arguments to `delete_database` via keyword arguments. Note that at
+ # least one keyword argument is required. To specify no parameters, or to keep all
+ # the default parameter values, pass an empty Hash as a request object (see above).
+ #
+ # @param name [::String]
+ # Required. A name of the form
+ # `projects/{project_id}/databases/{database_id}`
+ # @param etag [::String]
+ # The current etag of the Database.
+ # If an etag is provided and does not match the current etag of the database,
+ # deletion will be blocked and a FAILED_PRECONDITION error will be returned.
+ #
+ # @yield [response, operation] Access the result along with the RPC operation
+ # @yieldparam response [::Gapic::Operation]
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
+ #
+ # @return [::Gapic::Operation]
+ #
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
+ #
+ # @example Basic example
+ # require "google/cloud/firestore/admin/v1"
+ #
+ # # Create a client object. The client can be reused for multiple calls.
+ # client = Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new
+ #
+ # # Create a request. To set request fields, pass in keyword arguments.
+ # request = Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest.new
+ #
+ # # Call the delete_database method.
+ # result = client.delete_database request
+ #
+ # # The returned object is of type Gapic::Operation. You can use it to
+ # # check the status of an operation, cancel it, or wait for results.
+ # # Here is how to wait for a response.
+ # result.wait_until_done! timeout: 60
+ # if result.response?
+ # p result.response
+ # else
+ # puts "No response received."
+ # end
+ #
+ def delete_database request, options = nil
+ raise ::ArgumentError, "request must be provided" if request.nil?
+
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::Firestore::Admin::V1::DeleteDatabaseRequest
+
+ # Converts hash and nil to an options object
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
+
+ # Customize the options with defaults
+ metadata = @config.rpcs.delete_database.metadata.to_h
+
+ # Set x-goog-api-client and x-goog-user-project headers
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
+ gapic_version: ::Google::Cloud::Firestore::Admin::V1::VERSION
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
+
+ header_params = {}
+ if request.name
+ header_params["name"] = request.name
+ end
+
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
+ metadata[:"x-goog-request-params"] ||= request_params_header
+
+ options.apply_defaults timeout: @config.rpcs.delete_database.timeout,
+ metadata: metadata,
+ retry_policy: @config.rpcs.delete_database.retry_policy
+
+ options.apply_defaults timeout: @config.timeout,
+ metadata: @config.metadata,
+ retry_policy: @config.retry_policy
+
+ @firestore_admin_stub.call_rpc :delete_database, request, options: options do |response, operation|
+ response = ::Gapic::Operation.new response, @operations_client, options: options
+ yield response, operation if block_given?
+ return response
+ end
+ rescue ::GRPC::BadStatus => e
+ raise ::Google::Cloud::Error.from_error(e)
+ end
+
+ ##
# Configuration class for the FirestoreAdmin API.
#
# This class represents the configuration for FirestoreAdmin,
# providing control over timeouts, retry behavior, logging, transport
# parameters, and other low-level controls. Certain parameters can also be
@@ -1732,10 +1835,15 @@
##
# RPC-specific configuration for `update_database`
# @return [::Gapic::Config::Method]
#
attr_reader :update_database
+ ##
+ # RPC-specific configuration for `delete_database`
+ # @return [::Gapic::Config::Method]
+ #
+ attr_reader :delete_database
# @private
def initialize parent_rpcs = nil
create_index_config = parent_rpcs.create_index if parent_rpcs.respond_to? :create_index
@create_index = ::Gapic::Config::Method.new create_index_config
@@ -1761,9 +1869,11 @@
@get_database = ::Gapic::Config::Method.new get_database_config
list_databases_config = parent_rpcs.list_databases if parent_rpcs.respond_to? :list_databases
@list_databases = ::Gapic::Config::Method.new list_databases_config
update_database_config = parent_rpcs.update_database if parent_rpcs.respond_to? :update_database
@update_database = ::Gapic::Config::Method.new update_database_config
+ delete_database_config = parent_rpcs.delete_database if parent_rpcs.respond_to? :delete_database
+ @delete_database = ::Gapic::Config::Method.new delete_database_config
yield self if block_given?
end
end
end