/** * Generated by orval v8.19.0 🍺 * Do not edit manually. * Webitel API * OpenAPI spec version: 24.04.0 */ import axios from '@aliasedDeps/api-services/axios'; import type { AxiosInstance, AxiosRequestConfig, AxiosResponse } from 'axios'; import type { AgentStateHistoryParams, AgentTodayStatisticsParams, DeleteAgentParams, EngineAgent, EngineAgentCallStatisticsList, EngineAgentInQueueStatisticsList, EngineAgentServiceAgentSetStateBody, EngineAgentServicePatchAgentBody, EngineAgentServiceUpdateAgentBody, EngineAgentServiceUpdateAgentStatusBody, EngineAgentSetStateResponse, EngineAgentStatusStatisticItem, EngineAgentTodayStatisticsResponse, EngineCreateAgentRequest, EngineForAgentPauseCauseList, EngineListAgent, EngineListAgentInQueue, EngineListAgentInTeam, EngineListAgentStateHistory, EngineListAgentStatsStatistic, EngineListAgentUser, EngineListUserStatus, EngineResponse, ReadAgentParams, SearchAgentCallStatisticsParams, SearchAgentInQueueParams, SearchAgentInQueueStatisticsParams, SearchAgentInTeamParams, SearchAgentParams, SearchAgentStateHistoryParams, SearchAgentStatusStatisticItemParams, SearchAgentStatusStatisticParams, SearchLookupUsersAgentNotExistsParams, SearchPauseCauseForAgentParams, SearchUserStatusParams, } from '../_models'; // --- header start // export const // --- title start getAgentService = // --- title end (axiosInstance: AxiosInstance = axios) => { // --- header end /** * @summary List of Agent */ const searchAgent = ( params?: SearchAgentParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/call_center/agents`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Create Agent */ const createAgent = ( engineCreateAgentRequest: EngineCreateAgentRequest, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post( `/call_center/agents`, engineCreateAgentRequest, options, ); }; const searchAgentCallStatistics = ( params?: SearchAgentCallStatisticsParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/call_center/agents/reports/call`, { ...options, params: { ...params, ...options?.params, }, }); }; const searchAgentStatusStatistic = ( params?: SearchAgentStatusStatisticParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/call_center/agents/reports/status`, { ...options, params: { ...params, ...options?.params, }, }); }; const searchAgentStatusStatisticItem = ( agentId: string, params?: SearchAgentStatusStatisticItemParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get( `/call_center/agents/reports/status/${agentId}`, { ...options, params: { ...params, ...options?.params, }, }, ); }; const searchAgentStateHistory = ( params?: SearchAgentStateHistoryParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/call_center/agents/states/history`, { ...options, params: { ...params, ...options?.params, }, }); }; const searchPauseCauseForAgent = ( agentId: string, params?: SearchPauseCauseForAgentParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get( `/call_center/agents/${agentId}/pause_causes`, { ...options, params: { ...params, ...options?.params, }, }, ); }; const agentStateHistory = ( agentId: string, params?: AgentStateHistoryParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get( `/call_center/agents/${agentId}/states/history`, { ...options, params: { ...params, ...options?.params, }, }, ); }; const agentSetState = ( agentId: number, engineAgentServiceAgentSetStateBody: EngineAgentServiceAgentSetStateBody, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.patch( `/call_center/agents/${agentId}/states/waiting`, engineAgentServiceAgentSetStateBody, options, ); }; const searchAgentInQueueStatistics = ( agentId: string, params?: SearchAgentInQueueStatisticsParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get( `/call_center/agents/${agentId}/statistics/queues`, { ...options, params: { ...params, ...options?.params, }, }, ); }; const agentTodayStatistics = ( agentId: string, params?: AgentTodayStatisticsParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get( `/call_center/agents/${agentId}/statistics/today`, { ...options, params: { ...params, ...options?.params, }, }, ); }; /** * @summary Remove Agent */ const deleteAgent = ( id: string, params?: DeleteAgentParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.delete(`/call_center/agents/${id}`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Agent item */ const readAgent = ( id: string, params?: ReadAgentParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/call_center/agents/${id}`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Update Agent */ const patchAgent = ( id: string, engineAgentServicePatchAgentBody: EngineAgentServicePatchAgentBody, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.patch( `/call_center/agents/${id}`, engineAgentServicePatchAgentBody, options, ); }; /** * @summary Update Agent */ const updateAgent = ( id: string, engineAgentServiceUpdateAgentBody: EngineAgentServiceUpdateAgentBody, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.put( `/call_center/agents/${id}`, engineAgentServiceUpdateAgentBody, options, ); }; /** * @summary Searches queues where the specified agent is assigned. Supports pagination, sorting and free-text search. */ const searchAgentInQueue = ( id: string, params?: SearchAgentInQueueParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/call_center/agents/${id}/queues`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Change agent status */ const updateAgentStatus = ( id: string, engineAgentServiceUpdateAgentStatusBody: EngineAgentServiceUpdateAgentStatusBody, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.patch( `/call_center/agents/${id}/status`, engineAgentServiceUpdateAgentStatusBody, options, ); }; /** * @summary todo deprecated ? */ const searchAgentInTeam = ( id: string, params?: SearchAgentInTeamParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/call_center/agents/${id}/teams`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary SearchLookupAgentNotExistsUser */ const searchLookupUsersAgentNotExists = ( params?: SearchLookupUsersAgentNotExistsParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/call_center/lookups/agents/users`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary List of UserStatus */ const searchUserStatus = ( params?: SearchUserStatusParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/call_center/users`, { ...options, params: { ...params, ...options?.params, }, }); }; // --- footer start return { searchAgent, createAgent, searchAgentCallStatistics, searchAgentStatusStatistic, searchAgentStatusStatisticItem, searchAgentStateHistory, searchPauseCauseForAgent, agentStateHistory, agentSetState, searchAgentInQueueStatistics, agentTodayStatistics, deleteAgent, readAgent, patchAgent, updateAgent, searchAgentInQueue, updateAgentStatus, searchAgentInTeam, searchLookupUsersAgentNotExists, searchUserStatus, }; }; export type SearchAgentResult = AxiosResponse; export type CreateAgentResult = AxiosResponse; export type SearchAgentCallStatisticsResult = AxiosResponse; export type SearchAgentStatusStatisticResult = AxiosResponse; export type SearchAgentStatusStatisticItemResult = AxiosResponse; export type SearchAgentStateHistoryResult = AxiosResponse; export type SearchPauseCauseForAgentResult = AxiosResponse; export type AgentStateHistoryResult = AxiosResponse; export type AgentSetStateResult = AxiosResponse; export type SearchAgentInQueueStatisticsResult = AxiosResponse; export type AgentTodayStatisticsResult = AxiosResponse; export type DeleteAgentResult = AxiosResponse; export type ReadAgentResult = AxiosResponse; export type PatchAgentResult = AxiosResponse; export type UpdateAgentResult = AxiosResponse; export type SearchAgentInQueueResult = AxiosResponse; export type UpdateAgentStatusResult = AxiosResponse; export type SearchAgentInTeamResult = AxiosResponse; export type SearchLookupUsersAgentNotExistsResult = AxiosResponse; export type SearchUserStatusResult = AxiosResponse; // --- footer end