/** * 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 { AgentAbsenceServiceCreateAgentAbsenceBody, AgentAbsenceServiceSearchAgentAbsenceParams, AgentAbsenceServiceSearchAgentsAbsencesParams, AgentAbsenceServiceUpdateAgentAbsenceBody, WfmCreateAgentAbsenceResponse, WfmCreateAgentsAbsencesRequest, WfmCreateAgentsAbsencesResponse, WfmDeleteAgentAbsenceResponse, WfmReadAgentAbsenceResponse, WfmSearchAgentAbsenceResponse, WfmSearchAgentsAbsencesResponse, WfmUpdateAgentAbsenceResponse, } from '../_models'; // --- header start // export const // --- title start getAgentAbsenceService = // --- title end (axiosInstance: AxiosInstance = axios) => { // --- header end /** * @summary Searches absences by filters. */ const agentAbsenceServiceSearchAgentsAbsences = ( params?: AgentAbsenceServiceSearchAgentsAbsencesParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/wfm/agents/absences`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Creates absences for multiple specified agents. */ const agentAbsenceServiceCreateAgentsAbsences = ( wfmCreateAgentsAbsencesRequest: WfmCreateAgentsAbsencesRequest, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post( `/wfm/agents/absences`, wfmCreateAgentsAbsencesRequest, options, ); }; /** * @summary Searches agent absences by filters. */ const agentAbsenceServiceSearchAgentAbsence = ( agentId: string, params?: AgentAbsenceServiceSearchAgentAbsenceParams, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get(`/wfm/agents/${agentId}/absences`, { ...options, params: { ...params, ...options?.params, }, }); }; /** * @summary Creates one-day-absence for one agent. */ const agentAbsenceServiceCreateAgentAbsence = ( agentId: string, agentAbsenceServiceCreateAgentAbsenceBody: AgentAbsenceServiceCreateAgentAbsenceBody, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.post( `/wfm/agents/${agentId}/absences`, agentAbsenceServiceCreateAgentAbsenceBody, options, ); }; /** * @summary Deletes agent concrete absence by its id. */ const agentAbsenceServiceDeleteAgentAbsence = ( agentId: string, id: string, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.delete( `/wfm/agents/${agentId}/absences/${id}`, options, ); }; /** * @summary Reads one absence per agent by its id. */ const agentAbsenceServiceReadAgentAbsence = ( agentId: string, id: string, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.get( `/wfm/agents/${agentId}/absences/${id}`, options, ); }; /** * @summary Updates agent concrete absence by its id. */ const agentAbsenceServiceUpdateAgentAbsence = ( agentId: string, agentAbsenceServiceUpdateAgentAbsenceBody: AgentAbsenceServiceUpdateAgentAbsenceBody, options?: AxiosRequestConfig, ): Promise> => { return axiosInstance.put( `/wfm/agents/${agentId}/absences/item.id}`, agentAbsenceServiceUpdateAgentAbsenceBody, options, ); }; // --- footer start return { agentAbsenceServiceSearchAgentsAbsences, agentAbsenceServiceCreateAgentsAbsences, agentAbsenceServiceSearchAgentAbsence, agentAbsenceServiceCreateAgentAbsence, agentAbsenceServiceDeleteAgentAbsence, agentAbsenceServiceReadAgentAbsence, agentAbsenceServiceUpdateAgentAbsence, }; }; export type AgentAbsenceServiceSearchAgentsAbsencesResult = AxiosResponse; export type AgentAbsenceServiceCreateAgentsAbsencesResult = AxiosResponse; export type AgentAbsenceServiceSearchAgentAbsenceResult = AxiosResponse; export type AgentAbsenceServiceCreateAgentAbsenceResult = AxiosResponse; export type AgentAbsenceServiceDeleteAgentAbsenceResult = AxiosResponse; export type AgentAbsenceServiceReadAgentAbsenceResult = AxiosResponse; export type AgentAbsenceServiceUpdateAgentAbsenceResult = AxiosResponse; // --- footer end