create method
- GoogleFirestoreAdminV1Database request,
- String parent, {
- String? databaseId,
- String? $fields,
Create a database.
request
- The metadata request object.
Request parameters:
parent
- Required. A parent name of the form projects/{project_id}
Value must have pattern ^projects/\[^/\]+$
.
databaseId
- Required. The ID to use for the database, which will become
the final component of the database's resource name. This value should be
4-63 characters. Valid characters are /a-z-/ 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.
$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> create(
GoogleFirestoreAdminV1Database request,
core.String parent, {
core.String? databaseId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if (databaseId != null) 'databaseId': [databaseId],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/databases';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return GoogleLongrunningOperation.fromJson(
response_ as core.Map<core.String, core.dynamic>);
}