User
Instance methods:
Static properties:
Instance Methods
constructor: User(credentials)
Arguments
credentials
(Credentials): Valid credentials corresponding to the current user
Returns
(User) A User instance
fetchProfile()
Returns
(Promise --> Object)
Resolves to the serialized
API response
getProject(id)
new User(credentials).getProject(id)
is equivalent to
new Project(credentials, id)
listProjects()
new User(credentials).listProjects()
is equivalent to
Project.listProjects(credentials)
createProject()
new User(credentials).createProject(name, options)
is equivalent to
Project.createProject(credentials, name, options)
getWhoami()
deprecated
TODO
Static Properties
serializeProfile
Set to override how the SDK serializes the API response for the profile.
By default, this will return an Object
with the structure:
type ProfileResponse = {
id: String,
email: String,
makerId: String,
displayName: String,
firstName: String,
lastName: String,
kind: 'maker' | 'camper' | 'viewer',
}
See Serialization for more information.
serializeList
Set to override how the SDK serializes multiple-entity user API responses,
such as listUsers
.
By default, this will return an Object
with the structure:
type UsersResponse = {
entities: UserResponse[],
}
type UserResponse = {
id: String,
displayName: String,
permission: 'collaborator' | 'owner' | 'viewer',
}
See Serialization for more information.
listUsers(credentials, projectId)
Arguments
credentials
(Credentials): Valid credentials corresponding to the current userprojectId
(String)
Returns
(Promise --> Object)
Resolves to the serialized
API response