UNPKG

nylas

Version:

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

72 lines (71 loc) 1.94 kB
import { makePathParams } from '../utils.js'; import { Resource } from './resource.js'; export class Bookings extends Resource { /** * Return a Booking * @return The booking */ find({ bookingId, queryParams, overrides, }) { return super._find({ path: makePathParams('/v3/scheduling/bookings/{bookingId}', { bookingId, }), queryParams, overrides, }); } /** * Create a Booking * @return The created booking */ create({ requestBody, queryParams, overrides, }) { return super._create({ path: makePathParams('/v3/scheduling/bookings', {}), requestBody, queryParams, overrides, }); } /** * Confirm a Booking * @return The confirmed Booking */ confirm({ bookingId, requestBody, queryParams, overrides, }) { return super._update({ path: makePathParams('/v3/scheduling/bookings/{bookingId}', { bookingId, }), requestBody, queryParams, overrides, }); } /** * Reschedule a Booking * @return The rescheduled Booking */ reschedule({ bookingId, requestBody, queryParams, overrides, }) { return super._updatePatch({ path: makePathParams('/v3/scheduling/bookings/{bookingId}', { bookingId, }), requestBody, queryParams, overrides, }); } /** * Delete a Booking * @return The deleted Booking */ destroy({ bookingId, requestBody, queryParams, overrides, }) { return super._destroy({ path: makePathParams('/v3/scheduling/bookings/{bookingId}', { bookingId, }), requestBody, queryParams, overrides, }); } }