UNPKG

nylas

Version:

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

77 lines (76 loc) 2.03 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Contacts = void 0; const resource_js_1 = require("./resource.js"); /** * Nylas Contacts API * * The Nylas Contacts API allows you to create, update, and delete contacts. */ class Contacts extends resource_js_1.Resource { /** * Return all Contacts * @return The list of Contacts */ list({ identifier, queryParams, overrides, }) { return super._list({ queryParams, path: `/v3/grants/${identifier}/contacts`, overrides, }); } /** * Return a Contact * @return The Contact */ find({ identifier, contactId, queryParams, overrides, }) { return super._find({ path: `/v3/grants/${identifier}/contacts/${contactId}`, queryParams, overrides, }); } /** * Create a Contact * @return The created Contact */ create({ identifier, requestBody, overrides, }) { return super._create({ path: `/v3/grants/${identifier}/contacts`, requestBody, overrides, }); } /** * Update a Contact * @return The updated Contact */ update({ identifier, contactId, requestBody, overrides, }) { return super._update({ path: `/v3/grants/${identifier}/contacts/${contactId}`, requestBody, overrides, }); } /** * Delete a Contact * @return The deletion response */ destroy({ identifier, contactId, overrides, }) { return super._destroy({ path: `/v3/grants/${identifier}/contacts/${contactId}`, overrides, }); } /** * Return a Contact Group * @return The list of Contact Groups */ groups({ identifier, overrides, }) { return super._list({ path: `/v3/grants/${identifier}/contacts/groups`, overrides, }); } } exports.Contacts = Contacts;