@gentrace/core
Version:
Core Gentrace Node.JS library
187 lines (177 loc) • 5.13 kB
text/typescript
/* 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.
*/
import type { Configuration } from "../configuration";
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from "axios";
import axiosWithOptionalFetch from "../axios-instance";
// Some imports not used depending on template conditions
// @ts-ignore
import {
DUMMY_BASE_URL,
assertParamExists,
setApiKeyToObject,
setBasicAuthToObject,
setBearerAuthToObject,
setOAuthToObject,
setSearchParams,
serializeDataIfNeeded,
toPathString,
createRequestFunction,
} from "../common";
// @ts-ignore
import {
BASE_PATH,
COLLECTION_FORMATS,
RequestArgs,
BaseAPI,
RequiredError,
} from "../base";
// @ts-ignore
import { V3EvaluationsGet200Response } from "../models";
/**
* V3Api - axios parameter creator
* @export
*/
export const V3ApiAxiosParamCreator = function (configuration?: 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: async (
resultId: string,
options: AxiosRequestConfig = {},
): Promise<RequestArgs> => {
// 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 = {
method: "GET",
...baseOptions,
...options,
};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;
// authentication bearerAuth required
// http bearer authentication required
await setBearerAuthToObject(localVarHeaderParameter, configuration);
if (resultId !== undefined) {
localVarQueryParameter["resultId"] = resultId;
}
setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions =
baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {
...localVarHeaderParameter,
...headersFromBaseOptions,
...options.headers,
};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
};
};
/**
* V3Api - functional programming interface
* @export
*/
export const V3ApiFp = function (configuration?: 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}
*/
async v3EvaluationsGet(
resultId: string,
options?: AxiosRequestConfig,
): Promise<
(
axios?: AxiosInstance,
basePath?: string,
) => AxiosPromise<V3EvaluationsGet200Response>
> {
const localVarAxiosArgs =
await localVarAxiosParamCreator.v3EvaluationsGet(resultId, options);
return createRequestFunction(
localVarAxiosArgs,
axiosWithOptionalFetch,
BASE_PATH,
configuration,
);
},
};
};
/**
* V3Api - factory interface
* @export
*/
export const V3ApiFactory = function (
configuration?: Configuration,
basePath?: string,
axios?: AxiosInstance,
) {
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: string,
options?: any,
): AxiosPromise<V3EvaluationsGet200Response> {
return localVarFp
.v3EvaluationsGet(resultId, options)
.then((request) => request(axios, basePath));
},
};
};
/**
* V3Api - object-oriented interface
* @export
* @class V3Api
* @extends {BaseAPI}
*/
export 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
*/
public v3EvaluationsGet(resultId: string, options?: AxiosRequestConfig) {
return V3ApiFp(this.configuration)
.v3EvaluationsGet(resultId, options)
.then((request) => request(this.axios, this.basePath));
}
}