new User()
OO wrapper around instance users endpoint.
- Source:
Properties:
Name | Type | Argument | Default | Description |
---|---|---|---|---|
id |
Number | |||
instanceName |
String | |||
username |
String | |||
password |
String | |||
user_key |
String | |||
links |
String |
<optional> |
{} | |
created_at |
Date |
<optional> |
null | |
updated_at |
Date |
<optional> |
null |
Methods
-
addGroup(group)
-
Adds a group to user.
Parameters:
Name Type Description group
Object object with id of group to be added
- Source:
Returns:
- Type
- Promise
Example
User.please().get({instanceName: 'test-one', id: 1}).then(function(user) { user.addGroup({ group: 1}).then(function(group) {}); });
-
deleteGroup(group)
-
Removes a user's group.
Parameters:
Name Type Description group
Object object with id of group to be added
- Source:
Returns:
- Type
- Promise
Example
User.please().get({instanceName: 'test-one', id: 1}).then(function(user) { user.deleteGroup({ group: 1}).then(function(group) {}); });
-
getGroup()
-
Gets a user's group.
- Source:
Returns:
- Type
- Promise
Example
User.please().get({instanceName: 'test-one', id: 1}).then(function(user) { user.getGroup({ group: 1 }).then(function(group) {}); });
-
getGroups()
-
Gets a user's groups.
- Source:
Returns:
- Type
- Promise
Example
User.please().get({instanceName: 'test-one', id: 1}).then(function(user) { user.getGroups().then(function(groups) {}); });
-
resetKey()
-
Restes user key.
- Source:
Returns:
- Type
- Promise
Example
User.please().get({instanceName: 'test-one', id: 1}).then(function(user) { user.resetKey().then(function(user) {}); });