User

Instance methods:

Static properties:

Instance Methods

constructor: User(credentials)

Arguments

  1. 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)

See Project#constructor

new User(credentials).getProject(id)

is equivalent to

new Project(credentials, id)

listProjects()

See Project#listProjects

new User(credentials).listProjects()

is equivalent to

Project.listProjects(credentials)

createProject()

See Project#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

  1. credentials (Credentials): Valid credentials corresponding to the current user
  2. projectId (String)

Returns

(Promise --> Object) Resolves to the serialized API response

results matching ""

    No results matching ""