alas/web/service/openapi/apis/DefaultApi.ts

272 lines
9.9 KiB
TypeScript
Raw Normal View History

2022-07-03 15:29:11 +00:00
/* tslint:disable */
/* eslint-disable */
/**
* FastAPI
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.1.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 * as runtime from '../runtime';
import {
HTTPValidationError,
HTTPValidationErrorFromJSON,
HTTPValidationErrorToJSON,
RobertaEmotionResponse,
RobertaEmotionResponseFromJSON,
RobertaEmotionResponseToJSON,
RobertaHateResponse,
RobertaHateResponseFromJSON,
RobertaHateResponseToJSON,
RobertaIronyResponse,
RobertaIronyResponseFromJSON,
RobertaIronyResponseToJSON,
RobertaOffensiveResponse,
RobertaOffensiveResponseFromJSON,
RobertaOffensiveResponseToJSON,
RobertaSentimentResponse,
RobertaSentimentResponseFromJSON,
RobertaSentimentResponseToJSON,
} from '../models';
export interface GetContinuationDialogContinuationGetRequest {
text: string;
}
export interface GetEmotionsRobertaEmotionGetRequest {
text: string;
}
export interface GetHateRobertaHateGetRequest {
text: string;
}
export interface GetIronyRobertaIronyGetRequest {
text: string;
}
export interface GetOffensiveRobertaOffensiveGetRequest {
text: string;
}
export interface GetSentimentRobertaSentimentGetRequest {
text: string;
}
/**
*
*/
export class DefaultApi extends runtime.BaseAPI {
/**
* Get Continuation
*/
async getContinuationDialogContinuationGetRaw(requestParameters: GetContinuationDialogContinuationGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<string>> {
if (requestParameters.text === null || requestParameters.text === undefined) {
throw new runtime.RequiredError('text','Required parameter requestParameters.text was null or undefined when calling getContinuationDialogContinuationGet.');
}
const queryParameters: any = {};
if (requestParameters.text !== undefined) {
queryParameters['text'] = requestParameters.text;
}
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request({
path: `/dialog/continuation`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.TextApiResponse(response) as any;
}
/**
* Get Continuation
*/
async getContinuationDialogContinuationGet(requestParameters: GetContinuationDialogContinuationGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<string> {
const response = await this.getContinuationDialogContinuationGetRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get Emotions
*/
async getEmotionsRobertaEmotionGetRaw(requestParameters: GetEmotionsRobertaEmotionGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<RobertaEmotionResponse>> {
if (requestParameters.text === null || requestParameters.text === undefined) {
throw new runtime.RequiredError('text','Required parameter requestParameters.text was null or undefined when calling getEmotionsRobertaEmotionGet.');
}
const queryParameters: any = {};
if (requestParameters.text !== undefined) {
queryParameters['text'] = requestParameters.text;
}
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request({
path: `/roberta/emotion`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => RobertaEmotionResponseFromJSON(jsonValue));
}
/**
* Get Emotions
*/
async getEmotionsRobertaEmotionGet(requestParameters: GetEmotionsRobertaEmotionGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<RobertaEmotionResponse> {
const response = await this.getEmotionsRobertaEmotionGetRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get Hate
*/
async getHateRobertaHateGetRaw(requestParameters: GetHateRobertaHateGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<RobertaHateResponse>> {
if (requestParameters.text === null || requestParameters.text === undefined) {
throw new runtime.RequiredError('text','Required parameter requestParameters.text was null or undefined when calling getHateRobertaHateGet.');
}
const queryParameters: any = {};
if (requestParameters.text !== undefined) {
queryParameters['text'] = requestParameters.text;
}
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request({
path: `/roberta/hate`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => RobertaHateResponseFromJSON(jsonValue));
}
/**
* Get Hate
*/
async getHateRobertaHateGet(requestParameters: GetHateRobertaHateGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<RobertaHateResponse> {
const response = await this.getHateRobertaHateGetRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get Irony
*/
async getIronyRobertaIronyGetRaw(requestParameters: GetIronyRobertaIronyGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<RobertaIronyResponse>> {
if (requestParameters.text === null || requestParameters.text === undefined) {
throw new runtime.RequiredError('text','Required parameter requestParameters.text was null or undefined when calling getIronyRobertaIronyGet.');
}
const queryParameters: any = {};
if (requestParameters.text !== undefined) {
queryParameters['text'] = requestParameters.text;
}
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request({
path: `/roberta/irony`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => RobertaIronyResponseFromJSON(jsonValue));
}
/**
* Get Irony
*/
async getIronyRobertaIronyGet(requestParameters: GetIronyRobertaIronyGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<RobertaIronyResponse> {
const response = await this.getIronyRobertaIronyGetRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get Offensive
*/
async getOffensiveRobertaOffensiveGetRaw(requestParameters: GetOffensiveRobertaOffensiveGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<RobertaOffensiveResponse>> {
if (requestParameters.text === null || requestParameters.text === undefined) {
throw new runtime.RequiredError('text','Required parameter requestParameters.text was null or undefined when calling getOffensiveRobertaOffensiveGet.');
}
const queryParameters: any = {};
if (requestParameters.text !== undefined) {
queryParameters['text'] = requestParameters.text;
}
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request({
path: `/roberta/offensive`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => RobertaOffensiveResponseFromJSON(jsonValue));
}
/**
* Get Offensive
*/
async getOffensiveRobertaOffensiveGet(requestParameters: GetOffensiveRobertaOffensiveGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<RobertaOffensiveResponse> {
const response = await this.getOffensiveRobertaOffensiveGetRaw(requestParameters, initOverrides);
return await response.value();
}
/**
* Get Sentiment
*/
async getSentimentRobertaSentimentGetRaw(requestParameters: GetSentimentRobertaSentimentGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<runtime.ApiResponse<RobertaSentimentResponse>> {
if (requestParameters.text === null || requestParameters.text === undefined) {
throw new runtime.RequiredError('text','Required parameter requestParameters.text was null or undefined when calling getSentimentRobertaSentimentGet.');
}
const queryParameters: any = {};
if (requestParameters.text !== undefined) {
queryParameters['text'] = requestParameters.text;
}
const headerParameters: runtime.HTTPHeaders = {};
const response = await this.request({
path: `/roberta/sentiment`,
method: 'GET',
headers: headerParameters,
query: queryParameters,
}, initOverrides);
return new runtime.JSONApiResponse(response, (jsonValue) => RobertaSentimentResponseFromJSON(jsonValue));
}
/**
* Get Sentiment
*/
async getSentimentRobertaSentimentGet(requestParameters: GetSentimentRobertaSentimentGetRequest, initOverrides?: RequestInit | runtime.InitOverideFunction): Promise<RobertaSentimentResponse> {
const response = await this.getSentimentRobertaSentimentGetRaw(requestParameters, initOverrides);
return await response.value();
}
}