Skip to main content

user_creds

Creates, updates, deletes, gets or lists a user_creds resource.

Overview

Nameuser_creds
TypeResource
Idgoogle.firestore.user_creds

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringIdentifier. The resource name of the UserCreds. Format: projects/{project}/databases/{database}/userCreds/{user_creds}
createTimestring (google-datetime)Output only. The time the user creds were created.
resourceIdentityobjectResource Identity descriptor. (id: GoogleFirestoreAdminV1ResourceIdentity)
securePasswordstringOutput only. The plaintext server-generated password for the user creds. Only populated in responses for CreateUserCreds and ResetUserPassword.
statestringOutput only. Whether the user creds are enabled or disabled. Defaults to ENABLED on creation.
updateTimestring (google-datetime)Output only. The time the user creds were last updated.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, databasesId, userCredsIdGets a user creds resource. Note that the returned resource does not contain the secret value itself.
listselectprojectsId, databasesIdList all user creds in the database. Note that the returned resource does not contain the secret value itself.
createinsertprojectsId, databasesIduserCredsIdCreate a user creds.
deletedeleteprojectsId, databasesId, userCredsIdDeletes a user creds.
enableexecprojectsId, databasesId, userCredsIdEnables a user creds. No-op if the user creds are already enabled.
disableexecprojectsId, databasesId, userCredsIdDisables a user creds. No-op if the user creds are already disabled.
reset_passwordexecprojectsId, databasesId, userCredsIdResets the password of a user creds.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
databasesIdstring
projectsIdstring
userCredsIdstring
userCredsIdstring

SELECT examples

Gets a user creds resource. Note that the returned resource does not contain the secret value itself.

SELECT
name,
createTime,
resourceIdentity,
securePassword,
state,
updateTime
FROM google.firestore.user_creds
WHERE projectsId = '{{ projectsId }}' -- required
AND databasesId = '{{ databasesId }}' -- required
AND userCredsId = '{{ userCredsId }}' -- required;

INSERT examples

Create a user creds.

INSERT INTO google.firestore.user_creds (
data__name,
data__resourceIdentity,
projectsId,
databasesId,
userCredsId
)
SELECT
'{{ name }}',
'{{ resourceIdentity }}',
'{{ projectsId }}',
'{{ databasesId }}',
'{{ userCredsId }}'
RETURNING
name,
createTime,
resourceIdentity,
securePassword,
state,
updateTime
;

DELETE examples

Deletes a user creds.

DELETE FROM google.firestore.user_creds
WHERE projectsId = '{{ projectsId }}' --required
AND databasesId = '{{ databasesId }}' --required
AND userCredsId = '{{ userCredsId }}' --required;

Lifecycle Methods

Enables a user creds. No-op if the user creds are already enabled.

EXEC google.firestore.user_creds.enable 
@projectsId='{{ projectsId }}' --required,
@databasesId='{{ databasesId }}' --required,
@userCredsId='{{ userCredsId }}' --required;