create method
- GoogleFirestoreAdminV1UserCreds request,
- String parent, {
- String? userCredsId,
- String? $fields,
Create a user creds.
request
- The metadata request object.
Request parameters:
parent
- Required. A parent name of the form
projects/{project_id}/databases/{database_id}
Value must have pattern ^projects/\[^/\]+/databases/\[^/\]+$
.
userCredsId
- Required. The ID to use for the user creds, which will
become the final component of the user creds'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}/.
$fields
- Selector specifying which fields to include in a partial
response.
Completes with a GoogleFirestoreAdminV1UserCreds.
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<GoogleFirestoreAdminV1UserCreds> create(
GoogleFirestoreAdminV1UserCreds request,
core.String parent, {
core.String? userCredsId,
core.String? $fields,
}) async {
final body_ = convert.json.encode(request);
final queryParams_ = <core.String, core.List<core.String>>{
if (userCredsId != null) 'userCredsId': [userCredsId],
if ($fields != null) 'fields': [$fields],
};
final url_ = 'v1/' + core.Uri.encodeFull('$parent') + '/userCreds';
final response_ = await _requester.request(
url_,
'POST',
body: body_,
queryParams: queryParams_,
);
return GoogleFirestoreAdminV1UserCreds.fromJson(
response_ as core.Map<core.String, core.dynamic>,
);
}