nylas
Version:
A NodeJS wrapper for the Nylas REST API for email, contacts, and calendar.
63 lines (62 loc) • 1.62 kB
JavaScript
import { makePathParams } from '../utils.js';
import { Resource } from './resource.js';
/**
* Nylas Agent Account Policies API
*
* Policies define limits, spam settings, options, and linked rules for Agent Accounts.
*/
export class Policies extends Resource {
/**
* Return all policies.
* @return The list of policies.
*/
list({ queryParams, overrides, } = {}) {
return super._list({
queryParams,
path: makePathParams('/v3/policies', {}),
overrides,
});
}
/**
* Return a policy.
* @return The policy.
*/
find({ policyId, overrides, }) {
return super._find({
path: makePathParams('/v3/policies/{policyId}', { policyId }),
overrides,
});
}
/**
* Create a policy.
* @return The created policy.
*/
create({ requestBody, overrides, }) {
return super._create({
path: makePathParams('/v3/policies', {}),
requestBody,
overrides,
});
}
/**
* Update a policy.
* @return The updated policy.
*/
update({ policyId, requestBody, overrides, }) {
return super._update({
path: makePathParams('/v3/policies/{policyId}', { policyId }),
requestBody,
overrides,
});
}
/**
* Delete a policy.
* @return The deletion response.
*/
destroy({ policyId, overrides, }) {
return super._destroy({
path: makePathParams('/v3/policies/{policyId}', { policyId }),
overrides,
});
}
}