/*!
 * Copyright (c) 2015-2019 Cisco Systems, Inc. See LICENSE file.
 */

import {WebexPlugin} from '@webex/webex-core';

const Calendar = WebexPlugin.extend({
  namespace: 'Calendar',

  /**
   * Decrypts an encrypted incoming calendar event
   * @param {Object} event
   * @returns {Promise} Resolves with a decrypted calendar event
   */
  processMeetingEvent(event) {
    return this.webex.transform('inbound', event)
      .then(() => event);
  },

  /**
   * Retrieves a collection of meetings based on the request parameters
   * @param {Object} options
   * @param {Date} options.fromDate the start of the time range
   * @param {Date} options.toDate the end of the time range
   * @returns {Promise} Resolves with an array of meetings
   */
  list(options) 

});

export default Calendar;

{
    options = options || {};

    return this.webex.request({
      method: 'GET',
      service: 'calendar',
      resource: 'calendarEvents',
      qs: options
    })
      .then((res) => res.body.items);
  }