Constructor
new ResourceServersManager(options)
Parameters:
Name | Type | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
The client options.
|
Members
(inner) auth0RestClient :external:RestClient
Provides an abstraction layer for consuming the Auth0 Resource Servers endpoint.
Type:
(inner) clientOptions :Object
Options object for the Rest Client instance.
Type:
-
Object
Methods
create(data, cbopt) → {Promise|undefined}
Create an API (Resource Server).
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
data |
Object
|
Resource Server data object. |
|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.resourceServers.create(data, function (err) {
if (err) {
// Handle error.
}
// Resource Server created.
});
delete(params, cbopt) → {Promise|undefined}
Delete an existing Resource Server.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
Object
|
Resource Server parameters.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.resourceServers.delete({ id: RESOURCE_SERVER_ID }, function (err) {
if (err) {
// Handle error.
}
// Resource Server deleted.
});
get(params, cbopt) → {Promise|undefined}
Get a Resource Server.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
Object
|
Resource Server parameters.
|
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.resourceServers.get({ id: RESOURCE_SERVER_ID }, function (err, resourceServer) {
if (err) {
// Handle error.
}
console.log(resourceServer);
});
getAll(cbopt) → {Promise|undefined}
Get all resource servers.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
management.resourceServers.getAll(function (err, resourceServers) {
console.log(resourceServers.length);
});
update(params, data, cbopt) → {Promise|undefined}
Update an existing resource server.
Parameters:
Name | Type | Attributes | Description | ||||||
---|---|---|---|---|---|---|---|---|---|
params |
Object
|
Resource Server parameters.
|
|||||||
data |
Object
|
Updated Resource Server data. |
|||||||
cb |
function
|
<optional> |
Callback function. |
Returns:
- Type:
-
Promise
|undefined
Example
var data = { name: 'newResourceServerName' };
var params = { id: RESOURCE_SERVER_ID };
management.resourceServers.update(params, data, function (err, resourceServer) {
if (err) {
// Handle error.
}
console.log(resourceServer.name); // 'newResourceServernName'
});