"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createEvent = createEvent;
exports.searchEvents = searchEvents;
exports.getEvent = getEvent;
exports.updateEvent = updateEvent;
exports.deleteEvent = deleteEvent;
const authenticate_request_1 = require("./utils/authenticate-request");
const orval_events_1 = require("./orval/api/orval-events");
/**
 * create an event
 *
 * @param {ICreateEventParams} options
 * @return {Promise<IEvent>}
 */
async function createEvent(options) {
    options.token = await (0, authenticate_request_1.authenticateRequest)(options);
    return (0, orval_events_1.createEvent)(options.data, options);
}
/**
 * search events
 *
 * @param {ISearchEventsParams} options
 * @return {Promise<IPagedEventResponse>}
 */
async function searchEvents(options) {
    options.token = await (0, authenticate_request_1.authenticateRequest)(options);
    return (0, orval_events_1.searchEvents)(options.data, options);
}
/**
 * get an event
 *
 * @param {IGetEventParams} options
 * @return {Promise<IEvent>}
 */
async function getEvent(options) {
    options.token = await (0, authenticate_request_1.authenticateRequest)(options);
    return (0, orval_events_1.getEvent)(options.eventId, options);
}
/**
 * update an event
 *
 * @param {IUpdateEventParams} options
 * @return {Promise<IEvent>}
 */
async function updateEvent(options) {
    options.token = await (0, authenticate_request_1.authenticateRequest)(options);
    return (0, orval_events_1.updateEvent)(options.eventId, options.data, options);
}
/**
 * delete an event
 *
 * @param {IDeleteEventParams} options
 * @return {Promise<IEvent>}
 */
async function deleteEvent(options) {
    options.token = await (0, authenticate_request_1.authenticateRequest)(options);
    return (0, orval_events_1.deleteEvent)(options.eventId, options);
}
//# sourceMappingURL=events.js.map