/* tslint:disable */
/* eslint-disable */
/**
 * Synapse REST API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: v1
 *
 *
 * 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 { AgentChatRequestToJSON, AgentChatResponseFromJSON, AgentRegistrationFromJSON, AgentRegistrationRequestToJSON, AgentSessionFromJSON, AsyncJobIdFromJSON, CreateAgentSessionRequestToJSON, TraceEventsRequestToJSON, TraceEventsResponseFromJSON, UpdateAgentSessionRequestToJSON, } from '../models/index';
/**
 *
 */
export class AgentChatServicesApi extends runtime.BaseAPI {
    /**
     */
    async getRepoV1AgentChatAsyncGetAsyncTokenRaw(requestParameters, initOverrides) {
        if (requestParameters['asyncToken'] == null) {
            throw new runtime.RequiredError('asyncToken', 'Required parameter "asyncToken" was null or undefined when calling getRepoV1AgentChatAsyncGetAsyncToken().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/agent/chat/async/get/{asyncToken}`;
        urlPath = urlPath.replace(`{${"asyncToken"}}`, encodeURIComponent(String(requestParameters['asyncToken'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AgentChatResponseFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1AgentChatAsyncGetAsyncToken(requestParameters, initOverrides) {
        const response = await this.getRepoV1AgentChatAsyncGetAsyncTokenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1AgentRegistrationAgentRegistrationIdRaw(requestParameters, initOverrides) {
        if (requestParameters['agentRegistrationId'] == null) {
            throw new runtime.RequiredError('agentRegistrationId', 'Required parameter "agentRegistrationId" was null or undefined when calling getRepoV1AgentRegistrationAgentRegistrationId().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/agent/registration/{agentRegistrationId}`;
        urlPath = urlPath.replace(`{${"agentRegistrationId"}}`, encodeURIComponent(String(requestParameters['agentRegistrationId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AgentRegistrationFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1AgentRegistrationAgentRegistrationId(requestParameters, initOverrides) {
        const response = await this.getRepoV1AgentRegistrationAgentRegistrationIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async getRepoV1AgentSessionSessionIdRaw(requestParameters, initOverrides) {
        if (requestParameters['sessionId'] == null) {
            throw new runtime.RequiredError('sessionId', 'Required parameter "sessionId" was null or undefined when calling getRepoV1AgentSessionSessionId().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/agent/session/{sessionId}`;
        urlPath = urlPath.replace(`{${"sessionId"}}`, encodeURIComponent(String(requestParameters['sessionId'])));
        const response = await this.request({
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AgentSessionFromJSON(jsonValue));
    }
    /**
     */
    async getRepoV1AgentSessionSessionId(requestParameters, initOverrides) {
        const response = await this.getRepoV1AgentSessionSessionIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1AgentChatAsyncStartRaw(requestParameters, initOverrides) {
        if (requestParameters['agentChatRequest'] == null) {
            throw new runtime.RequiredError('agentChatRequest', 'Required parameter "agentChatRequest" was null or undefined when calling postRepoV1AgentChatAsyncStart().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/agent/chat/async/start`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: AgentChatRequestToJSON(requestParameters['agentChatRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AsyncJobIdFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1AgentChatAsyncStart(requestParameters, initOverrides) {
        const response = await this.postRepoV1AgentChatAsyncStartRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1AgentChatTraceJobIdRaw(requestParameters, initOverrides) {
        if (requestParameters['jobId'] == null) {
            throw new runtime.RequiredError('jobId', 'Required parameter "jobId" was null or undefined when calling postRepoV1AgentChatTraceJobId().');
        }
        if (requestParameters['traceEventsRequest'] == null) {
            throw new runtime.RequiredError('traceEventsRequest', 'Required parameter "traceEventsRequest" was null or undefined when calling postRepoV1AgentChatTraceJobId().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/agent/chat/trace/{jobId}`;
        urlPath = urlPath.replace(`{${"jobId"}}`, encodeURIComponent(String(requestParameters['jobId'])));
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: TraceEventsRequestToJSON(requestParameters['traceEventsRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => TraceEventsResponseFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1AgentChatTraceJobId(requestParameters, initOverrides) {
        const response = await this.postRepoV1AgentChatTraceJobIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async postRepoV1AgentSessionRaw(requestParameters, initOverrides) {
        if (requestParameters['createAgentSessionRequest'] == null) {
            throw new runtime.RequiredError('createAgentSessionRequest', 'Required parameter "createAgentSessionRequest" was null or undefined when calling postRepoV1AgentSession().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/agent/session`;
        const response = await this.request({
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: CreateAgentSessionRequestToJSON(requestParameters['createAgentSessionRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AgentSessionFromJSON(jsonValue));
    }
    /**
     */
    async postRepoV1AgentSession(requestParameters, initOverrides) {
        const response = await this.postRepoV1AgentSessionRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async putRepoV1AgentRegistrationRaw(requestParameters, initOverrides) {
        if (requestParameters['agentRegistrationRequest'] == null) {
            throw new runtime.RequiredError('agentRegistrationRequest', 'Required parameter "agentRegistrationRequest" was null or undefined when calling putRepoV1AgentRegistration().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/agent/registration`;
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: AgentRegistrationRequestToJSON(requestParameters['agentRegistrationRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AgentRegistrationFromJSON(jsonValue));
    }
    /**
     */
    async putRepoV1AgentRegistration(requestParameters, initOverrides) {
        const response = await this.putRepoV1AgentRegistrationRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     */
    async putRepoV1AgentSessionSessionIdRaw(requestParameters, initOverrides) {
        if (requestParameters['sessionId'] == null) {
            throw new runtime.RequiredError('sessionId', 'Required parameter "sessionId" was null or undefined when calling putRepoV1AgentSessionSessionId().');
        }
        if (requestParameters['updateAgentSessionRequest'] == null) {
            throw new runtime.RequiredError('updateAgentSessionRequest', 'Required parameter "updateAgentSessionRequest" was null or undefined when calling putRepoV1AgentSessionSessionId().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("bearerAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/repo/v1/agent/session/{sessionId}`;
        urlPath = urlPath.replace(`{${"sessionId"}}`, encodeURIComponent(String(requestParameters['sessionId'])));
        const response = await this.request({
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: UpdateAgentSessionRequestToJSON(requestParameters['updateAgentSessionRequest']),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => AgentSessionFromJSON(jsonValue));
    }
    /**
     */
    async putRepoV1AgentSessionSessionId(requestParameters, initOverrides) {
        const response = await this.putRepoV1AgentSessionSessionIdRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
//# sourceMappingURL=AgentChatServicesApi.js.map