Reference documentation and code samples for the Cloud Firestore Admin V1 API class Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.
Client for the FirestoreAdmin service.
The Cloud Firestore Admin API.
This API provides several administrative services for Cloud Firestore.
Project, Database, Namespace, Collection, Collection Group, and Document are used as defined in the Google Cloud Firestore API.
Operation: An Operation represents work being performed in the background.
The index service manages Cloud Firestore indexes.
Index creation is performed asynchronously. An Operation resource is created for each such asynchronous operation. The state of the operation (including any errors encountered) may be queried via the Operation resource.
The Operations collection provides a record of actions performed for the specified Project (including any Operations in progress). Operations are not created directly but through calls on other collections or resources.
An Operation that is done may be deleted so that it is no longer listed as
part of the Operation collection. Operations are garbage collected after
30 days. By default, ListOperations will only return in progress and failed
operations. To list completed operation, issue a ListOperations request with
the filter done: true.
Operations are created by service FirestoreAdmin, but are accessed via
service google.longrunning.Operations.
Inherits
- Object
Methods
.configure
def self.configure() { |config| ... } -> Client::ConfigurationConfigure the FirestoreAdmin Client class.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
# Modify the configuration for all FirestoreAdmin clients ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.configure do |config| config.timeout = 10.0 end
#configure
def configure() { |config| ... } -> Client::ConfigurationConfigure the FirestoreAdmin Client instance.
The configuration is set to the derived mode, meaning that values can be changed, but structural changes (adding new fields, etc.) are not allowed. Structural changes should be made on Client.configure.
See Configuration for a description of the configuration fields.
- (config) — Configure the Client client.
- config (Client::Configuration)
#create_index
def create_index(request, options = nil) -> ::Gapic::Operation
def create_index(parent: nil, index: nil) -> ::Gapic::OperationCreates a composite index. This returns a google.longrunning.Operation which may be used to track the status of the creation. The metadata for the operation will be the type IndexOperationMetadata.
def create_index(request, options = nil) -> ::Gapic::Operationcreate_index via a request object, either of type
CreateIndexRequest or an equivalent Hash.
- request (::Google::Cloud::Firestore::Admin::V1::CreateIndexRequest, ::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.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def create_index(parent: nil, index: nil) -> ::Gapic::Operationcreate_index 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).
-
parent (::String) — Required. A parent name of the form
projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id} - index (::Google::Cloud::Firestore::Admin::V1::Index, ::Hash) — Required. The composite index to create.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::CreateIndexRequest.new # Call the create_index method. result = client.create_index request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
#delete_index
def delete_index(request, options = nil) -> ::Google::Protobuf::Empty
def delete_index(name: nil) -> ::Google::Protobuf::EmptyDeletes a composite index.
def delete_index(request, options = nil) -> ::Google::Protobuf::Emptydelete_index via a request object, either of type
DeleteIndexRequest or an equivalent Hash.
- request (::Google::Cloud::Firestore::Admin::V1::DeleteIndexRequest, ::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.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def delete_index(name: nil) -> ::Google::Protobuf::Emptydelete_index 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).
-
name (::String) — Required. A name of the form
projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Protobuf::Empty)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::DeleteIndexRequest.new # Call the delete_index method. result = client.delete_index request # The returned object is of type Google::Protobuf::Empty. p result
#export_documents
def export_documents(request, options = nil) -> ::Gapic::Operation
def export_documents(name: nil, collection_ids: nil, output_uri_prefix: nil) -> ::Gapic::OperationExports a copy of all or a subset of documents from Google Cloud Firestore to another storage system, such as Google Cloud Storage. Recent updates to documents may not be reflected in the export. The export occurs in the background and its progress can be monitored and managed via the Operation resource that is created. The output of an export may only be used once the associated operation is done. If an export operation is cancelled before completion it may leave partial data behind in Google Cloud Storage.
For more details on export behavior and output format, refer to: https://cloud.google.com/firestore/docs/manage-data/export-import
def export_documents(request, options = nil) -> ::Gapic::Operationexport_documents via a request object, either of type
ExportDocumentsRequest or an equivalent Hash.
- request (::Google::Cloud::Firestore::Admin::V1::ExportDocumentsRequest, ::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.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def export_documents(name: nil, collection_ids: nil, output_uri_prefix: nil) -> ::Gapic::Operationexport_documents 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).
-
name (::String) — Required. Database to export. Should be of the form:
projects/{project_id}/databases/{database_id}. - collection_ids (::Array<::String>) — Which collection ids to export. Unspecified means all collections.
-
output_uri_prefix (::String) — The output URI. Currently only supports Google Cloud Storage URIs of the
form:
gs://BUCKET_NAME[/NAMESPACE_PATH], whereBUCKET_NAMEis the name of the Google Cloud Storage bucket andNAMESPACE_PATHis an optional Google Cloud Storage namespace path. When 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.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::ExportDocumentsRequest.new # Call the export_documents method. result = client.export_documents request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
#get_database
def get_database(request, options = nil) -> ::Google::Cloud::Firestore::Admin::V1::Database
def get_database(name: nil) -> ::Google::Cloud::Firestore::Admin::V1::DatabaseGets information about a database.
def get_database(request, options = nil) -> ::Google::Cloud::Firestore::Admin::V1::Databaseget_database via a request object, either of type
GetDatabaseRequest or an equivalent Hash.
- request (::Google::Cloud::Firestore::Admin::V1::GetDatabaseRequest, ::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.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_database(name: nil) -> ::Google::Cloud::Firestore::Admin::V1::Databaseget_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).
-
name (::String) — Required. A name of the form
projects/{project_id}/databases/{database_id}
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Firestore::Admin::V1::Database)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::GetDatabaseRequest.new # Call the get_database method. result = client.get_database request # The returned object is of type Google::Cloud::Firestore::Admin::V1::Database. p result
#get_field
def get_field(request, options = nil) -> ::Google::Cloud::Firestore::Admin::V1::Field
def get_field(name: nil) -> ::Google::Cloud::Firestore::Admin::V1::FieldGets the metadata and configuration for a Field.
def get_field(request, options = nil) -> ::Google::Cloud::Firestore::Admin::V1::Fieldget_field via a request object, either of type
GetFieldRequest or an equivalent Hash.
- request (::Google::Cloud::Firestore::Admin::V1::GetFieldRequest, ::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.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_field(name: nil) -> ::Google::Cloud::Firestore::Admin::V1::Fieldget_field 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).
-
name (::String) — Required. A name of the form
projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_id}
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Firestore::Admin::V1::Field)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::GetFieldRequest.new # Call the get_field method. result = client.get_field request # The returned object is of type Google::Cloud::Firestore::Admin::V1::Field. p result
#get_index
def get_index(request, options = nil) -> ::Google::Cloud::Firestore::Admin::V1::Index
def get_index(name: nil) -> ::Google::Cloud::Firestore::Admin::V1::IndexGets a composite index.
def get_index(request, options = nil) -> ::Google::Cloud::Firestore::Admin::V1::Indexget_index via a request object, either of type
GetIndexRequest or an equivalent Hash.
- request (::Google::Cloud::Firestore::Admin::V1::GetIndexRequest, ::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.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def get_index(name: nil) -> ::Google::Cloud::Firestore::Admin::V1::Indexget_index 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).
-
name (::String) — Required. A name of the form
projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/indexes/{index_id}
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Firestore::Admin::V1::Index)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::GetIndexRequest.new # Call the get_index method. result = client.get_index request # The returned object is of type Google::Cloud::Firestore::Admin::V1::Index. p result
#import_documents
def import_documents(request, options = nil) -> ::Gapic::Operation
def import_documents(name: nil, collection_ids: nil, input_uri_prefix: nil) -> ::Gapic::OperationImports documents into Google Cloud Firestore. Existing documents with the same name are overwritten. The import occurs in the background and its progress can be monitored and managed via the Operation resource that is created. If an ImportDocuments operation is cancelled, it is possible that a subset of the data has already been imported to Cloud Firestore.
def import_documents(request, options = nil) -> ::Gapic::Operationimport_documents via a request object, either of type
ImportDocumentsRequest or an equivalent Hash.
- request (::Google::Cloud::Firestore::Admin::V1::ImportDocumentsRequest, ::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.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def import_documents(name: nil, collection_ids: nil, input_uri_prefix: nil) -> ::Gapic::Operationimport_documents 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).
-
name (::String) — Required. Database to import into. Should be of the form:
projects/{project_id}/databases/{database_id}. - collection_ids (::Array<::String>) — Which collection ids to import. Unspecified means all collections included in the import.
- input_uri_prefix (::String) — Location of the exported files. This must match the output_uri_prefix of an ExportDocumentsResponse from an export that has completed successfully. See: google.firestore.admin.v1.ExportDocumentsResponse.output_uri_prefix.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::ImportDocumentsRequest.new # Call the import_documents method. result = client.import_documents request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
#initialize
def initialize() { |config| ... } -> ClientCreate a new FirestoreAdmin client object.
- (config) — Configure the FirestoreAdmin client.
- config (Client::Configuration)
- (Client) — a new instance of Client
# Create a client using the default configuration client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new # Create a client using a custom configuration client = ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::Client.new do |config| config.timeout = 10.0 end
#list_databases
def list_databases(request, options = nil) -> ::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse
def list_databases(parent: nil) -> ::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponseList all the databases in the project.
def list_databases(request, options = nil) -> ::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponselist_databases via a request object, either of type
ListDatabasesRequest or an equivalent Hash.
- request (::Google::Cloud::Firestore::Admin::V1::ListDatabasesRequest, ::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.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_databases(parent: nil) -> ::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponselist_databases 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).
-
parent (::String) — Required. A parent name of the form
projects/{project_id}
- (response, operation) — Access the result along with the RPC operation
- response (::Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse)
- operation (::GRPC::ActiveCall::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::ListDatabasesRequest.new # Call the list_databases method. result = client.list_databases request # The returned object is of type Google::Cloud::Firestore::Admin::V1::ListDatabasesResponse. p result
#list_fields
def list_fields(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Field>
def list_fields(parent: nil, filter: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Field>Lists the field configuration and metadata for this database.
Currently, FirestoreAdmin.ListFields only supports listing fields
that have been explicitly overridden. To issue this query, call
FirestoreAdmin.ListFields with the filter set to
indexConfig.usesAncestorConfig:false .
def list_fields(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Field>list_fields via a request object, either of type
ListFieldsRequest or an equivalent Hash.
- request (::Google::Cloud::Firestore::Admin::V1::ListFieldsRequest, ::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.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_fields(parent: nil, filter: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Field>list_fields 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).
-
parent (::String) — Required. A parent name of the form
projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id} -
filter (::String) — The filter to apply to list results. Currently,
FirestoreAdmin.ListFields only supports listing fields
that have been explicitly overridden. To issue this query, call
FirestoreAdmin.ListFields with a filter that includes
indexConfig.usesAncestorConfig:false. - page_size (::Integer) — The number of results to return.
- page_token (::String) — A page token, returned from a previous call to FirestoreAdmin.ListFields, that may be used to get the next page of results.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Field>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Field>)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::ListFieldsRequest.new # Call the list_fields method. result = client.list_fields request # The returned object is of type Gapic::PagedEnumerable. You can # iterate over all elements by calling #each, and the enumerable # will lazily make API calls to fetch subsequent pages. Other # methods are also available for managing paging directly. result.each do |response| # Each element is of type ::Google::Cloud::Firestore::Admin::V1::Field. p response end
#list_indexes
def list_indexes(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Index>
def list_indexes(parent: nil, filter: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Index>Lists composite indexes.
def list_indexes(request, options = nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Index>list_indexes via a request object, either of type
ListIndexesRequest or an equivalent Hash.
- request (::Google::Cloud::Firestore::Admin::V1::ListIndexesRequest, ::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.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def list_indexes(parent: nil, filter: nil, page_size: nil, page_token: nil) -> ::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Index>list_indexes 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).
-
parent (::String) — Required. A parent name of the form
projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id} - filter (::String) — The filter to apply to list results.
- page_size (::Integer) — The number of results to return.
- page_token (::String) — A page token, returned from a previous call to FirestoreAdmin.ListIndexes, that may be used to get the next page of results.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Index>)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::PagedEnumerable<::Google::Cloud::Firestore::Admin::V1::Index>)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::ListIndexesRequest.new # Call the list_indexes method. result = client.list_indexes request # The returned object is of type Gapic::PagedEnumerable. You can # iterate over all elements by calling #each, and the enumerable # will lazily make API calls to fetch subsequent pages. Other # methods are also available for managing paging directly. result.each do |response| # Each element is of type ::Google::Cloud::Firestore::Admin::V1::Index. p response end
#operations_client
def operations_client() -> ::Google::Cloud::Firestore::Admin::V1::FirestoreAdmin::OperationsGet the associated client for long-running operations.
#update_database
def update_database(request, options = nil) -> ::Gapic::Operation
def update_database(database: nil, update_mask: nil) -> ::Gapic::OperationUpdates a database.
def update_database(request, options = nil) -> ::Gapic::Operationupdate_database via a request object, either of type
UpdateDatabaseRequest or an equivalent Hash.
- request (::Google::Cloud::Firestore::Admin::V1::UpdateDatabaseRequest, ::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.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_database(database: nil, update_mask: nil) -> ::Gapic::Operationupdate_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).
- database (::Google::Cloud::Firestore::Admin::V1::Database, ::Hash) — Required. The database to update.
- update_mask (::Google::Protobuf::FieldMask, ::Hash) — The list of fields to be updated.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::UpdateDatabaseRequest.new # Call the update_database method. result = client.update_database request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end
#update_field
def update_field(request, options = nil) -> ::Gapic::Operation
def update_field(field: nil, update_mask: nil) -> ::Gapic::OperationUpdates a field configuration. Currently, field updates apply only to
single field index configuration. However, calls to
FirestoreAdmin.UpdateField should provide a field mask to avoid
changing any configuration that the caller isn't aware of. The field mask
should be specified as: { paths: "index_config" }.
This call returns a google.longrunning.Operation which may be used to track the status of the field update. The metadata for the operation will be the type FieldOperationMetadata.
To configure the default field settings for the database, use
the special Field with resource name:
projects/{project_id}/databases/{database_id}/collectionGroups/default/fields/*.
def update_field(request, options = nil) -> ::Gapic::Operationupdate_field via a request object, either of type
UpdateFieldRequest or an equivalent Hash.
- request (::Google::Cloud::Firestore::Admin::V1::UpdateFieldRequest, ::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.
- options (::Gapic::CallOptions, ::Hash) — Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
def update_field(field: nil, update_mask: nil) -> ::Gapic::Operationupdate_field 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).
- field (::Google::Cloud::Firestore::Admin::V1::Field, ::Hash) — Required. The field to be updated.
- update_mask (::Google::Protobuf::FieldMask, ::Hash) — A mask, relative to the field. If specified, only configuration specified by this field_mask will be updated in the field.
- (response, operation) — Access the result along with the RPC operation
- response (::Gapic::Operation)
- operation (::GRPC::ActiveCall::Operation)
- (::Gapic::Operation)
- (::Google::Cloud::Error) — if the RPC is aborted.
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::UpdateFieldRequest.new # Call the update_field method. result = client.update_field request # The returned object is of type Gapic::Operation. You can use this # object to check the status of an operation, cancel it, or wait # for results. Here is how to block until completion: result.wait_until_done! timeout: 60 if result.response? p result.response else puts "Error!" end