UNPKG

nylas

Version:

A NodeJS wrapper for the Nylas REST API for email, contacts, and calendar.

60 lines (59 loc) 1.63 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Grants = void 0; const resource_js_1 = require("./resource.js"); const utils_js_1 = require("../utils.js"); /** * Nylas Grants API * * The Nylas Grants API allows for the management of grants. */ class Grants extends resource_js_1.Resource { /** * Return all Grants * @return The list of Grants */ async list({ overrides, queryParams } = {}, /** * @deprecated Use `queryParams` instead. */ _queryParams) { return super._list({ queryParams: queryParams ?? _queryParams ?? undefined, path: (0, utils_js_1.makePathParams)('/v3/grants', {}), overrides: overrides ?? {}, }); } /** * Return a Grant * @return The Grant */ find({ grantId, overrides, }) { return super._find({ path: (0, utils_js_1.makePathParams)('/v3/grants/{grantId}', { grantId }), overrides, }); } /** * Update a Grant * @return The updated Grant */ update({ grantId, requestBody, overrides, }) { return super._updatePatch({ path: (0, utils_js_1.makePathParams)('/v3/grants/{grantId}', { grantId }), requestBody, overrides, }); } /** * Delete a Grant * @return The deletion response */ destroy({ grantId, overrides, }) { return super._destroy({ path: (0, utils_js_1.makePathParams)('/v3/grants/{grantId}', { grantId }), overrides, }); } } exports.Grants = Grants;