/* tslint:disable */
/* eslint-disable */
/**
 * elkar-app
 * 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 type {
  GetTaskEventsQuery,
  PaginatedOutputTaskEventOutput,
} from '../models/index';
import {
    GetTaskEventsQueryFromJSON,
    GetTaskEventsQueryToJSON,
    PaginatedOutputTaskEventOutputFromJSON,
    PaginatedOutputTaskEventOutputToJSON,
} from '../models/index';

export interface EpRetrieveTaskEventsRequest {
    getTaskEventsQuery: GetTaskEventsQuery;
}

/**
 * 
 */
export class TaskEventApi extends runtime.BaseAPI {

    /**
     */
    async epRetrieveTaskEventsRaw(requestParameters: EpRetrieveTaskEventsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<PaginatedOutputTaskEventOutput>> {
        if (requestParameters['getTaskEventsQuery'] == null) {
            throw new runtime.RequiredError(
                'getTaskEventsQuery',
                'Required parameter "getTaskEventsQuery" was null or undefined when calling epRetrieveTaskEvents().'
            );
        }

        const queryParameters: any = {};

        const headerParameters: runtime.HTTPHeaders = {};

        headerParameters['Content-Type'] = 'application/json';

        const response = await this.request({
            path: `/task-events/list`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: GetTaskEventsQueryToJSON(requestParameters['getTaskEventsQuery']),
        }, initOverrides);

        return new runtime.JSONApiResponse(response, (jsonValue) => PaginatedOutputTaskEventOutputFromJSON(jsonValue));
    }

    /**
     */
    async epRetrieveTaskEvents(requestParameters: EpRetrieveTaskEventsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<PaginatedOutputTaskEventOutput> {
        const response = await this.epRetrieveTaskEventsRaw(requestParameters, initOverrides);
        return await response.value();
    }

}
