UNPKG

@gentrace/core

Version:
136 lines (133 loc) 5.41 kB
import axiosWithOptionalFetch from '../axios-instance.mjs'; import { assertParamExists, DUMMY_BASE_URL, setBearerAuthToObject, setSearchParams, toPathString, createRequestFunction } from '../common.mjs'; import { BaseAPI, BASE_PATH } from '../base.mjs'; /* tslint:disable */ /* eslint-disable */ /** * Gentrace API * These API routes are designed to ingest events from clients. * * The version of the OpenAPI document: 0.27.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ var __awaiter = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; /** * V3Api - axios parameter creator * @export */ const V3ApiAxiosParamCreator = function (configuration) { return { /** * * @summary Get evaluations * @param {string} resultId The ID of the result to get evaluations for * @param {*} [options] Override http request option. * @throws {RequiredError} */ v3EvaluationsGet: (resultId, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'resultId' is not null or undefined assertParamExists("v3EvaluationsGet", "resultId", resultId); const localVarPath = `/v3/evaluations`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: "GET" }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication bearerAuth required // http bearer authentication required yield setBearerAuthToObject(localVarHeaderParameter, configuration); if (resultId !== undefined) { localVarQueryParameter["resultId"] = resultId; } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; /** * V3Api - functional programming interface * @export */ const V3ApiFp = function (configuration) { const localVarAxiosParamCreator = V3ApiAxiosParamCreator(configuration); return { /** * * @summary Get evaluations * @param {string} resultId The ID of the result to get evaluations for * @param {*} [options] Override http request option. * @throws {RequiredError} */ v3EvaluationsGet(resultId, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.v3EvaluationsGet(resultId, options); return createRequestFunction(localVarAxiosArgs, axiosWithOptionalFetch, BASE_PATH, configuration); }); }, }; }; /** * V3Api - factory interface * @export */ const V3ApiFactory = function (configuration, basePath, axios) { const localVarFp = V3ApiFp(configuration); return { /** * * @summary Get evaluations * @param {string} resultId The ID of the result to get evaluations for * @param {*} [options] Override http request option. * @throws {RequiredError} */ v3EvaluationsGet(resultId, options) { return localVarFp .v3EvaluationsGet(resultId, options) .then((request) => request(axios, basePath)); }, }; }; /** * V3Api - object-oriented interface * @export * @class V3Api * @extends {BaseAPI} */ class V3Api extends BaseAPI { /** * * @summary Get evaluations * @param {string} resultId The ID of the result to get evaluations for * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof V3Api */ v3EvaluationsGet(resultId, options) { return V3ApiFp(this.configuration) .v3EvaluationsGet(resultId, options) .then((request) => request(this.axios, this.basePath)); } } export { V3Api, V3ApiAxiosParamCreator, V3ApiFactory, V3ApiFp }; //# sourceMappingURL=v3-api.mjs.map