patch method
- GoogleFirestoreAdminV1beta2Field request,
- String name, {
- String? updateMask,
- String? $fields,
Updates 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 / *
.
request
- The metadata request object.
Request parameters:
name
- A field name of the form
projects/{project_id}/databases/{database_id}/collectionGroups/{collection_id}/fields/{field_path}
A field path may be a simple field name, e.g. address
or a path to
fields within map_value , e.g. address.city
, or a special field path.
The only valid special field is *
, which represents any field. Field
paths may be quoted using (backtick). The only character that needs to be escaped within a quoted field path is the backtick character itself, escaped using a backslash. Special characters in field paths that must be quoted include:
,
., ``` (backtick),
`, `
, as well as any ascii symbolic characters. Examples: (Note: Comments here are written in markdown syntax, so there is an additional layer of backticks to represent a code block)
`address.city`` represents a field named address.city
,
not the map key city
in the field address
. \
`` represents a field
named *
, not any field. A special Field
contains the default indexing
settings for all fields. This field's resource name is:
projects/{project_id}/databases/{database_id}/collectionGroups/__default__/fields / *
Indexes defined on this Field
will be applied to all fields which
do not have their own Field
index configuration.
Value must have pattern
^projects/\[^/\]+/databases/\[^/\]+/collectionGroups/\[^/\]+/fields/\[^/\]+$
.
updateMask
- A mask, relative to the field. If specified, only
configuration specified by this field_mask will be updated in the field.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a GoogleLongrunningOperation.
Completes with a commons.ApiRequestError if the API endpoint returned an error.
If the used http.Client
completes with an error when making a REST call,
this method will complete with the same error.
Implementation
async.Future<GoogleLongrunningOperation> patch(
GoogleFirestoreAdminV1beta2Field request,
core.String name, {
core.String? updateMask,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if (updateMask != null) 'updateMask': [updateMask],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1beta2/' + core.Uri.encodeFull('$name');
final response_ = await _requester.request(
url_,
'PATCH',
body: body_,
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}