"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createResource = createResource;
exports.getResource = getResource;
exports.deleteResource = deleteResource;
exports.searchResources = searchResources;
const authenticate_request_1 = require("./utils/authenticate-request");
const orval_resources_1 = require("./orval/api/orval-resources");
/**
 * create a resource
 *
 * @param {ICreateResourceParams} options
 * @return {Promise<IResource>}
 */
async function createResource(options) {
    options.token = await (0, authenticate_request_1.authenticateRequest)(options);
    return (0, orval_resources_1.createResource)(options.data, options);
}
/**
 * get a resource by id
 *
 * @param {IGetResourceParams} options
 * @return {Promise<IResource>}
 */
async function getResource(options) {
    options.token = await (0, authenticate_request_1.authenticateRequest)(options);
    return (0, orval_resources_1.getResource)(options.id, options);
}
/**
 * delete a resource by id
 *
 * @param {IDeleteResourceParams} options
 * @return {Promise<IResource>}
 */
async function deleteResource(options) {
    options.token = await (0, authenticate_request_1.authenticateRequest)(options);
    return (0, orval_resources_1.deleteResource)(options.id, options);
}
/**
 * search resources
 *
 * @param {ISearchResourcesParams} options
 * @return {Promise<IResource>}
 */
async function searchResources(options) {
    options.token = await (0, authenticate_request_1.authenticateRequest)(options);
    return (0, orval_resources_1.searchResources)(options.params, options);
}
//# sourceMappingURL=resources.js.map